Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

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.

thanks,

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

2 Answers 2

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 192.168.1.1:80

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/mod_proxy.so
LoadModule proxy_http_module /path/to/mod_proxy_http.so

NameVirtualHost *
<VirtualHost *>
    ServerName some.existing.domain.com
    ProxyRequests Off
    # ... config for domain ...
</VirtualHost>
<VirtualHost *>
    ServerName new.domain.com
    ProxyRequests Off

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

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