Answer the question
In order to leave comments, you need to log in
2 servers on port 80 - how to implement?
There is 1 external IP address, and a local network in which 2 web servers (Apache) in the local network have a
Dir620 router, port 80 is open, the first server has IP 192.168.0.5, the second server has IP 192.168.0.6 site1.domain.ru opened exactly the virtual host that is registered on another server. Is it possible to make 2 web servers work at the same time and, when requested, go to the desired site?
Answer the question
In order to leave comments, you need to log in
DO NOT need any second second ip. Just on one of the servers, raise mod_proxy for Apache to port 80 (for example, for debian: sudo apt-get install libapache2-mod-proxy-html libapache2-mod-gnutls), and transfer the virtual host from the site of this server to some other port . (e.g. 12345) Then configure proxy configs (I advise you to create a separate config for each virtual host):
Examples for debian:
a2enmod proxy
touch proxy.site.local (e.g. for 192.168.0.5)
vi proxy.site.local
<VirtualHost *:80>
ServerAdmin [email protected]
DocumentRoot "/var/www/test"
ServerName proxy.site.local
ServerAlias site1.domain.ru www.site1.domain.ru
ProxyRequests Off
ProxyPreserveHost On
ProxyVia full
<Proxy *>
Order deny,allow
Allow from all
</Proxy>
ProxyPass / http://127.0.0.1:12345/
ProxyPassReverse / http://127.0.0.1:12345/
</VirtualHost>
Hi, it's been over a year now. Please answer, were you able to implement it? If so, how? I have the same task.
I suppose that this can be implemented if you flash Dir620 using OpenWRT and install nginx there .
Lighttpd may be running on dir620. Then in its config you can do this .
If there is no light there, then only installing nginx on one of the servers will help, which will proxy requests for the required http_host to another server. All traffic from the router, accordingly, will need to be forwarded to the server with nginx.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question