映射:
1.开启apache中的proxy模块(proxy.conf,proxy.load,proxy_http.load)
2.配置apache配置文件,<VirtualHost *:80>添加
ServerName ××.××.cn
ProxyPreserveHost On
ProxyPass / http://××:8090/ecommerce/
ProxyPassReverse / http://××:8090/ecommerce/
此方法会碰到,资源文件请求失败的问题
资源文件无法访问问题的解决方法:
#ofbiz商城绑定域名[代理]
<VirtualHost *:80>
ServerName **.cn
ServerAlias www.**.cn
ProxyPreserveHost On
ProxyPass / http://127.0.0.1:8090/
ProxyPassReverse / http://127.0.0.1:8090/
RewriteEngine On
RewriteRule ^/$ http://www.**.cn/ecommerce [R,L]
</VirtualHost>
1.仅代理到8090端口
2.url重写到/ecommerce