cvs: phpdoc /en/install/unix apache2.xml
| From: | Daniel P. Brown | Date: | Tue, 24 Jun 2008 21:50:51 +0000 |
| Subject: | cvs: phpdoc /en/install/unix apache2.xml | ||
| Groups: | php.doc.cvs | ||
| Request: | Send a blank email to doc-cvs+get-1799@lists.php.net to get a copy of this message | ||
danbrown Tue Jun 24 21:50:51 2008 UTC
Modified files:
/phpdoc/en/install/unix apache2.xml
Log:
Addresses Bug #45229 and includes the suggestion for a more secure Apache config. I use this
myself as well.
http://cvs.php.net/viewvc.cgi/phpdoc/en/install/unix/apache2.xml?r1=1.8&r2=1.9&diff_format=u
Index: phpdoc/en/install/unix/apache2.xml
diff -u phpdoc/en/install/unix/apache2.xml:1.8 phpdoc/en/install/unix/apache2.xml:1.9
--- phpdoc/en/install/unix/apache2.xml:1.8 Fri Apr 4 20:28:31 2008
+++ phpdoc/en/install/unix/apache2.xml Tue Jun 24 21:50:51 2008
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="iso-8859-1"?>
-<!-- $Revision: 1.8 $ -->
+<!-- $Revision: 1.9 $ -->
<sect1 xml:id="install.unix.apache2" xmlns="http://docbook.org/ns/docbook"
xmlns:xlink="http://www.w3.org/1999/xlink">
<title>Apache 2.0 on Unix systems</title>
<para>
@@ -96,41 +96,50 @@
LoadModule php5_module modules/libphp5.so
-15. Tell Apache to parse certain extensions as PHP. For example,
- let's have Apache parse the .php extension as PHP. You could
- have any extension(s) parse as PHP by simply adding more, with
- each separated by a space. We'll add .phtml to demonstrate.
+15. Tell Apache to parse certain extensions as PHP. For example, let's have
+ Apache parse the .php as PHP. Instead of only using the Apache AddType
+ directive, we want to avoid potentially dangerous uploads and created
+ files such as exploit.php.jpg from being executed as PHP. Using this
+ example, you could have any extension(s) parse as PHP by simply adding
+ them. We'll add .phtml to demonstrate.
- AddType application/x-httpd-php .php .phtml
-
- It's also common to setup the .phps extension to show highlighted PHP
- source, this can be done with:
+ <FilesMatch \.php$>
+ SetHandler application/x-httpd-php
+ </FilesMatch>
+
+ <FilesMatch \.phtml$>
+ SetHandler application/x-httpd-php
+ </FilesMatch>
+
+
- AddType application/x-httpd-php-source .phps
-
+
16. Use your normal procedure for starting the Apache server, e.g.:
/usr/local/apache2/bin/apachectl start
+
+ - OR -
+
+ service httpd restart
]]>
</screen>
</example>
<para>
- Following the steps above you will have a running Apache 2.0 with
- support for PHP as <literal>SAPI</literal> module.
- Of course there are many more configuration options available for both,
- Apache and PHP. For more information use
- <command>./configure --help</command> in the corresponding source
- tree. In case you wish to build a multithreaded version of Apache 2.0
- you must overwrite the standard MPM-Module <filename>prefork</filename>
- either with <filename>worker</filename> or
<filename>perchild</filename>.
- To do so append to your configure line in step 6 above either the option
+ Following the steps above you will have a running Apache2 web server with
+ support for PHP as a <literal>SAPI</literal> module. Of course there are
+ many more configuration options available Apache and PHP. For more
+ information type <command>./configure --help</command> in the corresponding
+ source tree. If you wish to build a multithreaded version of Apache2, you
+ must overwrite the standard MPM-Module <filename>prefork</filename> either
+ with <filename>worker</filename> or <filename>perchild</filename>. To
do
+ so append to your configure line in step 6 above either the option
<option role="configure">--with-mpm=worker</option> or
- <option role="configure">--with-mpm=perchild</option>. Take care about
- the consequences and understand what you are doing. For more information
- read the Apache documentation about the <link
xlink:href="&url.apache2.mpm;">
- MPM-Modules</link>.
+ <option role="configure">--with-mpm=perchild</option>. Before doing so,
+ please beware the consequences and have at least a fair understand of what
+ the implications. For more information, read the Apache documentation
+ regarding <link xlink:href="&url.apache2.mpm;">MPM-Modules</link>.
</para>
<note>
<para>