Linode Forum
Linode Community Forums
 FAQFAQ    SearchSearch    MembersMembers      Register Register 
 LoginLogin [ Anonymous ] 
Post new topic  Reply to topic
Author Message
PostPosted: Wed Aug 21, 2013 9:06 pm 
Offline
Senior Member

Joined: Thu Jun 13, 2013 7:32 am
Posts: 79
Linode has been running fine for around 80 days. Shut down today to take advantage of new linode disk space, resized disk, then booted back up and now all php sites show 502 Bad Gateway. Nginx is running because plain html sites work fine, none of the php or webmail sites though. I restarted php-fpm, reload webpage and same error.

Php config files all look ok, same for nginx. Iptables looks as it did before. Fail2ban sent me some start and stop messages such as this:

Code:
Hi,
The jail ssh has been started successfully.
Regards,
Fail2Ban

Code:
Hi,
The jail ssh has been stopped successfully.
Regards,
Fail2Ban


I got one of these groups of messages for ssh, ssh-dos, postfix, dovecot, nginx, nothing for php so this appears to just be the rules stoping and starting back up, they appear in iptables.

I don't see the php-fpm users in htop like I usually do.

I've been able to restart php-fpm service fine in the past.

I see this in php-fpm log:

Code:
[21-Aug-2013 21:01:19] ERROR: unable to bind listening socket for address '/var/run/php5-fpm/mydomain.socket': No such file or directory (2)
[21-Aug-2013 21:01:19] ERROR: FPM initialization failed


Any ideas on what I can check?


Top
   
PostPosted: Wed Aug 21, 2013 9:58 pm 
Offline
Senior Member

Joined: Thu Jun 13, 2013 7:32 am
Posts: 79
This was the issue:
https://github.com/vernak2539/babble.by ... t.markdown

/var/run/php5-fpm/ was not there after reboot.

To create this directory on reboot it says to do this:

Code:
To make sure this doesn't happen the next time you reboot your server, I would checkout this comment.

All you have to do is edit the /etc/init.d/php5-fpm file, and add the stuff below.

// add at top by all your other variables
SOCKETDIR = /var/run/php5-fpm

// then inside do_start()
// replace users as you see fit
[ -d $SOCKETDIR ] || install -m 755 -o www-data -g root -d $SOCKETDIR



But what if I have a different socket name for each site hosted and each run as a different user, will that single line work with "www-data -g root"?


Top
   
PostPosted: Sat Aug 24, 2013 1:02 am 
Offline
Junior Member
User avatar

Joined: Fri May 04, 2012 8:57 pm
Posts: 49
jgjh151 wrote:
This was the issue:
https://github.com/vernak2539/babble.by ... t.markdown

/var/run/php5-fpm/ was not there after reboot.

To create this directory on reboot it says to do this:

Code:
To make sure this doesn't happen the next time you reboot your server, I would checkout this comment.

All you have to do is edit the /etc/init.d/php5-fpm file, and add the stuff below.

// add at top by all your other variables
SOCKETDIR = /var/run/php5-fpm

// then inside do_start()
// replace users as you see fit
[ -d $SOCKETDIR ] || install -m 755 -o www-data -g root -d $SOCKETDIR



But what if I have a different socket name for each site hosted and each run as a different user, will that single line work with "www-data -g root"?


With php-fpm, you should only have one socket, and one user.

_________________
me | voltaireMC


Top
   
PostPosted: Sat Aug 24, 2013 4:01 am 
Offline
Senior Member

Joined: Fri Feb 17, 2012 8:20 pm
Posts: 365
kbar wrote:
jgjh151 wrote:
This was the issue:
https://github.com/vernak2539/babble.by ... t.markdown

/var/run/php5-fpm/ was not there after reboot.

To create this directory on reboot it says to do this:

Code:
To make sure this doesn't happen the next time you reboot your server, I would checkout this comment.

All you have to do is edit the /etc/init.d/php5-fpm file, and add the stuff below.

// add at top by all your other variables
SOCKETDIR = /var/run/php5-fpm

// then inside do_start()
// replace users as you see fit
[ -d $SOCKETDIR ] || install -m 755 -o www-data -g root -d $SOCKETDIR



But what if I have a different socket name for each site hosted and each run as a different user, will that single line work with "www-data -g root"?


With php-fpm, you should only have one socket, and one user.


What? Isn't one of the awesome things about PHP-FPM that you can give users their own pool and run as their own user?


Top
   
PostPosted: Sat Aug 24, 2013 10:44 am 
Offline
Senior Member
User avatar

Joined: Sat Aug 30, 2008 1:55 pm
Posts: 1739
Location: Rochester, New York
I've fought with this on occasion, but ended up just doing TCP sockets. No real downside, as far as I can tell.

And indeed... with php-fpm, you should have as many pools (and thus as many users and sockets) as you do applications. None of them should be running as www-data. That's the point.

_________________
Code:
/* TODO: need to add signature to posts */


Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
RSS

Powered by phpBB® Forum Software © phpBB Group