xeoncross / lowendscript

Bash scripts to set up/bootstrap low end virtual servers
326 stars 100 forks source link

FastCGI changed from port to socket by default #20

Closed j-mie closed 11 years ago

j-mie commented 11 years ago

FastCGI now uses the socket instead of the port. Might need a check if wheezy or squeeze or to change both fastcgi config and PHP config

esemeniuc commented 11 years ago

This will break Debian 6 support I believe....

j-mie commented 11 years ago

@cwaffles Yeah. Same. Lemme fix it.

j-mie commented 11 years ago

That should do it

esemeniuc commented 11 years ago

I think that will cause a conflict, because by default, debian 6 php will auto listen on 127.0.0.1:9000, now we just added a second listener..., maybe we can just use sed to replace the line that says that with the socket...

j-mie commented 11 years ago

@cwaffles We are moving the old config file to the backup directory. Surely this removes the first listener so we only have one?

esemeniuc commented 11 years ago

It is kind of hackish...., let me try to find a better solution

j-mie commented 11 years ago

Sure. Although it's exactly the same method it uses to change other config files :smile:

xeoncross commented 11 years ago

Using unix sockets on a single host has a lower overhead. However, if you have multiple servers (because your site is growing) you must use TCP if you wish to forward from nginx to others servers running PHP instances.

Thoughts?

j-mie commented 11 years ago

Perhaps you could have an option such as ./setup-debian.sh php socket or /setup-debian.sh port or something?

xeoncross commented 11 years ago

I think that option would also need to be cared over into the other commands that assume PHP is on the TCP port. However, my question is if there is any reason to move from the more universal TCP port to a unix socket other than a possible small gain in connection overhead.

esemeniuc commented 11 years ago

Greater security as it has a lower possibility to be snooped on?

It isn't passing through any networking layer either. On Jun 26, 2013 11:07 AM, "David Pennington" notifications@github.com wrote:

I think that option would also need to be cared over into the other commands that assume PHP is on the TCP port. However, my question is if there is any reason to move from the more universal TCP port to a unix socket other than a possible small gain in connection overhead.

— Reply to this email directly or view it on GitHubhttps://github.com/Xeoncross/lowendscript/pull/20#issuecomment-20067965 .

j-mie commented 11 years ago

Yeah, Must say I prefer the socket approach. As I said there could be an option?

xeoncross commented 11 years ago

The extra security from the unix sockets (and the lower overhead) combined with the fact that NGINX itself seems to be defaulting to that now seems like that is perhaps the best choice over all.

When applications grow, and people need to switch to TCP they can do that manually since it's a simple change.

To keep things simple, I vote for no choice option until we have a good way of doing so and in the meantime make the switch to unix sockets.

j-mie commented 11 years ago

Yeah. I'd say sockets are more convenient. If people are capable of getting a website big enough that it needs to be expanded past the point of using sockets then I'm sure they can switch it. I take it this pull request will do @Xeoncross ?

xeoncross commented 11 years ago

Two more things:

j-mie commented 11 years ago

I'll fix this now. Was a complete hack :computer:

j-mie commented 11 years ago

Should work, just going to test it on a debian box

j-mie commented 11 years ago

Seems to work on Debian 7.

xeoncross commented 11 years ago

I don't have time to test this week (I'm going to a conference), so I'll go ahead and merge this in and we can wait to see if anyone has problems.

Thanks for you work @JamieH!