# Possible to run Apache and lighttpd on same server?

**URL:** <https://www.ruby-forum.com/t/possible-to-run-apache-and-lighttpd-on-same-server/112193>\
**Category:** Deployment\
**Created:** [August 16, 2007, 7:03am UTC](https://www.ruby-forum.com/t/possible-to-run-apache-and-lighttpd-on-same-server/112193 "2007-08-16T07:03:33Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![smc7000](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/ed655f/32.png) [@smc7000](https://www.ruby-forum.com/u/smc7000)\
**Post date:** [August 16, 2007, 7:03am UTC](https://www.ruby-forum.com/t/possible-to-run-apache-and-lighttpd-on-same-server/112193/1 "2007-08-16T07:03:33Z")

</div>

I’ve been put in charge of setting up a production server for my  
company, but I’m almost a COMPLETE noob with networking or servers. I’ve  
run rails apps off of a hosting company before, but now I have to set up  
a whole server myself. I’m a little intimidated.

But here’s my question: if I have rails apps running off mongrel and  
lighttpd, can I also have static pages being served by Apache on the  
same server?

---

<div class="post-metadata">

**Author:** ![smc7000](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/ed655f/32.png) [@smc7000](https://www.ruby-forum.com/u/smc7000)\
**Post date:** [August 16, 2007, 9:03am UTC](https://www.ruby-forum.com/t/possible-to-run-apache-and-lighttpd-on-same-server/112193/2 "2007-08-16T09:03:17Z")

</div>

Hi Sean,

This is a fast moving field - and at the moment, the concensus is  
moving away from lighttpd, and towards nginx/mongrel\_cluster. You  
certainly need more than one mongrel in a production server, so ‘gem  
install mongrel\_cluster’ will ease the task of running multiple  
mongrels. Then use nginx as the front end - it will be quite happy  
serving static pages directly, and proxying the rails stuff to your  
mongrels. There are a number of useful 'howto’s on this subject:

> **[Hosting Rails apps using nginx and Mongrel Cluster](http://www.gregbenedict.com/2007/07/06/hosting-rails-apps-using-nginx-and-mongrel-cluster/)**
>
> The combination of Apache, Lighttpd and FastCGI has been the best option for hosting rails applications over the last few years. While Mongrel arrived on the scene to replace the Lighttpd/FastCGI p…

is a good starting point, with links to other useful pages at the  
bottom.

The only reason to run apache would be if you have other non-static  
non-rails apps which may need some of apache’s more heavyweight  
features - mod-php for example. Even then, your nginx front end can  
proxy those urls to apache.

Tony

---

<div class="post-metadata">

**Author:** ![smc7000](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/ed655f/32.png) [@smc7000](https://www.ruby-forum.com/u/smc7000)\
**Post date:** [August 16, 2007, 10:27am UTC](https://www.ruby-forum.com/t/possible-to-run-apache-and-lighttpd-on-same-server/112193/3 "2007-08-16T10:27:31Z")

</div>

On 16 Aug 2007, at 08:02, Tony White wrote:

> [http://www.gregbenedict.com/2007/07/06/hosting-rails-apps-using-](http://www.gregbenedict.com/2007/07/06/hosting-rails-apps-using-)  
> nginx-and-mongrel-cluster/

if all your vhosts are in the same location you can just include them  
with  
include /etc/nginx/vhosts/\*.conf;

and you can avoid restarting nginx too if you send it

–stop --signal 2

if you want to run php too have a little look at topfunky’s config he  
has added some notes on getting it working.

> is a good starting point, with links to other useful pages at the  
> bottom.
> 
> The only reason to run apache would be if you have other non-static  
> non-rails apps which may need some of apache’s more heavyweight  
> features - mod-php for example. Even then, your nginx front end can  
> proxy those urls to apache.  
> webdav is the only thing that has required me to have Apache in the  
> past,  
> if you can eliminate Apache you can probably squeeze another mongrel  
> onto the server too.
