LinuxSir.cn,穿越时空的Linuxsir!

 找回密码
 注册
搜索
热搜: shell linux mysql
查看: 830|回复: 3

apache作代理服务器失败!

[复制链接]
发表于 2003-12-30 12:52:07 | 显示全部楼层 |阅读模式
下面是我的http.conf中的代码,大家看看有什么问题??
<IfModule mod_proxy.c>
ProxyRequests On

<roxy *>
    Order deny,allow
    Deny from all
    Allow from 192.168.0.0/24
</Proxy>

#
# Enable/disable the handling of HTTP/1.1 "Via:" headers.
# ("Full" adds the server version; "Block" removes all outgoing Via: headers)
# Set to one of: Off | On | Full | Block
#
#ProxyVia On

#
# To enable the cache as well, edit and uncomment the following lines:
# (no cacheing without CacheRoot)
#
CacheRoot "/etc/httpd/proxy"
CacheSize 6
CacheGcInterval 4
CacheMaxExpire 24
CacheLastModifiedFactor 0.1
CacheDefaultExpire 1
NoCache a-domain.com another-domain.edu joes.garage-sale.com

</IfModule>
# End of proxy directives.
这下面是启动出错的信息:
httpd failed. The error was: Stopping httpd: [FAILED]
Starting httpd: Syntax error on line 998 of /etc/httpd/conf/httpd.conf:
Invalid command 'CacheRoot', perhaps mis-spelled or defined by a module not included in the server configuration
[FAILED]
他说的998行就是CacheRoot那一行,我的这个目录本来没有 ,我mkdir 后他还是这样说,难道是我没有加载什么模块?
还有刚开始我写的Allow from 192.168.0.0/254,他有错误,为什么Allow from 192.168.0.0/24就没有错误?192.168.0.0/24是什么意思,我的网络是从192.168.0.1到192.168.0.255的
发表于 2003-12-30 20:28:51 | 显示全部楼层
是apache还是apache2?

  1. <IfDefine !APACHE2>
  2.    CacheRoot "/var/cache/httpd"
  3.    CacheSize 5
  4.    CacheGcInterval 4
  5.    CacheMaxExpire 24
  6.    CacheLastModifiedFactor 0.1
  7.    CacheDefaultExpire 1
  8.    #NoCache a-domain.com another-domain.edu joes.garage-sale.com
  9. </IfDefine>


  10. <IfDefine APACHE2>
  11. <IfModule mod_disk_cache.c>
  12.    CacheRoot "/var/cache/httpd"
  13.    CacheSize 5
  14.    CacheGcInterval 4
  15.    CacheMaxExpire 24
  16.    CacheLastModifiedFactor 0.1
  17.    CacheDefaultExpire 1
  18.    #NoCache a-domain.com another-domain.edu joes.garage-sale.com
  19. </IfModule>
  20. </IfDefine>

复制代码
 楼主| 发表于 2003-12-31 03:16:54 | 显示全部楼层
是2了,是RH9.0中自带的
发表于 2003-12-31 09:06:43 | 显示全部楼层

回复: apache作代理服务器失败!

最初由 x-dongzi 发表
还有刚开始我写的Allow from 192.168.0.0/254,他有错误,为什么Allow from 192.168.0.0/24就没有错误?192.168.0.0/24是什么意思,我的网络是从192.168.0.1到192.168.0.255的

24是子网掩码,就是255.255.255.0
因为255.255.255.0就是11111111.11111111.11111111.00000000
一共3x8=24个1,所以简写成24。
你写的192.168.0.0/254当然是不合法的掩码值了
您需要登录后才可以回帖 登录 | 注册

本版积分规则

快速回复 返回顶部 返回列表