Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Without the following patch on the php-fpm package, it is not possible to start nginx with aegir:
diff --git a/php5/fpm/pool.d/www.conf b/php5/fpm/pool.d/www.conf
index 28a0651..e6d552d 100644
--- a/php5/fpm/pool.d/www.conf
+++ b/php5/fpm/pool.d/www.conf
@@ -30,7 +30,8 @@ group = www-data
; specific port;
; '/path/to/unix/socket' - to listen on a unix socket.
; Note: This value is mandatory.
-listen = /var/run/php5-fpm.sock
+;listen = /var/run/php5-fpm.sock
+listen = localhost:9000
; Set listen(2) backlog.
; Default Value: 128 (-1 on FreeBSD and OpenBSD)
Any idea on how this could be fixed?
Comments
Comment #1
omega8cc CreditAttribution: omega8cc commentedWhat OS version are you using and how are you installing php5-fpm? By default it listens on port 9000 and doesn't use socket (which is less reliable, btw).
I have tested it both on Debian Squeeze using Dotdeb repo (there is no php5-fpm in the Debian Squeeze by default) and just a minute ago tested it also on Ubuntu Precise - it installs php5-fpm by default listening on 127.0.0.1:9000.
Comment #2
omega8cc CreditAttribution: omega8cc commentedComment #3
anarcat CreditAttribution: anarcat commentedDebian Wheezy and sid. php5-fpm 5.4.4~rc2-1
Comment #4
omega8cc CreditAttribution: omega8cc commentedSo this is some new standard in the upcoming/next Debian release? If yes, then it is really weird, as it is against already used standard in all known Debian and Ubuntu (official and latest) releases.
In this case it is probably a docs/FAQ candidate, as we should continue to support the old standard with 127.0.0.1:9000.
We could also check (as we do with Nginx built-in, or not, modules) if there is php5-fpm listening on the default port or available via socket and adjust configuration using separate copy of the include file, but I really don't like adding yet another moving part, so not sure if we want this.
Comment #5
anarcat CreditAttribution: anarcat commentedphp5-fpm entered Debian only in the Wheezy release (http://packages.debian.org/php5-fpm) so I do not see why i can be considered as being a standard here. Various guides recommend various things here and there on the web, (this one recommends :9000, while this one uses the socket).
Now, I noticed the upstream sample configuration file (sapi/fpm/php-fpm.conf.in in php 5.4) has 127.0.0.1:9000 as an example, so this seems to be a good guide. What i am saying here is that we should strive to have this a smooth experience that doesn't require people to edit system configuration files needlessly. For example, we should probably file a bug with the debian package.
I'll see if I can do this, but in the meantime we should certainly fix the install documentation to tell users to change that, because it's certainly weird.
Comment #6
anarcat CreditAttribution: anarcat commentedNote that the socket configuration was adopted both in Debian and Ubuntu following this bug report: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=650204
I have opened a separate bug report to revert this change back, we'll see how it goes.
Comment #7
anarcat CreditAttribution: anarcat commentedHere's the bug report: http://bugs.debian.org/682168
Comment #8
anarcat CreditAttribution: anarcat commentedJust a quick note to mention that ars technica describe using UNIX sockets as being "a lot faster" than network sockets:
http://arstechnica.com/information-technology/2012/12/web-served-part-3-...
Comment #9
omega8cc CreditAttribution: omega8cc commentedYes, sockets are a bit faster, but also less reliable, especially under load. The "a lot faster" sounds nice, but where are the benchmarks like this or this?
Some people say for example: "UNIX domain sockets are slightly faster than TCP sockets". Others say also that "Unix sockets are faster, but fall over at high load".
Comment #10
anarcat CreditAttribution: anarcat commentedCool, thanks for the benchmarks, it was also my understanding that UNIX sockets were only marginally faster than TCP sockets. My initial feeling was based on this comment on MySQL:
(Source: https://dev.mysql.com/doc/refman/5.1/en/compile-and-link-options.html)
Now this is MySQL mind you, which may have strange code path issues. I was kind of surprised of arstechnica's article, and just wanted to share that, I also feel it's okay to default to TCP sockets, especially since it can enable us to migrate the PHP process pool to a completely different server.
Comment #11
omega8cc CreditAttribution: omega8cc commentedWhile I consider this move (both on Ubuntu and Debian) to use sockets by default as something really silly (because php-fpm sockets are unreliable) we probably should accept this as a fact in the next LTS releases, so we need an automated switch on the config level to stay backward compatible. Which is just another moving part.
Comment #12
anarcat CreditAttribution: anarcat commentedIt's rather unfortunate that my bug report on the debian package (http://bugs.debian.org/682168) has been ignored - but oh well. :) I agree that we need to fix this so that it works out of the box.. Maybe hostmaster-install or the debian-package should make an override?
How should we override this cleanly?
Comment #13
omega8cc CreditAttribution: omega8cc commentedWe should test/discover if PHP-FPM has been installed/running in the UNIX sockets or TCP mode and then use appropriate config. This means that we will need to print different config snippets also in the config includes, as we do already in the main config and in vhosts. Next, what if PHP-FPM doesn't run on install, at least when we are trying to determine its mode? This gets a bit complicated, but I will try to find some sane method. This should be done in Provision in the same way all other on the fly adjustments are done, like for checking Nginx version or path to init scripts or the binary itself etc.
Comment #14
anarcat CreditAttribution: anarcat commentedOkay that makes sense - i believe that if we run in server verify, that should give enough time for the fpm package to get configured and open up its ports. Then if you change that config and just reverify the server, it will catchup so it also covers changing from unix to tcp sockets...
Comment #15
omega8cc CreditAttribution: omega8cc commentedThis is not ready. We still assume that PHP-FPM is listening on port 9000.
Comment #16
omega8cc CreditAttribution: omega8cc commentedSo this is only Wheezy specific, because Precise listens on port 9000 on default php5-fpm install.
Comment #17
omega8cc CreditAttribution: omega8cc commentedOK, this commit does the trick: http://drupalcode.org/project/provision.git/commit/2d4a4c9 as long as the php5-fpm socket path is Wheezy default:
/var/run/php5-fpm.sock
Comment #18
anarcat CreditAttribution: anarcat commentedgood job!