apache做反向代理时,如何记录其访问日志?

在OpenBSD环境下搭建各种服务器的相关讨论。

版主: lionuxchenjun天地乾坤

回复
qinjuan
铝 Al
帖子: 10
注册时间: 2011-02-26 8:47

apache做反向代理时,如何记录其访问日志?

帖子 qinjuan » 2011-12-09 17:01

在使用apache做反向代理时,如何记录其访问日志?

qinjuan
铝 Al
帖子: 10
注册时间: 2011-02-26 8:47

回复: apache做反向代理时,如何记录其访问日志?

帖子 qinjuan » 2011-12-15 17:03

apache做反向代理时,如何记录其反向代理的日志?

头像
leo
帖子: 2465
注册时间: 2010-01-21 3:27

回复: apache做反向代理时,如何记录其访问日志?

帖子 leo » 2011-12-15 21:07

for apache 2
from:
http://knowledge.oscc.org.my/solution-a ... directives
A sample configuration from MDKP.GOV.MY Apache web server using the combination of ProxyPass and ProxyPassReverse for achieving "shared" port 80.

As we already know , Apache mainly runs at port 80 and while it does sometimes runs on diffrent port depend on it's configuration. Well here in MDKP (Local Council Of Kuala Pilah) faces a major problem. We want to run web server using internal hosting and also we're gonna have another server which called E-Aduan Awam (E-Public Complaint System) and both of these server runs Apache on the same port! that is port 80. This is due to the lack of Static IP since we can't afford yet to own a leased line with Static IP bundle with it. Right now we have to endure with 1 Static Public IP using SDSL connection from Telekom Malaysia. So here's the snippet of Apache 2.2.x on what we've already implement using Virtual Host container and the combination of ProxyPass and ProxyPassReverse Directives.

代码: 全选

 <VirtualHost 10.10.10.2:80>
        ServerName www.mdkp.gov.my
        ServerAdmin [email protected]
        DocumentRoot /home/webmaster/public_html/
        CustomLog /var/log/httpd/access_log combined
</VirtualHost>

代码: 全选

<VirtualHost 10.10.10.2:80>
        ServerName eaduan.mdkp.gov.my
        ProxyPass / http://eaduan.mdkp.gov.my/
        ProxyPassReverse / http://eaduan.mdkp.gov.my/
        CustomLog /var/log/httpd/access_log combined
        ErrorLog    /var/log/httpd/error_log
</VirtualHost>

代码: 全选

<VirtualHost 10.10.10.2:80>
        ServerName penguin.mdkp.gov.my
        ProxyPass / http://penguin.mdkp.gov.my/
        ProxyPassReverse / http://penguin.mdkp.gov.my/
        CustomLog /var/log/httpd/access_log combined
        ErrorLog    /var/log/httpd/error_log
</VirtualHost>

回复

在线用户

正浏览此版面之用户: 没有注册用户 和 0 访客