代理VHost无法重定向

时间:2018-07-11 18:17:33

标签: apache virtualhost proxypass sentora

我试图在服务器上为子域设置虚拟主机代理,以指向运行在:7002端口上的应用程序,但我只能使其运行。这是我的配置:

#FIRSTPART
# DOMAIN: admin.mydomain.com
<virtualhost *:80>
ServerName admin.mydomain.com
ServerAdmin zadmin@localhost
DocumentRoot "/var/sentora/hostdata/zadmin/public_html/appTest"
php_admin_value open_basedir "/var/sentora/hostdata/zadmin/public_html/appTest:/var/sentora/temp/"
php_admin_value suhosin.executor.func.blacklist "passthru, show_source, shell_exec, system, pcntl_exec, popen, pclose, proc_open, proc_nice, proc_terminate, proc_get_status, proc_close, leak, apache_child_terminate, posix_kill, posix_mkfifo, posix_setpgid, posix_setsi$
ErrorLog "/var/sentora/logs/domains/zadmin/admin.mydomain.com-error.log"
CustomLog "/var/sentora/logs/domains/zadmin/admin.mydomain.com-access.log" combined
CustomLog "/var/sentora/logs/domains/zadmin/admin.mydomain.com-bandwidth.log" common
<Directory "/var/sentora/hostdata/zadmin/public_html/appTest">
  Options +FollowSymLinks -Indexes
  AllowOverride All
  Require all granted
</Directory>
AddType application/x-httpd-php .php3 .php
DirectoryIndex index.html index.htm index.php index.asp index.aspx index.jsp index.jspa index.shtml index.shtm
# Custom Global Settings (if any exist)

# Custom VH settings (if any exist)
ProxyRequests on
    <Proxy *>
            Order deny,allow
            Allow from all
    </Proxy>
            ProxyPass / http://ipofmyserver:7002/
            ProxyPassReverse / http://ipofmyserver:7002/
</virtualhost>
# END DOMAIN: admin.mydomain.com

#SECONDPART
# DOMAIN: admin.mydomain.com
# PORT FORWARD FROM 80 TO: 80
<virtualhost *:80>
ServerName admin.mydomain.com
ServerAlias www.admin.mydomain.com
ServerAdmin zadmin@localhost
RewriteEngine on
ReWriteCond %{SERVER_PORT} !^80$
RewriteRule ^/(.*) http://%{HTTP_HOST}:80/$1 [NC,R,L]
</virtualhost>
# END DOMAIN: admin.mydomain.com

mydomain.com托管在另一台服务器上。因此,我要做的是为指向我的服务器ip的子域创建一个A记录,然后尝试在httpd-vhosts.conf上设置代理。

起初它显示500错误The server encountered an internal error or misconfiguration and was unable to complete your request.,当我将:80端口更改为其他端口时,它显示了一个带有ap apache示例html的目录。 然后,如果我更改了重写规则的第二部分配置上的端口,它将向我显示sendora面板登录名。

我不知道我在做什么错。你有什么主意吗?

0 个答案:

没有答案
相关问题