User Tools

Site Tools


linux:webserver:apache

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Last revision Both sides next revision
linux:webserver:apache [2016/09/18 22:50]
tkilla created
linux:webserver:apache [2016/09/24 22:10]
tkilla [PHP-FPM]
Line 38: Line 38:
  
   * http://flaz.biz/2015/08/apache-wont-start-with-a-generic-ah00016-configuration-failed/   * http://flaz.biz/2015/08/apache-wont-start-with-a-generic-ah00016-configuration-failed/
- 
- 
-===== PHP-FPM ===== 
- 
-Use php-fpm for better performance and better security: run each domain in its own "pool" - processes per user. This way you also have less permission problems with sftp. 
- 
-  apt-get install apache2 libapache2-mod-fastcgi php5-fpm 
-  a2enmod actions 
-   
-  cp /etc/apache2/mods-enabled/fastcgi.conf /etc/apache2/mods-enabled/fastcgi.conf.backup 
-   
-  mcedit /etc/apache2/mods-enabled/fastcgi.conf 
-   
-  <IfModule mod_fastcgi.c> 
-    AddType application/x-httpd-fastphp5 .php 
-    Action application/x-httpd-fastphp5 /php5-fcgi 
-    Alias /php5-fcgi /usr/lib/cgi-bin/php5-fcgi 
-    FastCgiExternalServer /usr/lib/cgi-bin/php5-fcgi -socket /var/run/php5-fpm.sock -pass-header Authorization 
-    <Directory /usr/lib/cgi-bin> 
-        Require all granted 
-    </Directory> 
-  </IfModule> 
- 
-  apache2ctl configtest 
-  /etc/init.d/apache2 restart 
- 
-check if a phpfpm "www" pool process is running 
- 
-now configure pools for each domain/vhost 
- 
-  cd /etc/php5/fpm/pool.d/ 
-  cp www.conf {user1.conf,user2.conf} 
- 
-replace all appearances of "www" in user.conf 
-  /etc/init.d/php-fpm restart 
- 
-You need to edit your vhosts to use the new pool. 
-Replace USERNAME by the poolname you just created and VHOSTNAME by a dfifferent name in each vhost: 
- 
- 
-  <VirtualHost *:80> 
-  ... 
-    <IfModule mod_fastcgi.c> 
-        Alias /php5-fcgi /usr/lib/cgi-bin/php5-fcgi-${USERNAME}-VHOSTNAME 
-        FastCgiExternalServer /usr/lib/cgi-bin/php5-fcgi-${USERNAME}-VHOSTNAME -socket /var/run/php5-fpm-${USERNAME}.sock -pass-header Authorization 
-    </IfModule> 
-  ... 
- 
-The username must be an exisiting user in the system. e.g.: 
-  adduser --disabled-login USERNAME 
-  adduser www-data USERNAME 
-  mkdir /var/www/USERNAME 
-  chown -R USERNAME:USERNAME /var/www/USERNAME 
-  chmod 750 /var/www/USERNAME 
- 
- 
-Links: 
-  * https://www.linode.com/docs/websites/apache/install-php-fpm-and-apache-on-debian-8 
-  * http://www.dimitri.eu/php-fpm-apache-split-config-per-site/ 
- 
- 
- 
- 
- 
  
  
  
linux/webserver/apache.txt ยท Last modified: 2019/06/04 12:43 by tkilla