Skip to content

Commit

Permalink
solaris.xml, openbsd.xml, litespeed.xml - set status wip
Browse files Browse the repository at this point in the history
  • Loading branch information
tox11 committed Sep 16, 2024
1 parent 9f9e79a commit 7a21482
Show file tree
Hide file tree
Showing 3 changed files with 507 additions and 0 deletions.
270 changes: 270 additions & 0 deletions install/unix/litespeed.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,270 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- EN-Revision: 7d5b86855e408d3d15fea8f805032cda610df7e1 Maintainer: tox11 Status: wip -->
<!-- $Revision$ -->
<sect1 xml:id="install.unix.litespeed" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
<title>LiteSpeed Web Server/OpenLiteSpeed Web Server on Unix systems</title>

<para>
LiteSpeed PHP is an optimized compilation of PHP built to work with LiteSpeed
products through the LiteSpeed SAPI. LSPHP runs as its own process and has
its own standalone binary, which can be used as a simple command line binary to execute
PHP scripts from the command line.
</para>

<para>
The LSAPI is a highly optimized API that allows communication between
LiteSpeed and third party web engines. Its protocol is similar to FCGI, but is
more efficient.
</para>

<para>
This documentation will cover installing and configuring PHP with LSAPI
for a LiteSpeed Web Server and OpenLiteSpeed Web Server.
</para>

<para>
This guide will assume that either LSWS or OLS is installed with their
default paths and flags. The default installation directory for both web
servers is /usr/local/lsws and both can be run from the bin subdirectory.
</para>

<para>
Please note that throughout this documentation, version numbers have been
replaced with an <literal>x</literal> to ensure this documentation stays correct in the future,
please replace these, as necessary, with the corresponding version numbers.
</para>

<orderedlist>
<listitem>
<para>
To obtain and install either LiteSpeed Web Server or OpenLiteSpeed Web Server, visit the
LiteSpeed Web Server documentation
<link xlink:href="https://docs.litespeedtech.com/products/lsws/installation/">install page</link>
or OpenLiteSpeed documentation
<link xlink:href="https://openlitespeed.org/kb/category/installation/more-installation-methods/">install page</link>.
</para>
</listitem>

<listitem>
<para>
Obtain and unpack the php source:
</para>

<informalexample xml:id="install.unix.litespeed.extract.php">
<screen>
<![CDATA[
mkdir /home/php
cd /home/php
wget http://us1.php.net/get/php-x.x.x.tar.gz/from/this/mirror
tar -zxvf php-x.x.x.tar.gz
cd php-x.x.x
]]>
</screen>
</informalexample>
</listitem>

<listitem>
<para>
Configure and build PHP. This is where PHP can be customized with various options,
such as which extensions will be enabled. Run ./configure --help for a list of available
options. In the example, we'll use the default recommended configuration options for
LiteSpeed Web Server:
</para>

<informalexample xml:id="install.unix.litespeed.build.php">
<screen>
<![CDATA[
./configure ... '--with-litespeed'
make
sudo make install
]]>
</screen>
</informalexample>
</listitem>

<listitem>
<para>
Checking The LSPHP Installation
</para>

<para>
One of the simplest ways to check whether the installation of PHP was successful
is to run the following code:
</para>

<informalexample>
<screen>
<![CDATA[
cd /usr/local/lsws/fcgi-bin/
./lsphp5 -v
]]>
</screen>
</informalexample>

<para>
This should return information about the new PHP build:
</para>

<informalexample>
<screen>
<![CDATA[
PHP 5.6.17 (litespeed) (built: Mar 22 2016 11:34:19)
Copyright (c) 1997-2014 The PHP Group
Zend Engine v2.6.0, Copyright (c) 1998-2015 Zend Technologies
]]>
</screen>
</informalexample>

<para>
Notice the <literal>litespeed</literal> in parenthesis. This means that the PHP binary has been
built with LSAPI support.
</para>
</listitem>
</orderedlist>

<para>
Following the steps above, LiteSpeed / OpenLiteSpeed Web Server should
now be running with support for PHP as an SAPI extension. There are many more
configuration options available for LSWS / OLS and PHP. For more information,
check out the LiteSpeed documentation about
<link xlink:href="https://docs.litespeedtech.com/extapp/php/configuration/control/">PHP</link>.
</para>

<para>
Using LSPHP from the command line:
</para>

<para>
LSPHP(LSAPI + PHP) command line mode is used to process PHP scripts running
on a remote server that does not necessarily have a web server running. It is used
to process PHP scripts residing on a local web server (separate). This setup is
suitable for service scalability as PHP processing is offloaded to a remote server.
</para>

<para>
Start lsphp from the command line on a remote server:
LSPHP is an executable and can be started manually and bound to IPv4, IPv6, or
Unix domain socket addresses with the command line option -b socket_address
</para>

<para>
Examples:
</para>

<para>
Have LSPHP bind to port 3000 on all IPv4 and IPv6 addresses:
</para>

<informalexample>
<screen>
<![CDATA[
/path/to/lsphp -b [::]:3000
]]>
</screen>
</informalexample>

<para>
Have LSPHP bind to port 3000 on all IPv4 addresses:
</para>

<informalexample>
<screen>
<![CDATA[
/path/to/lsphp -b *:3000
]]>
</screen>
</informalexample>

<para>
Have LSPHP bind to address 192.168.0.2:3000:
</para>

<informalexample>
<screen>
<![CDATA[
/path/to/lsphp -b 192.168.0.2:3000
]]>
</screen>
</informalexample>

<para>
Have LSPHP accept requests on Unix domain socket <literal>/tmp/lsphp_manual.sock</literal>:
</para>

<informalexample>
<screen>
<![CDATA[
/path/to/lsphp -b /tmp/lsphp_manual.sock
]]>
</screen>
</informalexample>

<para>
Environment variables can be added before the LSPHP executable:
</para>

<informalexample>
<screen>
<![CDATA[
PHP_LSAPI_MAX_REQUESTS=500 PHP_LSAPI_CHILDREN=35 /path/to/lsphp -b IP_address:port
]]>
</screen>
</informalexample>

<para>
Currently LiteSpeed PHP can be used with LiteSpeed Web Server,
OpenLiteSpeed Web Server, and Apache mod_lsapi. For steps on
server-side configuration, visit the documentation pages for
<link xlink:href="https://docs.litespeedtech.com/extapp/php/getting_started/">LiteSpeed Web Server</link>
and <link xlink:href="https://openlitespeed.org/kb/category/installation/php-installation-guides/">OpenLiteSpeed</link>.
</para>

<para>
LSPHP can be installed in several other ways as well.
</para>

<para>
CentOS:
On CentOS, LSPHP can be installed from the LiteSpeed Repository or the Remi
Repository using <link xlink:href="https://docs.litespeedtech.com/extapp/php/getting_started/#litespeed-repo-search-packages">RPM</link>.
</para>

<para>
Debian:
On Debian, LSPHP can be installed from the LiteSpeed Repository using
<link xlink:href="https://docs.litespeedtech.com/extapp/php/getting_started/#litespeed-repo-search-packages">apt</link>.
</para>

<para>
cPanel:
Visit the respective <link xlink:href="https://docs.litespeedtech.com/cp/cpanel/quickstart/#easyapache-integration">documentation page</link>
about how to install LSPHP with cPanel and LSWS/OLS using EasyApache 4.
</para>

<para>
Plesk:
Plesk can be used with LSPHP on CentOS, CloudLinux, Debian, and Ubuntu,
for more details on this, visit the respective <link xlink:href="https://docs.litespeedtech.com/cp/plesk/">documentation page</link>
</para>
</sect1>

<!-- Keep this comment at the end of the file
Local variables:
mode: sgml
sgml-omittag:t
sgml-shorttag:t
sgml-minimize-attributes:nil
sgml-always-quote-attributes:t
sgml-indent-step:1
sgml-indent-data:t
indent-tabs-mode:nil
sgml-parent-document:nil
sgml-default-dtd-file:"~/.phpdoc/manual.ced"
sgml-exposed-tags:nil
sgml-local-catalogs:nil
sgml-local-ecat-files:nil
End:
vim600: syn=xml fen fdm=syntax fdl=2 si
vim: et tw=78 syn=sgml
vi: ts=1 sw=1
-->
115 changes: 115 additions & 0 deletions install/unix/openbsd.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,115 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- EN-Revision: 093eb6affefe2ef930b08043a668168d2181ecc1 Maintainer: tox11 Status: wip -->
<!-- $Revision$ -->
<sect1 xml:id="install.unix.openbsd" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
<title>OpenBSD installation notes</title>
<para>
This section contains notes and hints specific to installing
PHP on <link xlink:href="&url.openbsd;">OpenBSD</link>.
</para>
<sect2 xml:id="install.unix.openbsd.packages">
<title>Using Binary Packages</title>
<simpara>
Using binary packages to install PHP on OpenBSD is the recommended
and simplest method. The core package has been separated from the various
modules, and each can be installed and removed independently from the others.
The files you need can be found on your OpenBSD CD or on the FTP site.
</simpara>
<simpara>
The main package you need to install is <filename>php</filename>,
which contains the basic engine (plus fpm, gettext and iconv) and might be
available in several versions to choose from. Next, take a look
at the module packages, such as <filename>php-mysqli</filename>
or <filename>php-imap</filename>. You need to use the <command>phpxs</command>
command to activate and deactivate these modules in your &php.ini;.
</simpara>
<example xml:id="install.unix.openbsd.ports.example">
<title>OpenBSD Package Install Example</title>
<programlisting role="shell">
<![CDATA[
# pkg_add php
# pkg_add php-apache
# pkg_add php-mysqli
(install the PEAR libraries)
# pkg_add pear
Follow the instructions shown with each package!
(to remove packages)
# pkg_delete php
# pkg_delete php-apache
# pkg_delete php-mysqli
# pkg_delete pear
]]>
</programlisting>
</example>
<simpara>
Read the <link xlink:href="&url.openbsd.packages;">packages(7)</link>
manual page for more information about binary packages on OpenBSD.
</simpara>
</sect2>
<sect2 xml:id="install.unix.openbsd.ports">
<title>Using Ports</title>
<simpara>
You can also compile up PHP from source using the <link xlink:href="&url.openbsd.ports;">ports tree</link>.
However, this is only recommended for users familiar with OpenBSD. The PHP port
is split into core and extensions. The
extensions generate sub-packages for all of the supported
PHP modules. If you find you do not want to create some of these modules,
use the <command>no_*</command> FLAVOR. For example, to skip building
the imap module, set the FLAVOR to <command>no_imap</command>.
</simpara>
</sect2>
<sect2 xml:id="install.unix.openbsd.faq">
<title>Common Problems</title>
<itemizedlist>
<listitem>
<simpara>Apache and Nginx are no longer the default server on OpenBSD, but they can both be easily
found in ports and packages. The new default server is also called 'httpd'.
</simpara>
</listitem>
<listitem>
<simpara>The default install of httpd runs inside a
<link xlink:href="&url.openbsd.chroot;">chroot(2) jail</link>, which will restrict PHP scripts to
accessing files under <filename>/var/www</filename>. You will therefore need to create a
<filename>/var/www/tmp</filename> directory for PHP session files to be stored, or use an
alternative session backend. In addition, database sockets need to be placed inside the
jail or listen on the <filename>localhost</filename> interface. If you use network functions,
some files from <filename>/etc</filename> such as <filename>/etc/resolv.conf</filename> and
<filename>/etc/services</filename> will need to be moved into <filename>/var/www/etc</filename>.
The OpenBSD PEAR package automatically installs into the correct chroot directories.
</simpara>
</listitem>
<listitem>
<simpara>
The OpenBSD package for the <link xlink:href="&url.gd;">gd</link> extension
requires Xorg to be installed. Unless already installed at base install by
adding the <filename>xbase.tgz</filename> file set, this can be added at
post-installation (see
<link xlink:href="https://www.openbsd.org/faq/faq4.html#FilesNeeded">OpenBSD FAQ#4</link>).
</simpara>
</listitem>
</itemizedlist>
</sect2>
</sect1>

<!-- Keep this comment at the end of the file
Local variables:
mode: sgml
sgml-omittag:t
sgml-shorttag:t
sgml-minimize-attributes:nil
sgml-always-quote-attributes:t
sgml-indent-step:1
sgml-indent-data:t
indent-tabs-mode:nil
sgml-parent-document:nil
sgml-default-dtd-file:"~/.phpdoc/manual.ced"
sgml-exposed-tags:nil
sgml-local-catalogs:nil
sgml-local-ecat-files:nil
End:
vim600: syn=xml fen fdm=syntax fdl=2 si
vim: et tw=78 syn=sgml
vi: ts=1 sw=1
-->
Loading

0 comments on commit 7a21482

Please sign in to comment.