在DEBIAN下使用apache2的反向代理,连接到一台内部服务器上。
首先要激活proxy模块:
sudo a2enmod
选择proxy
sudo mkdir /var/www/proxy
sudo chown www-data:www-data /var/www/proxy
然后修改对应的sites:
ServerAdmin xxx@xxx.org
ServerName xxxxx
ProxyRequests Off
Order allow,deny
Allow from all
# 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 80ErrorLog /var/log/apache2/error-westdc.geodata.cn.log
CustomLog /var/log/apache2/access-westdc.geodata.cn.log combined
ServerSignature On
参考: http://www.chedong.com/tech/cache.html
发表回复