I have several machines on my lan. On of them is running 2 web sites, first_web_site and second_web_site (each one in a dedicated NameVirtualHost). Another machine is running another site third_web_site. I would like to be able to access each one, within internet, with the url:
- first_web_site.domain.tld
- second_web_site.domain.tld
- third_web_site.domain.tld
knowing that 2 sites are on the same machine. Can Apache help me to do this ?
I have a machine that will have a apache server to be used for proxy purposes. I was talk to set up virtualhost on this one and use proxy server but I do not know how to do this.
Could you please give me hints ? Thanks a lot, Luc
You could setup a proxy on the first box that connects and tunnels to the second one. This is so that the second box does all the heavy lifting, the first one will only need the resources to display the page.
Create or edit the vhosts.conf in your apache conf.d (or equivalent depending on OS).
Use the NameVirtualHost directive to handle the DNS names.
Then define each of your virtual hosts. Something like the following:
For the two sites on the same box, it depends on how they're setup. If they're on different ports, define the ports, if they're paths, then you'll need to add the path on the end of the ProxyPass and ProxyPassReverse entries: