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.

migrated from stackoverflow.com Sep 9 '11 at 19:29

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


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


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

  • 1
    You don't necessarily need multiple NICs. You can bind multiple addresses to a single interface: wiki.debian.org/… – 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.

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

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