This shows you the differences between two versions of the page.
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:// | * http:// | ||
- | |||
- | |||
- | ===== PHP-FPM ===== | ||
- | |||
- | Use php-fpm for better performance and better security: run each domain in its own " | ||
- | |||
- | apt-get install apache2 libapache2-mod-fastcgi php5-fpm | ||
- | a2enmod actions | ||
- | | ||
- | cp / | ||
- | | ||
- | mcedit / | ||
- | | ||
- | < | ||
- | AddType application/ | ||
- | Action application/ | ||
- | Alias /php5-fcgi / | ||
- | FastCgiExternalServer / | ||
- | < | ||
- | Require all granted | ||
- | </ | ||
- | </ | ||
- | |||
- | apache2ctl configtest | ||
- | / | ||
- | |||
- | check if a phpfpm " | ||
- | |||
- | now configure pools for each domain/ | ||
- | |||
- | cd / | ||
- | cp www.conf {user1.conf, | ||
- | |||
- | replace all appearances of " | ||
- | / | ||
- | |||
- | 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: | ||
- | |||
- | |||
- | < | ||
- | ... | ||
- | < | ||
- | Alias /php5-fcgi / | ||
- | FastCgiExternalServer / | ||
- | </ | ||
- | ... | ||
- | |||
- | The username must be an exisiting user in the system. e.g.: | ||
- | adduser --disabled-login USERNAME | ||
- | adduser www-data USERNAME | ||
- | mkdir / | ||
- | chown -R USERNAME: | ||
- | chmod 750 / | ||
- | |||
- | |||
- | Links: | ||
- | * https:// | ||
- | * http:// | ||
- | |||
- | |||
- | |||
- | |||
- | |||