免费注册 查看新帖 |

Chinaunix

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

[网络管理] 熟悉Apache配置的大哥帮我看看这个配置,为什么达不到这个要求? [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2017-01-06 12:35 |只看该作者 |倒序浏览
在/opt/ftp/webwww目录放了很多文件,想使用简单的http方式供别人下载
看别人的案例,照葫芦画瓢,不成事,其它机访问这服务器的IP地址,只能出Apche的Test page

基本上是去掉了官方默认配置的全部注释说明语句,自己琢磨的<Directory />,里面的权限应该就是“理解上”的不使用index.html默认,显示全部文件。
不成功,麻烦高手们帮帮我了,谢谢!!!

配置如下:



  1. [root@LinServer ~]#
  2. [root@LinServer ~]# cat /etc/httpd/conf/
  3. httpd.conf       httpd.conf.bak   httpd.conf.temp  magic            
  4. [root@LinServer ~]# cat /etc/httpd/conf/
  5. httpd.conf       httpd.conf.bak   httpd.conf.temp  magic            
  6. [root@LinServer ~]# cat /etc/httpd/conf/httpd.conf
  7. ServerTokens OS

  8. ServerRoot "/etc/httpd"

  9. PidFile run/httpd.pid

  10. Timeout 60

  11. KeepAlive Off

  12. MaxKeepAliveRequests 100

  13. KeepAliveTimeout 15

  14. <IfModule prefork.c>
  15. StartServers       8
  16. MinSpareServers    5
  17. MaxSpareServers   20
  18. ServerLimit      256
  19. MaxClients       256
  20. MaxRequestsPerChild  4000
  21. </IfModule>

  22. <IfModule worker.c>
  23. StartServers         4
  24. MaxClients         300
  25. MinSpareThreads     25
  26. MaxSpareThreads     75
  27. ThreadsPerChild     25
  28. MaxRequestsPerChild  0
  29. </IfModule>

  30. Listen 80

  31. LoadModule auth_basic_module modules/mod_auth_basic.so
  32. LoadModule auth_digest_module modules/mod_auth_digest.so
  33. LoadModule authn_file_module modules/mod_authn_file.so
  34. LoadModule authn_alias_module modules/mod_authn_alias.so
  35. LoadModule authn_anon_module modules/mod_authn_anon.so
  36. LoadModule authn_dbm_module modules/mod_authn_dbm.so
  37. LoadModule authn_default_module modules/mod_authn_default.so
  38. LoadModule authz_host_module modules/mod_authz_host.so
  39. LoadModule authz_user_module modules/mod_authz_user.so
  40. LoadModule authz_owner_module modules/mod_authz_owner.so
  41. LoadModule authz_groupfile_module modules/mod_authz_groupfile.so
  42. LoadModule authz_dbm_module modules/mod_authz_dbm.so
  43. LoadModule authz_default_module modules/mod_authz_default.so
  44. LoadModule ldap_module modules/mod_ldap.so
  45. LoadModule authnz_ldap_module modules/mod_authnz_ldap.so
  46. LoadModule include_module modules/mod_include.so
  47. LoadModule log_config_module modules/mod_log_config.so
  48. LoadModule logio_module modules/mod_logio.so
  49. LoadModule env_module modules/mod_env.so
  50. LoadModule ext_filter_module modules/mod_ext_filter.so
  51. LoadModule mime_magic_module modules/mod_mime_magic.so
  52. LoadModule expires_module modules/mod_expires.so
  53. LoadModule deflate_module modules/mod_deflate.so
  54. LoadModule headers_module modules/mod_headers.so
  55. LoadModule usertrack_module modules/mod_usertrack.so
  56. LoadModule setenvif_module modules/mod_setenvif.so
  57. LoadModule mime_module modules/mod_mime.so
  58. LoadModule dav_module modules/mod_dav.so
  59. LoadModule status_module modules/mod_status.so
  60. LoadModule autoindex_module modules/mod_autoindex.so
  61. LoadModule info_module modules/mod_info.so
  62. LoadModule dav_fs_module modules/mod_dav_fs.so
  63. LoadModule vhost_alias_module modules/mod_vhost_alias.so
  64. LoadModule negotiation_module modules/mod_negotiation.so
  65. LoadModule dir_module modules/mod_dir.so
  66. LoadModule actions_module modules/mod_actions.so
  67. LoadModule speling_module modules/mod_speling.so
  68. LoadModule userdir_module modules/mod_userdir.so
  69. LoadModule alias_module modules/mod_alias.so
  70. LoadModule substitute_module modules/mod_substitute.so
  71. LoadModule rewrite_module modules/mod_rewrite.so
  72. LoadModule proxy_module modules/mod_proxy.so
  73. LoadModule proxy_balancer_module modules/mod_proxy_balancer.so
  74. LoadModule proxy_ftp_module modules/mod_proxy_ftp.so
  75. LoadModule proxy_http_module modules/mod_proxy_http.so
  76. LoadModule proxy_ajp_module modules/mod_proxy_ajp.so
  77. LoadModule proxy_connect_module modules/mod_proxy_connect.so
  78. LoadModule cache_module modules/mod_cache.so
  79. LoadModule suexec_module modules/mod_suexec.so
  80. LoadModule disk_cache_module modules/mod_disk_cache.so
  81. LoadModule cgi_module modules/mod_cgi.so
  82. LoadModule version_module modules/mod_version.so

  83. Include conf.d/*.conf

  84. User apache
  85. Group apache

  86. ServerAdmin root@localhost

  87. UseCanonicalName Off

  88. DocumentRoot "/opt/ftp/webwww"

  89. <Directory "/opt/ftp/webwww">
  90. Options Indexes
  91. AllowOverride None
  92. Order allow,deny
  93. Allow from all
  94. </Directory>


  95. #[        DISCUZ_CODE_0        ]lt;Directory />
  96. #$    Options FollowSymLinks
  97. #$    AllowOverride None
  98. #[        DISCUZ_CODE_0        ]lt;/Directory>

  99. #[        DISCUZ_CODE_0        ]lt;Directory "/var/www/html">

  100. #$    Options Indexes FollowSymLinks

  101. #$    AllowOverride None

  102. #$    Order allow,deny
  103. #$    Allow from all

  104. #[        DISCUZ_CODE_0        ]lt;/Directory>

  105. <IfModule mod_userdir.c>
  106.     UserDir disabled
  107. </IfModule>

  108. #$DirectoryIndex index.html index.html.var

  109. AccessFileName .htaccess

  110. <Files ~ "^\.ht">
  111.     Order allow,deny
  112.     Deny from all
  113.     Satisfy All
  114. </Files>

  115. TypesConfig /etc/mime.types

  116. DefaultType text/plain

  117. <IfModule mod_mime_magic.c>
  118.     MIMEMagicFile conf/magic
  119. </IfModule>

  120. HostnameLookups Off

  121. #EnableMMAP off

  122. #EnableSendfile off

  123. ErrorLog logs/error_log

  124. LogLevel warn

  125. LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined
  126. LogFormat "%h %l %u %t \"%r\" %>s %b" common
  127. LogFormat "%{Referer}i -> %U" referer
  128. LogFormat "%{User-agent}i" agent


  129. #CustomLog logs/access_log common

  130. #CustomLog logs/referer_log referer
  131. #CustomLog logs/agent_log agent

  132. CustomLog logs/access_log combined

  133. ServerSignature On

  134. Alias /icons/ "/var/www/icons/"

  135. <Directory "/var/www/icons">
  136.     Options Indexes MultiViews FollowSymLinks
  137.     AllowOverride None
  138.     Order allow,deny
  139.     Allow from all
  140. </Directory>

  141. <IfModule mod_dav_fs.c>
  142.     # Location of the WebDAV lock database.
  143.     DAVLockDB /var/lib/dav/lockdb
  144. </IfModule>

  145. ScriptAlias /cgi-bin/ "/var/www/cgi-bin/"

  146. <Directory "/var/www/cgi-bin">
  147.     AllowOverride None
  148.     Options None
  149.     Order allow,deny
  150.     Allow from all
  151. </Directory>



  152. IndexOptions FancyIndexing VersionSort NameWidth=* HTMLTable Charset=UTF-8

  153. AddIconByEncoding (CMP,/icons/compressed.gif) x-compress x-gzip

  154. AddIconByType (TXT,/icons/text.gif) text/*
  155. AddIconByType (IMG,/icons/image2.gif) image/*
  156. AddIconByType (SND,/icons/sound2.gif) audio/*
  157. AddIconByType (VID,/icons/movie.gif) video/*

  158. AddIcon /icons/binary.gif .bin .exe
  159. AddIcon /icons/binhex.gif .hqx
  160. AddIcon /icons/tar.gif .tar
  161. AddIcon /icons/world2.gif .wrl .wrl.gz .vrml .vrm .iv
  162. AddIcon /icons/compressed.gif .Z .z .tgz .gz .zip
  163. AddIcon /icons/a.gif .ps .ai .eps
  164. AddIcon /icons/layout.gif .html .shtml .htm .pdf
  165. AddIcon /icons/text.gif .txt
  166. AddIcon /icons/c.gif .c
  167. AddIcon /icons/p.gif .pl .py
  168. AddIcon /icons/f.gif .for
  169. AddIcon /icons/dvi.gif .dvi
  170. AddIcon /icons/uuencoded.gif .uu
  171. AddIcon /icons/script.gif .conf .sh .shar .csh .ksh .tcl
  172. AddIcon /icons/tex.gif .tex
  173. AddIcon /icons/bomb.gif /core

  174. AddIcon /icons/back.gif ..
  175. AddIcon /icons/hand.right.gif README
  176. AddIcon /icons/folder.gif ^^DIRECTORY^^
  177. AddIcon /icons/blank.gif ^^BLANKICON^^

  178. DefaultIcon /icons/unknown.gif

  179. #AddDescription "GZIP compressed document" .gz
  180. #AddDescription "tar archive" .tar
  181. #AddDescription "GZIP compressed tar archive" .tgz

  182. ReadmeName README.html
  183. HeaderName HEADER.html

  184. IndexIgnore .??* *~ *# HEADER* README* RCS CVS *,v *,t

  185. AddLanguage ca .ca
  186. AddLanguage cs .cz .cs
  187. AddLanguage da .dk
  188. AddLanguage de .de
  189. AddLanguage el .el
  190. AddLanguage en .en
  191. AddLanguage eo .eo
  192. AddLanguage es .es
  193. AddLanguage et .et
  194. AddLanguage fr .fr
  195. AddLanguage he .he
  196. AddLanguage hr .hr
  197. AddLanguage it .it
  198. AddLanguage ja .ja
  199. AddLanguage ko .ko
  200. AddLanguage ltz .ltz
  201. AddLanguage nl .nl
  202. AddLanguage nn .nn
  203. AddLanguage no .no
  204. AddLanguage pl .po
  205. AddLanguage pt .pt
  206. AddLanguage pt-BR .pt-br
  207. AddLanguage ru .ru
  208. AddLanguage sv .sv
  209. AddLanguage zh-CN .zh-cn
  210. AddLanguage zh-TW .zh-tw

  211. LanguagePriority en ca cs da de el eo es et fr he hr it ja ko ltz nl nn no pl pt pt-BR ru sv zh-CN zh-TW

  212. ForceLanguagePriority Prefer Fallback

  213. AddDefaultCharset UTF-8

  214. #AddType application/x-tar .tgz

  215. #AddEncoding x-compress .Z
  216. #AddEncoding x-gzip .gz .tgz

  217. AddType application/x-compress .Z
  218. AddType application/x-gzip .gz .tgz

  219. AddType application/x-x509-ca-cert .crt
  220. AddType application/x-pkcs7-crl    .crl

  221. #AddHandler cgi-script .cgi

  222. #AddHandler send-as-is asis

  223. AddHandler type-map var

  224. AddType text/html .shtml
  225. AddOutputFilter INCLUDES .shtml


  226. #ErrorDocument 500 "The server made a boo boo."
  227. #ErrorDocument 404 /missing.html
  228. #ErrorDocument 404 "/cgi-bin/missing_handler.pl"
  229. #ErrorDocument 402 http://www.example.com/subscription_info.html


  230. Alias /error/ "/var/www/error/"

  231. <IfModule mod_negotiation.c>
  232. <IfModule mod_include.c>
  233.     <Directory "/var/www/error">
  234.         AllowOverride None
  235.         Options IncludesNoExec
  236.         AddOutputFilter Includes html
  237.         AddHandler type-map var
  238.         Order allow,deny
  239.         Allow from all
  240.         LanguagePriority en es de fr
  241.         ForceLanguagePriority Prefer Fallback
  242.     </Directory>

  243. #    ErrorDocument 400 /error/HTTP_BAD_REQUEST.html.var
  244. #    ErrorDocument 401 /error/HTTP_UNAUTHORIZED.html.var
  245. #    ErrorDocument 403 /error/HTTP_FORBIDDEN.html.var
  246. #    ErrorDocument 404 /error/HTTP_NOT_FOUND.html.var
  247. #    ErrorDocument 405 /error/HTTP_METHOD_NOT_ALLOWED.html.var
  248. #    ErrorDocument 408 /error/HTTP_REQUEST_TIME_OUT.html.var
  249. #    ErrorDocument 410 /error/HTTP_GONE.html.var
  250. #    ErrorDocument 411 /error/HTTP_LENGTH_REQUIRED.html.var
  251. #    ErrorDocument 412 /error/HTTP_PRECONDITION_FAILED.html.var
  252. #    ErrorDocument 413 /error/HTTP_REQUEST_ENTITY_TOO_LARGE.html.var
  253. #    ErrorDocument 414 /error/HTTP_REQUEST_URI_TOO_LARGE.html.var
  254. #    ErrorDocument 415 /error/HTTP_UNSUPPORTED_MEDIA_TYPE.html.var
  255. #    ErrorDocument 500 /error/HTTP_INTERNAL_SERVER_ERROR.html.var
  256. #    ErrorDocument 501 /error/HTTP_NOT_IMPLEMENTED.html.var
  257. #    ErrorDocument 502 /error/HTTP_BAD_GATEWAY.html.var
  258. #    ErrorDocument 503 /error/HTTP_SERVICE_UNAVAILABLE.html.var
  259. #    ErrorDocument 506 /error/HTTP_VARIANT_ALSO_VARIES.html.var

  260. </IfModule>
  261. </IfModule>

  262. BrowserMatch "Mozilla/2" nokeepalive
  263. BrowserMatch "MSIE 4\.0b2;" nokeepalive downgrade-1.0 force-response-1.0
  264. BrowserMatch "RealPlayer 4\.0" force-response-1.0
  265. BrowserMatch "Java/1\.0" force-response-1.0
  266. BrowserMatch "JDK/1\.0" force-response-1.0

  267. BrowserMatch "Microsoft Data Access Internet Publishing Provider" redirect-carefully
  268. BrowserMatch "MS FrontPage" redirect-carefully
  269. BrowserMatch "^WebDrive" redirect-carefully
  270. BrowserMatch "^WebDAVFS/1.[0123]" redirect-carefully
  271. BrowserMatch "^gnome-vfs/1.0" redirect-carefully
  272. BrowserMatch "^XML Spy" redirect-carefully
  273. BrowserMatch "^Dreamweaver-WebDAV-SCM1" redirect-carefully

  274. #<Location /server-status>
  275. #    SetHandler server-status
  276. #    Order deny,allow
  277. #    Deny from all
  278. #    Allow from .example.com
  279. #</Location>

  280. #<Location /server-info>
  281. #    SetHandler server-info
  282. #    Order deny,allow
  283. #    Deny from all
  284. #    Allow from .example.com
  285. #</Location>

  286. #<IfModule mod_proxy.c>
  287. #ProxyRequests On
  288. #
  289. #<Proxy *>
  290. #    Order deny,allow
  291. #    Deny from all
  292. #    Allow from .example.com
  293. #</Proxy>

  294. #ProxyVia On

  295. #<IfModule mod_disk_cache.c>
  296. #   CacheEnable disk /
  297. #   CacheRoot "/var/cache/mod_proxy"
  298. #</IfModule>
  299. #

  300. #</IfModule>



  301. #<VirtualHost *:80>
  302. #    ServerAdmin webmaster@dummy-host.example.com
  303. #    DocumentRoot /www/docs/dummy-host.example.com
  304. #    ServerName dummy-host.example.com
  305. #    ErrorLog logs/dummy-host.example.com-error_log
  306. #    CustomLog logs/dummy-host.example.com-access_log common
  307. #</VirtualHost>
  308. [root@LinServer ~]#
复制代码



论坛徽章:
223
2022北京冬奥会纪念版徽章
日期:2015-08-10 16:30:32操作系统版块每日发帖之星
日期:2016-05-10 19:22:58操作系统版块每日发帖之星
日期:2016-02-18 06:20:00操作系统版块每日发帖之星
日期:2016-03-01 06:20:00操作系统版块每日发帖之星
日期:2016-03-02 06:20:0015-16赛季CBA联赛之上海
日期:2019-09-20 12:29:3219周年集字徽章-周
日期:2019-10-01 20:47:4815-16赛季CBA联赛之八一
日期:2020-10-23 18:30:5320周年集字徽章-20	
日期:2020-10-28 14:14:2615-16赛季CBA联赛之广夏
日期:2023-02-25 16:26:26CU十四周年纪念徽章
日期:2023-04-13 12:23:10操作系统版块每日发帖之星
日期:2016-05-10 19:22:58
2 [报告]
发表于 2017-01-12 16:03 |只看该作者
apache配置挺简单的,你怎么多配置啊

论坛徽章:
1
2015年辞旧岁徽章
日期:2015-03-03 16:54:15
3 [报告]
发表于 2017-01-18 14:07 |只看该作者
<Directory 目录的绝对路径(硬盘上的)>
  Options Indexes FollowSymLinks
</Directory>
这样试试,

论坛徽章:
2
技术图书徽章
日期:2013-12-20 07:35:03技术图书徽章
日期:2014-12-16 12:59:42
4 [报告]
发表于 2017-01-20 11:18 |只看该作者
/opt/ftp/webwww这个目录的权限先设置成777试一下 还有里面的文件都设置成777

论坛徽章:
0
5 [报告]
发表于 2017-01-23 10:14 |只看该作者
用getenforce看看是否开启了selinux,开了的话建议setenforce 0关掉
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

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

清除 Cookies - ChinaUnix - Archiver - WAP - TOP