- 论坛徽章:
- 18
|
解决了30分
apache 记录的是内部网关的ip地址,不是访问人的公网ip地址,要怎么改呢
路由器
|
交换机
|
服务器
- #more httpd.conf
- <IfModule log_config_module>
- #
- # The following directives define some format nicknames for use with
- # a CustomLog directive (see below).
- #
- #LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined
- LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\" \[color=Blue]"%{X-Forwarded-For}i\"[/color]" combined
- #LogFormat "%h %l %u %t \"%r\" %>s %b" common
- LogFormat "%h %l %u %t \"%r\" %>s %b" \[color=Blue]"%{X-Forwarded-For}i\"[/color]" common
- <IfModule logio_module>
- # You need to enable mod_logio.c to use %I and %O
- LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\" \[color=Blue]"%{X-Forwarded-For}i\[/color]" %I %O"" combinedio
- </IfModule>
- #
- # The location and format of the access logfile (Common Logfile Format).
- # If you do not define any access logfiles within a <VirtualHost>
- # container, they will be logged here. Contrariwise, if you *do*
- # define per-<VirtualHost> access logfiles, transactions will be
- # logged therein and *not* in this file.
- #
- #CustomLog "logs/access_log" combined
-
- CustomLog "|/usr/local/sbin/cronolog /usr/local/httpd/logs/access_%Y%m%d.log" combined
- #
- # If you prefer a logfile with access, agent, and referer information
- # (Combined Logfile Format) you can use the following directive.
- #
- #CustomLog "logs/access_log" combined
- </IfModule>
复制代码 |
|