2

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,

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

2 Answers 2

4

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

3

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>

Not the answer you're looking for? Browse other questions tagged .