Wanting to make sure I'm doing apache2 + php5-fpm correctly

I went ahead and installed:

apache2

php5-fpm

php5-suhosin

php5-gd

php5-mysql

mysql-server (going to be replacing with mariadb-server soon)

I then set up apache and added the following to the bottom of my apache2.conf:

FastCgiExternalServer /srv/www/php5.external -host 127.0.0.1:9000

AddHandler php5-fcgi .php

Action php5-fcgi /usr/lib/cgi-bin/php5.external

Alias /usr/lib/cgi-bin/ /srv/www/

which I got from a guide at : http://alexcabal.com/installing-apache- … -maverick/">http://alexcabal.com/installing-apache-mod_fastcgi-php-fpm-on-ubuntu-server-maverick/

Currently, my server is running Drupal 7 just fine, and reporting the FPM module of php, with my web files located in /srv/www/sitename/public_html

Does the above configuration seem correct? And, I was wondering if folks had any good references for tuning php5-fpm with apache2 and Drupal.

4 Replies

That's pretty much how I've been doing it on 10.04 for the last 10 months or so. Although, I have a few vhosts that have their own php-fpm processes (running under different users).

Ok, that makes sense.

What I'm currently looking at now is my worker configuration. I'm trying to find some resources for tuning it for a 512 linode. Currently, I've got php to 96mb, I've got apc at 128mb (not sure how that'll work), and I 've got the worker at default. Not sure how to tweak that.

How exactly does this work? I have a few different domains/vhosts and when trying this out it worked fine for me, however I only had to add the Fcgi part to one vhost. I now have this in a single vhost:

FastCgiExternalServer /srv/www/<domain>/public_html/php5.external -host 127.0.0.1:9000
AddHandler php5-fcgi .php
Action php5-fcgi /usr/lib/cgi-bin/php5.external
Alias /usr/lib/cgi-bin/ /srv/www/<domain>/public_html/</domain></domain>

This made it work perfectly, so I'm happy with that. I thought however that I had to add something like this to every vhost with their respective domains. However I only added this to one vhost, and now it works automatically for every vhost/domain without having to add something to their vhost configuration.

Is this OK?

I'm not really sure myself. I had it set at first to /var/ instead of /srv/, and my sites were working fine. I put it in my main apache2.conf instead of in each ghost's file, since I figured if the main file pointed at the right area (www), then I'd be alright. But, I've seen it referred to as a fake CGI call.

Reply

Please enter an answer
Tips:

You can mention users to notify them: @username

You can use Markdown to format your question. For more examples see the Markdown Cheatsheet.

> I’m a blockquote.

I’m a blockquote.

[I'm a link] (https://www.google.com)

I'm a link

**I am bold** I am bold

*I am italicized* I am italicized

Community Code of Conduct