Finish editorial pass through Apache chapter.

Update mod_php to reflect the new port.
Comment out some of the mod_php config until it can be confirmed as
required--the new port does not add these lines and I suspect they were
only needed in Apache 1.x.
Add some references.

Sponsored by:	iXsystems
This commit is contained in:
Dru Lavigne 2014-04-16 17:32:06 +00:00
parent ba0eb3136d
commit 51b6ff17ff
Notes: svn2git 2020-12-08 03:00:23 +00:00
svn path=/head/; revision=44582

View file

@ -4498,21 +4498,21 @@ DocumentRoot <replaceable>/www/someotherdomain.tld</replaceable>
</sect3> </sect3>
<sect3> <sect3>
<title><filename>mod_perl2</filename></title> <title><filename>mod_perl</filename></title>
<indexterm> <indexterm>
<primary>mod_perl2</primary> <primary>mod_perl</primary>
<secondary>Perl</secondary> <secondary>Perl</secondary>
</indexterm> </indexterm>
<para>The <para>The
<filename>mod_perl2</filename> module makes it possible <filename>mod_perl</filename> module makes it possible
to write <application>Apache</application> modules to write <application>Apache</application> modules
in <application>Perl</application>. In addition, the persistent interpreter embedded in <application>Perl</application>. In addition, the persistent interpreter embedded
in the server avoids the overhead of starting an external in the server avoids the overhead of starting an external
interpreter and the penalty of <application>Perl</application> start-up time.</para> interpreter and the penalty of <application>Perl</application> start-up time.</para>
<para>The <filename>mod_perl2</filename> can be installed using the <para>The <filename>mod_perl</filename> can be installed using the
<package>www/mod_perl2</package> package or <package>www/mod_perl2</package> package or
port. Documentation for using this module can be found at port. Documentation for using this module can be found at
<uri <uri
@ -4521,7 +4521,7 @@ DocumentRoot <replaceable>/www/someotherdomain.tld</replaceable>
<sect3> <sect3>
<info> <info>
<title><application>mod_php</application></title> <title><filename>mod_php</filename></title>
<authorgroup> <authorgroup>
<author> <author>
@ -4539,57 +4539,27 @@ DocumentRoot <replaceable>/www/someotherdomain.tld</replaceable>
<secondary>PHP</secondary> <secondary>PHP</secondary>
</indexterm> </indexterm>
<para><acronym>PHP</acronym>, also known as <para><firstterm>PHP: Hypertext Preprocessor</firstterm>
<quote>PHP: Hypertext Preprocessor</quote> is a (<acronym>PHP</acronym>) is a
general-purpose scripting language that is especially suited general-purpose scripting language that is especially suited
for Web development. Capable of being embedded into for web development. Capable of being embedded into
<acronym>HTML</acronym> its syntax draws upon C, &java;, and <acronym>HTML</acronym>, its syntax draws upon
Perl with the intention of allowing web developers to write <application>C</application>, &java;, and
<application>Perl</application> with the intention of allowing web developers to write
dynamically generated webpages quickly.</para> dynamically generated webpages quickly.</para>
<para>To gain support for <acronym>PHP</acronym>5 for the <para>To gain support for <acronym>PHP</acronym>5 for the
<application>Apache</application> web server, begin by <application>Apache</application> web server,
installing the <package>lang/php5</package> install the <package>www/mod_php5</package> package or
port.</para> port. This will install and configure the modules required
<para>If the <package>lang/php5</package>
port is being installed for the first time, available
<literal>OPTIONS</literal> will be displayed automatically.
If a menu is not displayed, i.e., because the
<package>lang/php5</package> port has been installed some
time in the past, it is always possible to bring the
options dialog up again by running:</para>
<screen>&prompt.root; <userinput>make config</userinput></screen>
<para>in the port directory.</para>
<para>In the options dialog, check the
<literal>APACHE</literal> option to build
<application>mod_php5</application> as a loadable module for
the <application>Apache</application> web server.</para>
<note>
<para>A lot of sites are still using <acronym>PHP</acronym>4
for various reasons (i.e., compatibility issues or already
deployed web applications). If the
<application>mod_php4</application> is needed instead of
<application>mod_php5</application>, then please use the
<package>lang/php4</package> port. The
<package>lang/php4</package> port
supports many of the configuration and build-time options
of the <package>lang/php5</package>
port.</para>
</note>
<para>This will install and configure the modules required
to support dynamic <acronym>PHP</acronym> applications. to support dynamic <acronym>PHP</acronym> applications.
Check to ensure the following sections have been added to The installation will automatically add this line to
<filename>/usr/local/etc/apache22/httpd.conf</filename>:</para> <filename>/usr/local/etc/apache2<replaceable>4</replaceable>/httpd.conf</filename>:</para>
<programlisting>LoadModule php5_module libexec/apache/libphp5.so</programlisting> <programlisting>LoadModule php5_module libexec/apache24/libphp5.so</programlisting>
<!--
<programlisting>AddModule mod_php5.c I don't think this is still needed
AddModule mod_php5.c
&lt;IfModule mod_php5.c&gt; &lt;IfModule mod_php5.c&gt;
DirectoryIndex index.php index.html DirectoryIndex index.php index.html
&lt;/IfModule&gt; &lt;/IfModule&gt;
@ -4597,31 +4567,24 @@ DocumentRoot <replaceable>/www/someotherdomain.tld</replaceable>
AddType application/x-httpd-php .php AddType application/x-httpd-php .php
AddType application/x-httpd-php-source .phps AddType application/x-httpd-php-source .phps
&lt;/IfModule&gt;</programlisting> &lt;/IfModule&gt;</programlisting>
-->
<para>Once completed, a simple call to the <para>Then, perform a graceful
<command>apachectl</command> command for a graceful restart to load the <acronym>PHP</acronym>
restart is needed to load the <acronym>PHP</acronym>
module:</para> module:</para>
<screen>&prompt.root; <userinput>apachectl graceful</userinput></screen> <screen>&prompt.root; <userinput>apachectl graceful</userinput></screen>
<para>For future upgrades of <acronym>PHP</acronym>, the <para>The <acronym>PHP</acronym> support provided by
<command>make config</command> command will not be required; <package>www/mod_php5</package>
the selected <literal>OPTIONS</literal> are saved is limited. Additional
automatically by the &os; Ports framework.</para> support can be installed using the
<para>The <acronym>PHP</acronym> support in &os; is extremely
modular so the base install is very limited. It is very
easy to add support using the
<package>lang/php5-extensions</package> <package>lang/php5-extensions</package>
port. This port provides a menu driven interface to port which provides a menu driven interface to the available
<acronym>PHP</acronym> extension installation. <acronym>PHP</acronym> extensions.</para>
Alternatively, individual extensions can be installed using
the appropriate port.</para>
<para>For instance, to add support for the <para>Alternatively, individual extensions can be installed using
<application>MySQL</application> database server to the appropriate port. For instance, to add <acronym>PHP</acronym> support for the
<acronym>PHP</acronym>5, simply install the port <application>MySQL</application> database server, install
<filename>databases/php5-mysql</filename>.</para> <filename>databases/php5-mysql</filename>.</para>
<para>After installing an extension, the <para>After installing an extension, the
@ -4640,15 +4603,11 @@ DocumentRoot <replaceable>/www/someotherdomain.tld</replaceable>
<secondary>dynamic</secondary> <secondary>dynamic</secondary>
</indexterm> </indexterm>
<para>In the last decade, more businesses have turned to the <para>In addition to <application>mod_perl</application> and
Internet in order to enhance their revenue and increase <application>mod_php</application>, other languages are
exposure. This has also increased the need for interactive available for creating dynamic web content. These include
web content. While some companies, such as &microsoft;, <application>Django</application> and
have introduced solutions into their proprietary products, <application>Ruby on Rails</application>.</para>
the open source community answered the call. Modern options
for dynamic web content include Django, Ruby on Rails,
<application>mod_perl2</application>, and
<application>mod_php</application>.</para>
<sect3> <sect3>
<title>Django</title> <title>Django</title>
@ -4656,54 +4615,54 @@ DocumentRoot <replaceable>/www/someotherdomain.tld</replaceable>
<indexterm><primary>Python</primary></indexterm> <indexterm><primary>Python</primary></indexterm>
<indexterm><primary>Django</primary></indexterm> <indexterm><primary>Django</primary></indexterm>
<para>Django is a BSD licensed framework designed to allow <para><application>Django</application> is a BSD-licensed framework designed to allow
developers to write high performance, elegant web developers to write high performance, elegant web
applications quickly. It provides an object-relational applications quickly. It provides an object-relational
mapper so that data types are developed as Python objects, mapper so that data types are developed as <application>Python</application> objects.
and a rich dynamic database-access API is provided for those A rich dynamic database-access <acronym>API</acronym> is provided for those
objects without the developer ever having to write SQL. It objects without the developer ever having to write <acronym>SQL</acronym>. It
also provides an extensible template system so that the also provides an extensible template system so that the
logic of the application is separated from the HTML logic of the application is separated from the <acronym>HTML</acronym>
presentation.</para> presentation.</para>
<para>Django depends on <application>mod_python</application>, <para>Django depends on <filename>mod_python</filename>,
<application>Apache</application>, and an SQL database and an <acronym>SQL</acronym> database
engine. The &os; Port will install all of engine. In &os;, the <package>www/py-django</package> port
these pre-requisites with the appropriate automatically installs <filename>mod_python</filename> and
flags.</para> supports the <application>PostgreSQL</application>,
<application>MySQL</application>, or
<application>SQLite</application> databases, with the default
being <application>SQLite</application>. To change the
datbase engine, type <command>make config</command> within
<filename>/usr/ports/www/py-django</filename>, then install
the port.</para>
<example xml:id="network-www-django-install"> <para>Once <application>Django</application> is installed,
<title>Installing Django with the application will need a project directory along
<application>Apache2</application>, with the <application>Apache</application> configuration in order to
<application>mod_python3</application>, and use the embedded <application>Python</application>
<application>PostgreSQL</application></title> interpreter. This interpreter is used to
call the application for specific <acronym>URL</acronym>s on the site.</para>
<screen>&prompt.root; <userinput>cd /usr/ports/www/py-django; make all install clean -DWITH_MOD_PYTHON3 -DWITH_POSTGRESQL</userinput></screen> <para>To configure <application>Apache</application> to pass
</example> requests for certain <acronym>URL</acronym>s to the web
application, add the following to
<para>Once Django and these pre-requisites are installed, <filename>httpd.conf</filename>, specifying the full path to
the application will need a Django project directory along the project directory:</para>
with the Apache configuration to use the embedded Python
interpreter. This will be the interpreter to
call the application for specific URLs on the site.</para>
<example xml:id="network-www-django-apache-config">
<title>Apache Configuration for Django/mod_python</title>
<para>A line must be added to the apache
<filename>httpd.conf</filename> file to configure Apache
to pass requests for certain URLs to the web
application:</para>
<screen>&lt;Location "/"&gt; <screen>&lt;Location "/"&gt;
SetHandler python-program SetHandler python-program
PythonPath "['/dir/to/the/django/packages/'] + sys.path" PythonPath "['<replaceable>/dir/to/the/django/packages/</replaceable>'] + sys.path"
PythonHandler django.core.handlers.modpython PythonHandler django.core.handlers.modpython
SetEnv DJANGO_SETTINGS_MODULE mysite.settings SetEnv DJANGO_SETTINGS_MODULE mysite.settings
PythonAutoReload On PythonAutoReload On
PythonDebug On PythonDebug On
&lt;/Location&gt;</screen> &lt;/Location&gt;</screen>
</example>
<para>Refer to <uri
xlink:href="https://docs.djangoproject.com/en/1.6/">https://docs.djangoproject.com/en/1.6/</uri>
for more information on how to use
<application>Django</application>.</para>
</sect3> </sect3>
<sect3> <sect3>
@ -4711,13 +4670,17 @@ DocumentRoot <replaceable>/www/someotherdomain.tld</replaceable>
<indexterm><primary>Ruby on Rails</primary></indexterm> <indexterm><primary>Ruby on Rails</primary></indexterm>
<para>Ruby on Rails is another open source web framework that <para><application>Ruby on Rails</application> is another open source web framework that
provides a full development stack and is optimized to make provides a full development stack. It is optimized to make
web developers more productive and capable of writing web developers more productive and capable of writing
powerful applications quickly. It can be installed easily powerful applications quickly. On &os;, tt can be installed
from the ports system.</para> using the <package>www/rubygem-rails</package> package or
port.</para>
<screen>&prompt.root; <userinput>cd /usr/ports/www/rubygem-rails; make all install clean</userinput></screen> <para>Refer to <uri
xlink:href="http://rubyonrails.org/documentation">http://rubyonrails.org/documentation</uri>
for more information on how to use <application>Ruby on
Rails</application>.</para>
</sect3> </sect3>
</sect2> </sect2>
</sect1> </sect1>