简体   繁体   中英

mod_proxy apache vhosts.conf

sorry for my bad English, I'm gonna try to explain my problem.... I have to do a configuration of Apache for school. I want create a web server model with three host. I have three virtual machine on virtual box and each one can communicate with an internal network. Indeed three different apache server can be seen in each vm if I call it in browser.

Now I have to configure mod_proxy.

I want this configuration: the first vm is a server, responding a specifical domain, from this server I want to reach the other 2 apache from the other 2 different vm. Server localhost ip address 192.168.1.100 vm01 localhost/vm01 link to ip address 192.168.1.101 vm02 localhost/vm02 link to ip address 192.168.1.102

So, I spend few days in apache mod_proxy but I can't find a perfect guide or example.

I try to use this vhosts.conf in server, but didn't work. Please be patient I'm new in Apache.

<VirtualHost *:8080>
 ServerName localhost
 DocumentRoot /home/francesco/proxy/htdocs/
</VirtualHost>

<VirtualHost *:8080>

ServerAdmin webmaster@proxy.com
ServerName www.vm01.com

ProxyPass   /vm01 http://192.168.1.101
ProxyPassReverse /vm01 http://192.168.1.101

</VirtualHost>

You have defined two Virtual Hosts on port 8080. Combine it to one.

<VirtualHost *:8080>
  ServerAdmin webmaster@proxy.com
  ServerName www.vm01.com
  ProxyPreserveHost On
  ProxyPass   /vm01 http://192.168.1.101
  ProxyPassReverse /vm01 http://192.168.1.101
 </VirtualHost>

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM