Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/apache/8.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 Apache使用mod_代理重定向,mod_重写_Linux_Apache_Mod Rewrite_Ssl_Mod Proxy - Fatal编程技术网

Linux Apache使用mod_代理重定向,mod_重写

Linux Apache使用mod_代理重定向,mod_重写,linux,apache,mod-rewrite,ssl,mod-proxy,Linux,Apache,Mod Rewrite,Ssl,Mod Proxy,我需要使用Apache配置代理重定向,mod_重写,mod_代理。 下一步: WEBLogic Node1: ip: 10.0.0.3 port:7003 (not SSL) WEBLogic Node2: ip: 10.0.0.4 port:7004 (not SSL) WEBLogic Apache: ip: 10.0.0.5 ports: 80,443 (Apache Server Balancer) 因此,我应该得到: 服务器10.0.0.5具有到WEBLogic节点的HTTP平衡器:

我需要使用Apache配置代理重定向,mod_重写,mod_代理。 下一步:

WEBLogic Node1: ip: 10.0.0.3 port:7003 (not SSL)
WEBLogic Node2: ip: 10.0.0.4 port:7004 (not SSL)
WEBLogic Apache: ip: 10.0.0.5 ports: 80,443 (Apache Server Balancer)
因此,我应该得到: 服务器10.0.0.5具有到WEBLogic节点的HTTP平衡器:1,2

我将配置下一个: 怎么了? 谢谢

http://10.0.0.5/manage (redirect) -> httpS://10.0.0.5/faces/login (In browser user must see /manage) -> HTTP balancer
httpS://10.0.0.5/manage (redirect)-> httpS://10.0.0.5/faces/login (In browser user must see /manage) -> HTTP balancer
NameVirtualHost *:80
NameVirtualHost *:443

<VirtualHost *:80>
<IfModule mod_rewrite.c>
RewriteEngine On
# log
RewriteLog /var/log/mod_rewrite.log
RewriteLogLevel 6

# redirect to SSL connection
RewriteCond %{REQUEST_URI}  ^/manage/?$
RewriteCond %{SERVER_PORT} 80
# R=301 sends HTTP Moved Permanently L=Last rule for this request
RewriteRule ^(.*)$ https://%{SERVER_NAME}/faces/login [R,L]
</IfModule>

</VirtualHost>

<VirtualHost *:443>
# SSL
SSLEngine on
SSLProxyEngine On
SSLProtocol all -SSLv2 -SSLv3
SSLCipherSuite ALL:!ADH:RC4+RSA:+HIGH:+MEDIUM:!LOW:!SSLv2:!EXPORT
SSLCertificateFile /etc/apache2/certs/host.pem
SSLCertificateKeyFile /etc/apache2/certs/host.key


# mod_rewrite
<IfModule mod_rewrite.c>
RewriteEngine On
# log
RewriteLog /var/log/mod_rewrite.log
RewriteLogLevel 6

# redirect to SSL connection
RewriteCond %{REQUEST_URI}  ^/manage/?$
RewriteCond %{SERVER_PORT} 443
# R=301 sends HTTP Moved Permanently L=Last rule for this request
RewriteRule ^(.*)$ https://%{SERVER_NAME}/faces/login [R,L]
</IfModule>

##########################
# MOD PROXY
##########################
# logs
LogFormat "%t - %h - %{BALANCER_WORKER_NAME}e - \"%r\" - %>s - %b" custom
LogLevel warn
CustomLog "/var/log/apache2/custom_balancer.log" custom
ErrorLog  "/var/log/apache2/error_balancer.log"

# proxy
ProxyRequests Off
ProxyPreserveHost On
ProxyVia On
ProxyTimeout 1200

SSLEngine on
SSLProxyEngine On

<Proxy balancer://http_test_cluster>
BalancerMember http://10.0.0.3:7003/faces/login loadfactor=10 retry=120 connectiontimeout=15 timeout=30
BalancerMember http://10.0.0.4:7004/faces/login loadfactor=10 retry=120 connectiontimeout=15 timeout=30
ProxySet lbmethod=byrequests timeout=25
</Proxy>

# balance manager tool has gui
<Location /balancer-manager>
SetHandler balancer-manager
Order deny,allow
Allow from all
</Location>
ProxyPass /balancer-manager !

ProxyPass /faces balancer://http_test_cluster/manage
ProxyPassReverse / http://10.0.0.3:7003/faces/login
ProxyPassReverse / http://10.0.0.4:7004/faces/login

</VirtualHost>
(1) pass through /faces/login
(2) init rewrite engine with requested uri /balancer-manager
(3) applying pattern '^(.*)$' to uri '/balancer-manager'
(4) RewriteCond: input='/faces/login' pattern='^/manage/?$' => not-matched