Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/linux/28.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/apache/9.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Linux Apache2 reverseproxy-如何在服务器上设置DocumentRoot?_Linux_Apache_Unix_Apache2_Virtualhost - Fatal编程技术网

Linux Apache2 reverseproxy-如何在服务器上设置DocumentRoot?

Linux Apache2 reverseproxy-如何在服务器上设置DocumentRoot?,linux,apache,unix,apache2,virtualhost,Linux,Apache,Unix,Apache2,Virtualhost,我已经用apache2配置了reverseproxy。reverseproxy配置如下所示: <VirtualHost *:80> ServerName someserver.com ProxyRequests Off ProxyPass / http://123.123.123.123/var/www/someserver.com/htdocs/ ProxyPassReverse / http://123.123

我已经用apache2配置了reverseproxy。reverseproxy配置如下所示:

<VirtualHost *:80>
    ServerName someserver.com

    ProxyRequests Off

    ProxyPass /             http://123.123.123.123/var/www/someserver.com/htdocs/
    ProxyPassReverse /      http://123.123.123.123/var/www/someserver.com/htdocs/
</VirtualHost>

<VirtualHost *:80>
    ServerName subdomain.someserver.com

    ProxyRequests Off

    ProxyPass /             http://123.123.123.123/var/www/someserver.com/subds/subdomain/
    ProxyPassReverse /      http://123.123.123.123/var/www/someserver.com/subds/subdomain/
</VirtualHost>

ServerName someserver.com
代理请求关闭
ProxyPass/http://123.123.123.123/var/www/someserver.com/htdocs/
ProxyPassReverse/http://123.123.123.123/var/www/someserver.com/htdocs/
ServerName subdomain.someserver.com
代理请求关闭
ProxyPass/http://123.123.123.123/var/www/someserver.com/subds/subdomain/
ProxyPassReverse/http://123.123.123.123/var/www/someserver.com/subds/subdomain/
现在我想为服务器上的两个虚拟主机(123.123.123.123)设置不同的文档根。我试图在服务器上设置虚拟主机,但ServerName目录不起作用

有人知道我如何解决这个问题吗?我肯定有一个简单的解决办法,但我看不出:P 谢谢

我找到了解决方案: