Linode Forum
Linode Community Forums
 FAQFAQ    SearchSearch    MembersMembers      Register Register 
 LoginLogin [ Anonymous ] 
Post new topic  Reply to topic
Author Message
PostPosted: Mon Sep 26, 2011 1:27 am 
Offline

Joined: Mon Sep 26, 2011 1:15 am
Posts: 1
So I have a setup where nginx is acting as a frontend proxy to apache, so it's sending any *.php requests over to apache.

I'm trying to figure out the best way to create subdomains with this type of setup. The only way I could think of was to send requests to a subdomain over a different port listened on by apache, but I've been told that apache will create a new instance for each port listened on (though I'm not sure of this?). Is there a better way to do this?


Top
   
 Post subject:
PostPosted: Mon Sep 26, 2011 9:08 am 
Offline
Senior Member
User avatar

Joined: Thu Jun 16, 2011 8:24 am
Posts: 412
Location: Cyberspace
Apache does create multiple instances of itself (or rather, it's just one instance, but that one instance will have several processes, AKA multiple children of that one instance). I don't know how apache handles different ports, but I know it will do this with vhosts -- the more vhosts you have and the heavier the load on apache, the more children it has.

Unless you have a specific need to have both nginx and apache running at the same time, I wouldn't recommend doing that. There are reasons for having both running, but it will take up more resources on your Linode, and you're just adding an extra layer to your software. You basically will have nginx sending the php to apache, which will load a module to connect to php, which will then send the php files to php, then back to apache, then back to nginx. If you use something like fastcgi or php-fpm in nginx, you will apache from this. You'll still have a module being loaded to bridge nginx to php, but that module will be used by nginx directly rather than sending it to apache first in order to use it.

_________________
Kris the Piki Geeker


Top
   
 Post subject:
PostPosted: Mon Sep 26, 2011 9:49 pm 
Offline
Senior Member
User avatar

Joined: Sat Aug 30, 2008 1:55 pm
Posts: 1739
Location: Rochester, New York
I don't know for sure about the effects of listening on multiple addresses/ports, but the number of children is not (directly) affected by the number of <VirtualHost>s or ServerNames. More traffic (or, more specifically, more simultaneous connections) causes more children, though, and generally speaking, more VirtualHosts means more traffic. But adding a VirtualHost that receives no traffic will not increase the number of children on its own.

For the original question, I usually just pass the Host: header along and use virtual hosting on the back-end web server.

_________________
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 2 guests


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