apache作代理服务器失败!

由 x-dongzi 在 12-30-2003 12:52 发表:

apache作代理服务器失败!

下面是我的http.conf中的代码,大家看看有什么问题??

 1<ifmodule mod_proxy.c="">   
 2  
 3ProxyRequests On   
 4  
 5  
 6  
 7<proxy *="">   
 8  
 9Order deny,allow   
10  
11Deny from all   
12  
13Allow from 192.168.0.0/24   
14  
15</proxy>   
16  
17  
18  
19#   
20  
21# Enable/disable the handling of HTTP/1.1 "Via:" headers.   
22  
23# ("Full" adds the server version; "Block" removes all outgoing Via: headers)   
24  
25# Set to one of: Off | On | Full | Block   
26  
27#   
28  
29#ProxyVia On   
30  
31  
32  
33#   
34  
35# To enable the cache as well, edit and uncomment the following lines:   
36  
37# (no cacheing without CacheRoot)   
38  
39#   
40  
41CacheRoot "/etc/httpd/proxy"   
42  
43CacheSize 6   
44  
45CacheGcInterval 4   
46  
47CacheMaxExpire 24   
48  
49CacheLastModifiedFactor 0.1   
50  
51CacheDefaultExpire 1   
52  
53NoCache a-domain.com another-domain.edu joes.garage-sale.com   
54  
55  
56  
57</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的


由 Glue 在 12-30-2003 20:28 发表:


是apache还是apache2?

> > 源码: >
> * * * >
>
> > >

 1<ifdefine !apache2="">  
 2&gt;     &gt; 
 3&gt;        CacheRoot "/var/cache/httpd"  
 4&gt;     &gt; 
 5&gt;        CacheSize 5  
 6&gt;     &gt; 
 7&gt;        CacheGcInterval 4  
 8&gt;     &gt; 
 9&gt;        CacheMaxExpire 24  
10&gt;     &gt; 
11&gt;        CacheLastModifiedFactor 0.1  
12&gt;     &gt; 
13&gt;        CacheDefaultExpire 1  
14&gt;     &gt; 
15&gt;        #NoCache a-domain.com another-domain.edu joes.garage-sale.com  
16&gt;     &gt; 
17&gt;     </ifdefine>

> > >
> > >
> > >

 1<ifdefine apache2="">  
 2&gt;     &gt; 
 3&gt;     <ifmodule mod_disk_cache.c="">  
 4&gt;     &gt; 
 5&gt;        CacheRoot "/var/cache/httpd"  
 6&gt;     &gt; 
 7&gt;        CacheSize 5  
 8&gt;     &gt; 
 9&gt;        CacheGcInterval 4  
10&gt;     &gt; 
11&gt;        CacheMaxExpire 24  
12&gt;     &gt; 
13&gt;        CacheLastModifiedFactor 0.1  
14&gt;     &gt; 
15&gt;        CacheDefaultExpire 1  
16&gt;     &gt; 
17&gt;        #NoCache a-domain.com another-domain.edu joes.garage-sale.com  
18&gt;     &gt; 
19&gt;     </ifmodule>  
20&gt;     &gt; 
21&gt;     </ifdefine>

> > >
> > >
>
> * * *


-_-


由 x-dongzi 在 12-31-2003 03:16

Published At
Categories with 服务器类
Tagged with
comments powered by Disqus