免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 2166 | 回复: 5
打印 上一主题 下一主题

[Web] apache记录的是内部网关的ip [复制链接]

论坛徽章:
18
巳蛇
日期:2014-12-03 08:27:5115-16赛季CBA联赛之吉林
日期:2016-04-18 15:24:24qiaoba
日期:2016-06-17 17:41:1615-16赛季CBA联赛之八一
日期:2016-06-20 15:13:1415-16赛季CBA联赛之广夏
日期:2016-06-29 10:38:28极客徽章
日期:2016-12-07 14:03:4015-16赛季CBA联赛之吉林
日期:2017-03-06 13:47:55
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2009-07-24 18:07 |只看该作者 |倒序浏览
解决了30分

apache 记录的是内部网关的ip地址,不是访问人的公网ip地址,要怎么改呢
路由器
  |
交换机
  |
服务器


  1. #more httpd.conf
  2. <IfModule log_config_module>
  3.     #
  4.     # The following directives define some format nicknames for use with
  5.     # a CustomLog directive (see below).
  6.     #
  7.     #LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined
  8.     LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\" \[color=Blue]"%{X-Forwarded-For}i\"[/color]" combined
  9.     #LogFormat "%h %l %u %t \"%r\" %>s %b" common
  10.     LogFormat "%h %l %u %t \"%r\" %>s %b" \[color=Blue]"%{X-Forwarded-For}i\"[/color]" common

  11.     <IfModule logio_module>
  12.       # You need to enable mod_logio.c to use %I and %O
  13.       LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\" \[color=Blue]"%{X-Forwarded-For}i\[/color]" %I %O"" combinedio
  14.     </IfModule>

  15.     #
  16.     # The location and format of the access logfile (Common Logfile Format).
  17.     # If you do not define any access logfiles within a <VirtualHost>
  18.     # container, they will be logged here.  Contrariwise, if you *do*
  19.     # define per-<VirtualHost> access logfiles, transactions will be
  20.     # logged therein and *not* in this file.
  21.     #
  22.     #CustomLog "logs/access_log" combined
  23.    
  24.     CustomLog "|/usr/local/sbin/cronolog /usr/local/httpd/logs/access_%Y%m%d.log" combined
  25.     #
  26.     # If you prefer a logfile with access, agent, and referer information
  27.     # (Combined Logfile Format) you can use the following directive.
  28.     #
  29.     #CustomLog "logs/access_log" combined
  30. </IfModule>
复制代码

论坛徽章:
5
2015年辞旧岁徽章
日期:2015-03-03 16:54:152015年迎新春徽章
日期:2015-03-04 09:53:172015亚冠之水原三星
日期:2015-06-02 16:34:202015年亚冠纪念徽章
日期:2015-10-19 18:13:37程序设计版块每日发帖之星
日期:2015-11-08 06:20:00
2 [报告]
发表于 2009-07-24 18:27 |只看该作者
路由器什么情况

评分

参与人数 1可用积分 +2 收起 理由
gilet + 2 thank you

查看全部评分

论坛徽章:
18
巳蛇
日期:2014-12-03 08:27:5115-16赛季CBA联赛之吉林
日期:2016-04-18 15:24:24qiaoba
日期:2016-06-17 17:41:1615-16赛季CBA联赛之八一
日期:2016-06-20 15:13:1415-16赛季CBA联赛之广夏
日期:2016-06-29 10:38:28极客徽章
日期:2016-12-07 14:03:4015-16赛季CBA联赛之吉林
日期:2017-03-06 13:47:55
3 [报告]
发表于 2009-07-24 18:49 |只看该作者
路由器是飞塔的,我看不太懂

论坛徽章:
0
4 [报告]
发表于 2009-07-24 22:25 |只看该作者
路由器设置有问题吧,怎么把源ip给改了

评分

参与人数 1可用积分 +2 收起 理由
gilet + 2 thank you

查看全部评分

论坛徽章:
0
5 [报告]
发表于 2009-07-24 23:24 |只看该作者
原帖由 marsteel 于 2009-7-24 22:25 发表
路由器设置有问题吧,怎么把源ip给改了


有的路由器或者路由器软件在端口映射的时候是会修改源IP的

评分

参与人数 1可用积分 +2 收起 理由
gilet + 2 thank you

查看全部评分

论坛徽章:
18
巳蛇
日期:2014-12-03 08:27:5115-16赛季CBA联赛之吉林
日期:2016-04-18 15:24:24qiaoba
日期:2016-06-17 17:41:1615-16赛季CBA联赛之八一
日期:2016-06-20 15:13:1415-16赛季CBA联赛之广夏
日期:2016-06-29 10:38:28极客徽章
日期:2016-12-07 14:03:4015-16赛季CBA联赛之吉林
日期:2017-03-06 13:47:55
6 [报告]
发表于 2009-07-25 09:49 |只看该作者
谢谢大家,搞定了,路由器的问题,把进来的地址也给转换为网关地址了,现在可以了
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP