另类反向代理DNN4

Posted on 六月 8th, 2009 in Linux | No Comments »

之前在反向代理DNN4时一直有问题(DNN4通过HEADER进行重定向,导致无法使用基于内部域名的反向代理)
在这儿找到一个办法:
http://www.r2integrated.com/dnn/Forum/tabid/170/aff/1/aft/9187/afv/topic/afpg/1/Default.aspx
在代理服务器上:
/etc/hosts中添加一个解析:192.168.50.238 heihe.westgis.ac.cn
在apahce中配置:
ServerName heihe.westgis.ac.cn
ProxyPass / http://heihe.westgis.ac.cn/
ProxyPassReverse / http://heihe.westgis.ac.cn/
...

在虚拟机上配置:
\windows\system32\drivers\etc\hosts中添加一行:192.168.50.238 heihe.westgis.ac.cn

重启对应服务,搞定!

apache2反向代理

Posted on 十月 16th, 2006 in Linux | 2 Comments »

在DEBIAN下使用apache2的反向代理,连接到一台内部服务器上。
首先要激活proxy模块:
sudo a2enmod
选择proxy
sudo mkdir /var/www/proxy
sudo chown www-data:www-data /var/www/proxy
然后修改对应的sites:

<VirtualHost *>
ServerAdmin xxx@xxx.org
ServerName xxxxx
ProxyRequests Off
<Proxy *>
Order allow,deny
Allow from all
</Proxy>
# reverse proxy setting
ProxyPass / http://192.168.100.8:8180/
ProxyPassReverse / http://192.168.100.8:8180/
# cache dir root
CacheRoot "/var/www/proxy"
# max cache storage
CacheSize 50000000
# hour: every 4 hour
CacheGcInterval 4
# max page expire time: hour
CacheMaxExpire 240
# Expire time = (now - last_modified) * CacheLastModifiedFactor
CacheLastModifiedFactor 0.1
# defalt expire tag: hour
CacheDefaultExpire 1
# force complete after precent of content retrived: 60-90%
CacheForceCompletion 80

ErrorLog /var/log/apache2/error-westdc.geodata.cn.log
CustomLog /var/log/apache2/access-westdc.geodata.cn.log combined
ServerSignature On

</VirtualHost>

参考: http://www.chedong.com/tech/cache.html