|
 
- 帖子
- 758
- 精华
- 1
- 积分
- 4825
- 性别
- 男
- 在线时间
- 319 小时
- 注册时间
- 2008-3-6
- 最后登录
- 2012-1-9
|
沙发
发表于 2011-2-15 15:56
| 只看该作者
<VirtualHost xx.xx.x.xx:80>
ServerAdmin webmaster@aaa.com.au
ServerName calliope-dev.aaa.com.au
DocumentRoot /data/home/exeweb/public_html
ProxyPreserveHost On
RewriteEngine On
RewriteRule ^/calliope/(.*) /$1 [R]
RewriteRule ^/(.+)$ http://localhost:8080/calliope/$1 [proxy]
#RewriteRule ^/calliope/(.*) http://localhost:8080/calliope/$1 [proxy]
#RewriteRule ^/(.+)$ http://localhost:8080/calliope/$1 [proxy]
#RewriteRule ^/(.*) http://localhost:8080/$1 [proxy]
<Proxy *>
Order allow,deny
Allow from all
</Proxy>
<Location />
ProxyPass http://localhost:8080/calliope
ProxyPassReverse http://localhost:8080/calliope
## 上面这排的目的地要注意。
## 我后台直接访问 http://localhost:8080/calliope, 会跳转到 http://localhost:8080/calliope/query
## 所以前面加了2个rewrite的规则,一个做地址转换,一个做PROXY的处理
## 实现的效果是, 访问 xx.xx.x.xx,URL会跳转到 xx.xx.x.xx/query, 去掉了中间的calliope
</Location>
CustomLog /var/log/apache2/calliope-dev.exetel.com.au/access.log combined
ErrorLog /var/log/apache2/calliope-dev.exetel.com.au/error.log
RewriteLog /var/log/apache2/calliope-dev.exetel.com.au/rewrite.log
RewriteLogLevel 9
</VirtualHost>
有时候会出现很奇怪的情况,明明改了CONFIG,但是不是想预期的那样工作。
重启TOMCAT,APACHE,关闭再打开浏览器,再测试。 |
|