简体   繁体   English

mod_proxy apache vhosts.conf

[英]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. 对不起,我的英语不好,我将尝试解释我的问题....我必须为学校配置Apache。 I want create a web server model with three host. 我想创建一个具有三个主机的Web服务器模型。 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. 如果我在浏览器中调用它,的确可以在每个虚拟机中看到三个不同的Apache服务器。

Now I have to configure mod_proxy. 现在,我必须配置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. 我想要这样的配置:第一个虚拟机是一台服务器,响应特定的域,从这台服务器,我想从其他2个不同的虚拟机到达其他2个apache。 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 服务器localhost IP地址192.168.1.100 vm01 localhost / vm01链接到IP地址192.168.1.101 vm02 localhost / vm02链接到IP地址192.168.1.102

So, I spend few days in apache mod_proxy but I can't find a perfect guide or example. 因此,我花了几天的时间在Apache mod_proxy中,但找不到完美的指南或示例。

I try to use this vhosts.conf in server, but didn't work. 我尝试在服务器中使用此vhosts.conf,但没有用。 Please be patient I'm new in Apache. 请耐心等待,我是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. 您已经在端口8080上定义了两个虚拟主机。将它们组合为一个。

<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>

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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