Changes

Jump to: navigation, search

Package:Apache

426 bytes added, 4 years ago
m
Updated the /etc/conf.d/apache2 information to reflect the changes for new PHP versions.
*<code>/etc/apache2/vhosts.d/*</code>
<code>conf.d</code> controls the init script, adding things to it such as -D SECURITY & -D PHP5 PHP will enable web application fire-walling & the php scripting language.
<code>httpd.conf</code> controls how the server behaves, at the bottom of the file it has directives to include configuration files ending in .conf in <code>/etc/apache2/modules.d</code> and <code>/etc/apache2/vhosts.d</code>
{{file|name=/etc/conf.d/apache2|lang=|desc=enable php dso module|body=
"... -D PHP5PHP"
}}
==== Php-fpm ====
{{warning|php-fpm is untested.}}
Apache supports php-fpm also, this is the preferred method to serve php.
{{file|name=/etc/portage/make.conf|lang=|desc=enable php dso moduleproxy & fcgi modules|body=
...
APACHE2_MODULES="actions alias auth_basic auth_digest authn_alias authn_anon authn_core authn_dbm authn_file authz_core authz_dbm authz_groupfile authz_host authz_owner authz_user autoindex cache cgi cgid dav dav_fs dav_lock deflate dir env expires ext_filter file_cache filter headers include info log_config logio mime mime_magic negotiation rewrite setenvif socache_shmcb speling status unique_id unixd userdir usertrack vhost_alias proxy proxy_fcgi"
...
}}
{{file|name=/etc/conf.d/apache2|lang=|desc=enable php dso proxy module|body=
"... -D PROXY"
}}
{{file|name=/etc/apache2/httpdvhosts.d/00_default_vhost.conf|lang=|desc=enable configure php dso module-fpm vhosts.|body=
...
LoadModule proxy_module modules<VirtualHost *:80> ServerName localhost Include /etc/apache2/vhosts.d/default_vhost.include ProxyPassMatch ^/(.*\.php(/.*)?)$ fcgi://mod_proxy127.so0.0.1:9000/var/www/localhost/htdocs/$1LoadModule proxy_fcgi_module modules DirectoryIndex /mod_proxy_fcgiindex.sophp
...
}}
Do not forget to start php-fpm:{{file|name=/etc/apache2/vhosts.d/00_default_vhost.conf|lang=|desc=enable php dso moduleconsole|body=...ProxyPassMatch ^/(.*\.###i## rc-update add php(/.*)?)$ fcgi://127.0.0.1:9000/path/to/your/documentroot/$1DirectoryIndex /index.php...-fpm defaultrc}}
=== Enabling Security Module ===
== Service ==
To start Apache immediatelytemporarily:
<console>
###i## rc-service apache2 start
</console>
To start Apache upon immediately, and every boot:
<console>
###i## rc-update add apache2default###i## rc
</console>
wiki-users
97
edits

Navigation menu