cvs: phpdoc /en/install/unix apache2.xml

From: Date: Tue, 24 Jun 2008 22:17:14 +0000
Subject: cvs: phpdoc /en/install/unix apache2.xml
Groups: php.doc.cvs 
Request: Send a blank email to doc-cvs+get-1800@lists.php.net to get a copy of this message
danbrown Tue Jun 24 22:17:14 2008 UTC Modified files: /phpdoc/en/install/unix apache2.xml Log: Updated the update I committed before to reflect my personal Apache FilesMatch conditions. Expands and expounds for novices and experts alike to learn a quick security tip. ;-P http://cvs.php.net/viewvc.cgi/phpdoc/en/install/unix/apache2.xml?r1=1.9&r2=1.10&diff_format=u Index: phpdoc/en/install/unix/apache2.xml diff -u phpdoc/en/install/unix/apache2.xml:1.9 phpdoc/en/install/unix/apache2.xml:1.10 --- phpdoc/en/install/unix/apache2.xml:1.9 Tue Jun 24 21:50:51 2008 +++ phpdoc/en/install/unix/apache2.xml Tue Jun 24 22:17:14 2008 @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.9 $ --> +<!-- $Revision: 1.10 $ --> <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> @@ -97,7 +97,7 @@ LoadModule php5_module modules/libphp5.so 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 + Apache parse .php files 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 @@ -107,12 +107,18 @@ SetHandler application/x-httpd-php </FilesMatch> - <FilesMatch \.phtml$> + Or, if we wanted to allow .php, .php2, .php3, .php4, .php5, .php6, and + .phtml files to be executed as PHP, but nothing else, we'd use this: + + <FilesMatch "\.ph(p[2-6]?|tml)$"> SetHandler application/x-httpd-php </FilesMatch> - - + And to allow .phps files to be executed as PHP source files, add this: + + <FilesMatch "\.phps$"> + SetHandler application/x-httpd-php-source + </FilesMatch> 16. Use your normal procedure for starting the Apache server, e.g.:

« previous php.doc.cvs (#1800) next »