返回列表 回复 发帖

tomcat install

debian package
tomcat6
tomcat6-examples tomcat6-admin
<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,关闭再打开浏览器,再测试。
返回列表