Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am using apache server on ubuntu 11.04. I came to know about Nginx server which has some good features.

So I decided to have a ride on it. But I am little bit confused as I have already installed apache and again I will install Nginx may they conflict each other?

But I came to know that as they both server use different ports so then I can use them.

So my question is how to configure both so that Nginx will not conflict with the www folder where all the projects resides and runs by apache.

share|improve this question

migrated from Sep 9 '11 at 19:29

This question came from our site for professional and enthusiast programmers.

It seems that average SO user tend to downvote on every problem they have no clue of... – Col. Shrapnel Sep 9 '11 at 18:35
Ya I think that. I have a doubt and I asked from the professionals for the best suggestions but still not got – newuser Sep 9 '11 at 18:38

Change listen 80; in your nginx config to the port that you'd like to use.

share|improve this answer

Alternative to Shane's answer, if your server has multiple network cards, you could have each listen on a separate ip address.

share|improve this answer
You don't necessarily need multiple NICs. You can bind multiple addresses to a single interface:… – Gerald Combs Sep 9 '11 at 20:07
@Gerald Yes, you're quite right. – Dana the Sane Sep 9 '11 at 20:10

There are two aspects to this question:

  1. What IP address and port number Apache and Nginx listen on. Both use the Listen directive for this.
  2. What directory Apache and Nginx serve files from. Apache uses DocumentRoot for this, Nginx uses Root.
share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.