From 51b6ff17ff6f21929eac557737c381617a1a93d4 Mon Sep 17 00:00:00 2001 From: Dru Lavigne Date: Wed, 16 Apr 2014 17:32:06 +0000 Subject: [PATCH] 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 --- .../handbook/network-servers/chapter.xml | 195 +++++++----------- 1 file changed, 79 insertions(+), 116 deletions(-) diff --git a/en_US.ISO8859-1/books/handbook/network-servers/chapter.xml b/en_US.ISO8859-1/books/handbook/network-servers/chapter.xml index c7648bea20..784620560d 100644 --- a/en_US.ISO8859-1/books/handbook/network-servers/chapter.xml +++ b/en_US.ISO8859-1/books/handbook/network-servers/chapter.xml @@ -4498,21 +4498,21 @@ DocumentRoot /www/someotherdomain.tld - <filename>mod_perl2</filename> + <filename>mod_perl</filename> - mod_perl2 + mod_perl Perl The - mod_perl2 module makes it possible + mod_perl module makes it possible to write Apache modules in Perl. In addition, the persistent interpreter embedded in the server avoids the overhead of starting an external interpreter and the penalty of Perl start-up time. - The mod_perl2 can be installed using the + The mod_perl can be installed using the www/mod_perl2 package or port. Documentation for using this module can be found at /www/someotherdomain.tld - <application>mod_php</application> + <filename>mod_php</filename> @@ -4539,57 +4539,27 @@ DocumentRoot /www/someotherdomain.tld PHP - PHP, also known as - PHP: Hypertext Preprocessor is a + PHP: Hypertext Preprocessor + (PHP) is a general-purpose scripting language that is especially suited - for Web development. Capable of being embedded into - HTML its syntax draws upon C, &java;, and - Perl with the intention of allowing web developers to write + for web development. Capable of being embedded into + HTML, its syntax draws upon + C, &java;, and + Perl with the intention of allowing web developers to write dynamically generated webpages quickly. To gain support for PHP5 for the - Apache web server, begin by - installing the lang/php5 - port. - - If the lang/php5 - port is being installed for the first time, available - OPTIONS will be displayed automatically. - If a menu is not displayed, i.e., because the - lang/php5 port has been installed some - time in the past, it is always possible to bring the - options dialog up again by running: - - &prompt.root; make config - - in the port directory. - - In the options dialog, check the - APACHE option to build - mod_php5 as a loadable module for - the Apache web server. - - - A lot of sites are still using PHP4 - for various reasons (i.e., compatibility issues or already - deployed web applications). If the - mod_php4 is needed instead of - mod_php5, then please use the - lang/php4 port. The - lang/php4 port - supports many of the configuration and build-time options - of the lang/php5 - port. - - - This will install and configure the modules required + Apache web server, + install the www/mod_php5 package or + port. This will install and configure the modules required to support dynamic PHP applications. - Check to ensure the following sections have been added to - /usr/local/etc/apache22/httpd.conf: + The installation will automatically add this line to + /usr/local/etc/apache24/httpd.conf: - LoadModule php5_module libexec/apache/libphp5.so - - AddModule mod_php5.c + LoadModule php5_module libexec/apache24/libphp5.so + + Then, perform a graceful + restart to load the PHP module: &prompt.root; apachectl graceful - For future upgrades of PHP, the - make config command will not be required; - the selected OPTIONS are saved - automatically by the &os; Ports framework. - - The PHP support in &os; is extremely - modular so the base install is very limited. It is very - easy to add support using the + The PHP support provided by + www/mod_php5 + is limited. Additional + support can be installed using the lang/php5-extensions - port. This port provides a menu driven interface to - PHP extension installation. - Alternatively, individual extensions can be installed using - the appropriate port. + port which provides a menu driven interface to the available + PHP extensions. - For instance, to add support for the - MySQL database server to - PHP5, simply install the port + Alternatively, individual extensions can be installed using + the appropriate port. For instance, to add PHP support for the + MySQL database server, install databases/php5-mysql. After installing an extension, the @@ -4640,15 +4603,11 @@ DocumentRoot /www/someotherdomain.tld dynamic - In the last decade, more businesses have turned to the - Internet in order to enhance their revenue and increase - exposure. This has also increased the need for interactive - web content. While some companies, such as µsoft;, - have introduced solutions into their proprietary products, - the open source community answered the call. Modern options - for dynamic web content include Django, Ruby on Rails, - mod_perl2, and - mod_php. + In addition to mod_perl and + mod_php, other languages are + available for creating dynamic web content. These include + Django and + Ruby on Rails. Django @@ -4656,54 +4615,54 @@ DocumentRoot /www/someotherdomain.tld Python Django - Django is a BSD licensed framework designed to allow + Django is a BSD-licensed framework designed to allow developers to write high performance, elegant web applications quickly. It provides an object-relational - mapper so that data types are developed as Python objects, - and a rich dynamic database-access API is provided for those - objects without the developer ever having to write SQL. It + mapper so that data types are developed as Python objects. + A rich dynamic database-access API is provided for those + objects without the developer ever having to write SQL. It 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 HTML presentation. - Django depends on mod_python, - Apache, and an SQL database - engine. The &os; Port will install all of - these pre-requisites with the appropriate - flags. + Django depends on mod_python, + and an SQL database + engine. In &os;, the www/py-django port + automatically installs mod_python and + supports the PostgreSQL, + MySQL, or + SQLite databases, with the default + being SQLite. To change the + datbase engine, type make config within + /usr/ports/www/py-django, then install + the port. - - Installing Django with - <application>Apache2</application>, - <application>mod_python3</application>, and - <application>PostgreSQL</application> + Once Django is installed, + the application will need a project directory along + with the Apache configuration in order to + use the embedded Python + interpreter. This interpreter is used to + call the application for specific URLs on the site. - &prompt.root; cd /usr/ports/www/py-django; make all install clean -DWITH_MOD_PYTHON3 -DWITH_POSTGRESQL - - - Once Django and these pre-requisites are installed, - the application will need a Django project directory along - 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. - - - Apache Configuration for Django/mod_python - - A line must be added to the apache - httpd.conf file to configure Apache - to pass requests for certain URLs to the web - application: + To configure Apache to pass + requests for certain URLs to the web + application, add the following to + httpd.conf, specifying the full path to + the project directory: <Location "/"> SetHandler python-program - PythonPath "['/dir/to/the/django/packages/'] + sys.path" + PythonPath "['/dir/to/the/django/packages/'] + sys.path" PythonHandler django.core.handlers.modpython SetEnv DJANGO_SETTINGS_MODULE mysite.settings PythonAutoReload On PythonDebug On </Location> - + + Refer to https://docs.djangoproject.com/en/1.6/ + for more information on how to use + Django. @@ -4711,13 +4670,17 @@ DocumentRoot /www/someotherdomain.tld Ruby on Rails - Ruby on Rails is another open source web framework that - provides a full development stack and is optimized to make + Ruby on Rails is another open source web framework that + provides a full development stack. It is optimized to make web developers more productive and capable of writing - powerful applications quickly. It can be installed easily - from the ports system. + powerful applications quickly. On &os;, tt can be installed + using the www/rubygem-rails package or + port. - &prompt.root; cd /usr/ports/www/rubygem-rails; make all install clean + Refer to http://rubyonrails.org/documentation + for more information on how to use Ruby on + Rails.