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

Ive got a godaddy centos server running a few domains on apache.

I now need to install a new domain which will host an app and requires Nginx service.

Can I run both of these webservers off the same dedicated server? I would need 2 ips no? How might I proceed? Any insight is appreciated.


share|improve this question

closed as not a real question by Michael Hampton, Ward, Magellan, John Gardeniers, Iain Oct 13 '12 at 21:09

It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.If this question can be reworded to fit the rules in the help center, please edit the question.

Remember to mark your questions as answered when you find the solution that works for you. – JMeterX Aug 29 '12 at 18:39

There are two options for this to work you will need to bind both apache and nginx to their own IP address. So for instance in the httpd.conf file you will need to list a specific IP such as Listen

The article listed below explains how to bind both nginx and apache as well as explains using nginx behind apache by setting up virtual hosts

For more information check this site out

share|improve this answer

An alternative is to use VirtualHosts, and have apache proxy the new domain to Nginx, which listens on another port (eg 8080). This way, you don't necessarily need a second IP address.

Example config:

LoadModule proxy_module /path/to/
LoadModule proxy_http_module /path/to/

NameVirtualHost *
<VirtualHost *>
    ProxyRequests Off
    # ... config for domain ...
<VirtualHost *>
    ProxyRequests Off

    ProxyPass / http://localhost:8080/
    ProxyPassReverse / http://localhost:8080/
share|improve this answer

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