免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
楼主: jianglin-

[网络管理] sarg报错403 [复制链接]

论坛徽章:
0
发表于 2012-04-30 12:59 |显示全部楼层
setenforce 0应该就可以访问了,但是这样就没有selinux来控制整个系统了

论坛徽章:
0
发表于 2012-04-30 13:04 |显示全部楼层
jianglin- 发表于 2012-04-30 12:55
回复 19# anonymous0502


你贴的结果显示是selinux控制了的原因,简单点的就是执行setenforce 0

或者用chcon命令来修改你要访问的文件的selinux相关权限

论坛徽章:
0
发表于 2012-04-30 13:18 |显示全部楼层
回复 22# anonymous0502


    执行了setenforce 0
没效果..我是菜鸟.. 谢谢你..

论坛徽章:
0
发表于 2012-04-30 13:26 |显示全部楼层
本帖最后由 anonymous0502 于 2012-04-30 13:27 编辑
jianglin- 发表于 2012-04-30 13:18
回复 22# anonymous0502


我在虚拟机上试了这两种情况会有这个提示,其他还有什么情况我也不太清楚了。

如果你不是在公司服务器上操作的,只是自己做练习的,你可以备份一下httpd.conf文件,用我的虚拟机上的默认设置试试看行不行:
  1. [root@co601 ~]# grep -v -E '(^\s*#|^\s*$)' /etc/httpd/conf/httpd.conf
  2. ServerTokens OS
  3. ServerRoot "/etc/httpd"
  4. PidFile run/httpd.pid
  5. Timeout 60
  6. KeepAlive Off
  7. MaxKeepAliveRequests 100
  8. KeepAliveTimeout 15
  9. <IfModule prefork.c>
  10. StartServers       8
  11. MinSpareServers    5
  12. MaxSpareServers   20
  13. ServerLimit      256
  14. MaxClients       256
  15. MaxRequestsPerChild  4000
  16. </IfModule>
  17. <IfModule worker.c>
  18. StartServers         4
  19. MaxClients         300
  20. MinSpareThreads     25
  21. MaxSpareThreads     75
  22. ThreadsPerChild     25
  23. MaxRequestsPerChild  0
  24. </IfModule>
  25. Listen 80
  26. LoadModule auth_basic_module modules/mod_auth_basic.so
  27. LoadModule auth_digest_module modules/mod_auth_digest.so
  28. LoadModule authn_file_module modules/mod_authn_file.so
  29. LoadModule authn_alias_module modules/mod_authn_alias.so
  30. LoadModule authn_anon_module modules/mod_authn_anon.so
  31. LoadModule authn_dbm_module modules/mod_authn_dbm.so
  32. LoadModule authn_default_module modules/mod_authn_default.so
  33. LoadModule authz_host_module modules/mod_authz_host.so
  34. LoadModule authz_user_module modules/mod_authz_user.so
  35. LoadModule authz_owner_module modules/mod_authz_owner.so
  36. LoadModule authz_groupfile_module modules/mod_authz_groupfile.so
  37. LoadModule authz_dbm_module modules/mod_authz_dbm.so
  38. LoadModule authz_default_module modules/mod_authz_default.so
  39. LoadModule ldap_module modules/mod_ldap.so
  40. LoadModule authnz_ldap_module modules/mod_authnz_ldap.so
  41. LoadModule include_module modules/mod_include.so
  42. LoadModule log_config_module modules/mod_log_config.so
  43. LoadModule logio_module modules/mod_logio.so
  44. LoadModule env_module modules/mod_env.so
  45. LoadModule ext_filter_module modules/mod_ext_filter.so
  46. LoadModule mime_magic_module modules/mod_mime_magic.so
  47. LoadModule expires_module modules/mod_expires.so
  48. LoadModule deflate_module modules/mod_deflate.so
  49. LoadModule headers_module modules/mod_headers.so
  50. LoadModule usertrack_module modules/mod_usertrack.so
  51. LoadModule setenvif_module modules/mod_setenvif.so
  52. LoadModule mime_module modules/mod_mime.so
  53. LoadModule dav_module modules/mod_dav.so
  54. LoadModule status_module modules/mod_status.so
  55. LoadModule autoindex_module modules/mod_autoindex.so
  56. LoadModule info_module modules/mod_info.so
  57. LoadModule dav_fs_module modules/mod_dav_fs.so
  58. LoadModule vhost_alias_module modules/mod_vhost_alias.so
  59. LoadModule negotiation_module modules/mod_negotiation.so
  60. LoadModule dir_module modules/mod_dir.so
  61. LoadModule actions_module modules/mod_actions.so
  62. LoadModule speling_module modules/mod_speling.so
  63. LoadModule userdir_module modules/mod_userdir.so
  64. LoadModule alias_module modules/mod_alias.so
  65. LoadModule substitute_module modules/mod_substitute.so
  66. LoadModule rewrite_module modules/mod_rewrite.so
  67. LoadModule proxy_module modules/mod_proxy.so
  68. LoadModule proxy_balancer_module modules/mod_proxy_balancer.so
  69. LoadModule proxy_ftp_module modules/mod_proxy_ftp.so
  70. LoadModule proxy_http_module modules/mod_proxy_http.so
  71. LoadModule proxy_ajp_module modules/mod_proxy_ajp.so
  72. LoadModule proxy_connect_module modules/mod_proxy_connect.so
  73. LoadModule cache_module modules/mod_cache.so
  74. LoadModule suexec_module modules/mod_suexec.so
  75. LoadModule disk_cache_module modules/mod_disk_cache.so
  76. LoadModule cgi_module modules/mod_cgi.so
  77. LoadModule version_module modules/mod_version.so
  78. Include conf.d/*.conf
  79. User apache
  80. Group apache
  81. ServerAdmin root@localhost
  82. UseCanonicalName Off
  83. DocumentRoot "/var/www/html"
  84. <Directory />
  85.     Options FollowSymLinks
  86.     AllowOverride None
  87. </Directory>
  88. <Directory "/var/www/html">
  89.     Options Indexes FollowSymLinks
  90.     AllowOverride None
  91.     Order allow,deny
  92.     Allow from all
  93. </Directory>
  94. <IfModule mod_userdir.c>
  95.     UserDir disabled
  96. </IfModule>
  97. DirectoryIndex index.html index.html.var
  98. AccessFileName .htaccess
  99. <Files ~ "^\.ht">
  100.     Order allow,deny
  101.     Deny from all
  102.     Satisfy All
  103. </Files>
  104. TypesConfig /etc/mime.types
  105. DefaultType text/plain
  106. <IfModule mod_mime_magic.c>
  107.     MIMEMagicFile conf/magic
  108. </IfModule>
  109. HostnameLookups Off
  110. ErrorLog logs/error_log
  111. LogLevel warn
  112. LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined
  113. LogFormat "%h %l %u %t \"%r\" %>s %b" common
  114. LogFormat "%{Referer}i -> %U" referer
  115. LogFormat "%{User-agent}i" agent
  116. CustomLog logs/access_log combined
  117. ServerSignature On
  118. Alias /icons/ "/var/www/icons/"
  119. <Directory "/var/www/icons">
  120.     Options Indexes MultiViews FollowSymLinks
  121.     AllowOverride None
  122.     Order allow,deny
  123.     Allow from all
  124. </Directory>
  125. <IfModule mod_dav_fs.c>
  126.     DAVLockDB /var/lib/dav/lockdb
  127. </IfModule>
  128. ScriptAlias /cgi-bin/ "/var/www/cgi-bin/"
  129. <Directory "/var/www/cgi-bin">
  130.     AllowOverride None
  131.     Options None
  132.     Order allow,deny
  133.     Allow from all
  134. </Directory>
  135. IndexOptions FancyIndexing VersionSort NameWidth=* HTMLTable Charset=UTF-8
  136. AddIconByEncoding (CMP,/icons/compressed.gif) x-compress x-gzip
  137. AddIconByType (TXT,/icons/text.gif) text/*
  138. AddIconByType (IMG,/icons/image2.gif) image/*
  139. AddIconByType (SND,/icons/sound2.gif) audio/*
  140. AddIconByType (VID,/icons/movie.gif) video/*
  141. AddIcon /icons/binary.gif .bin .exe
  142. AddIcon /icons/binhex.gif .hqx
  143. AddIcon /icons/tar.gif .tar
  144. AddIcon /icons/world2.gif .wrl .wrl.gz .vrml .vrm .iv
  145. AddIcon /icons/compressed.gif .Z .z .tgz .gz .zip
  146. AddIcon /icons/a.gif .ps .ai .eps
  147. AddIcon /icons/layout.gif .html .shtml .htm .pdf
  148. AddIcon /icons/text.gif .txt
  149. AddIcon /icons/c.gif .c
  150. AddIcon /icons/p.gif .pl .py
  151. AddIcon /icons/f.gif .for
  152. AddIcon /icons/dvi.gif .dvi
  153. AddIcon /icons/uuencoded.gif .uu
  154. AddIcon /icons/script.gif .conf .sh .shar .csh .ksh .tcl
  155. AddIcon /icons/tex.gif .tex
  156. AddIcon /icons/bomb.gif core
  157. AddIcon /icons/back.gif ..
  158. AddIcon /icons/hand.right.gif README
  159. AddIcon /icons/folder.gif ^^DIRECTORY^^
  160. AddIcon /icons/blank.gif ^^BLANKICON^^
  161. DefaultIcon /icons/unknown.gif
  162. ReadmeName README.html
  163. HeaderName HEADER.html
  164. IndexIgnore .??* *~ *# HEADER* README* RCS CVS *,v *,t
  165. AddLanguage ca .ca
  166. AddLanguage cs .cz .cs
  167. AddLanguage da .dk
  168. AddLanguage de .de
  169. AddLanguage el .el
  170. AddLanguage en .en
  171. AddLanguage eo .eo
  172. AddLanguage es .es
  173. AddLanguage et .et
  174. AddLanguage fr .fr
  175. AddLanguage he .he
  176. AddLanguage hr .hr
  177. AddLanguage it .it
  178. AddLanguage ja .ja
  179. AddLanguage ko .ko
  180. AddLanguage ltz .ltz
  181. AddLanguage nl .nl
  182. AddLanguage nn .nn
  183. AddLanguage no .no
  184. AddLanguage pl .po
  185. AddLanguage pt .pt
  186. AddLanguage pt-BR .pt-br
  187. AddLanguage ru .ru
  188. AddLanguage sv .sv
  189. AddLanguage zh-CN .zh-cn
  190. AddLanguage zh-TW .zh-tw
  191. 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
  192. ForceLanguagePriority Prefer Fallback
  193. AddDefaultCharset UTF-8
  194. AddType application/x-compress .Z
  195. AddType application/x-gzip .gz .tgz
  196. AddType application/x-x509-ca-cert .crt
  197. AddType application/x-pkcs7-crl    .crl
  198. AddHandler type-map var
  199. AddType text/html .shtml
  200. AddOutputFilter INCLUDES .shtml
  201. Alias /error/ "/var/www/error/"
  202. <IfModule mod_negotiation.c>
  203. <IfModule mod_include.c>
  204.     <Directory "/var/www/error">
  205.         AllowOverride None
  206.         Options IncludesNoExec
  207.         AddOutputFilter Includes html
  208.         AddHandler type-map var
  209.         Order allow,deny
  210.         Allow from all
  211.         LanguagePriority en es de fr
  212.         ForceLanguagePriority Prefer Fallback
  213.     </Directory>
  214. </IfModule>
  215. </IfModule>
  216. BrowserMatch "Mozilla/2" nokeepalive
  217. BrowserMatch "MSIE 4\.0b2;" nokeepalive downgrade-1.0 force-response-1.0
  218. BrowserMatch "RealPlayer 4\.0" force-response-1.0
  219. BrowserMatch "Java/1\.0" force-response-1.0
  220. BrowserMatch "JDK/1\.0" force-response-1.0
  221. BrowserMatch "Microsoft Data Access Internet Publishing Provider" redirect-carefully
  222. BrowserMatch "MS FrontPage" redirect-carefully
  223. BrowserMatch "^WebDrive" redirect-carefully
  224. BrowserMatch "^WebDAVFS/1.[0123]" redirect-carefully
  225. BrowserMatch "^gnome-vfs/1.0" redirect-carefully
  226. BrowserMatch "^XML Spy" redirect-carefully
  227. BrowserMatch "^Dreamweaver-WebDAV-SCM1" redirect-carefully
复制代码

论坛徽章:
0
发表于 2012-04-30 13:28 |显示全部楼层
本帖最后由 jianglin- 于 2012-04-30 13:32 编辑

回复 24# anonymous0502


    我是虚拟机测试的...我试试,把你的写到里面看看..


是了..没差..我的也是默认配置..

论坛徽章:
0
发表于 2012-04-30 13:29 |显示全部楼层
  1. [root@co601 ~]# ls -lh /var/www/html/
  2. total 8.0K
  3. drwxr-xr-x. 2 root root 4.0K Apr 30 13:06 sarg
  4. drwxr--r--. 3 root root 4.0K Apr 30 10:06 sarg-php
  5. [root@co601 ~]# ls -lh /var/www/html/sarg
  6. total 4.0K
  7. -rw-r--r--. 1 root root 14 Apr 30 13:06 squid.html
  8. [root@co601 ~]# cat /var/www/html/sarg/squid.html
  9. hello squid.

  10. [root@co601 ~]# service httpd start
  11. Starting httpd:                                            [  OK  ]
  12. [root@co601 ~]# setenforce 0
  13. [root@co601 ~]# getenforce
  14. Permissive
复制代码

论坛徽章:
0
发表于 2012-04-30 13:31 |显示全部楼层


如果这个文件能访问,那访问你的sarg目录下其他文件应该也没问题啊

论坛徽章:
0
发表于 2012-04-30 13:42 |显示全部楼层
回复 26# anonymous0502


   
[root@mail html]# ls -lh /var/www/html/
总用量 20K
-rw-r--r--. 1 root root 1.3K  4月 30 18:49 index.html
-rw-r--r--. 1 root root   73  4月 30 18:40 jianglin.txt
drwxr-xr-x. 2 root root 4.0K  4月 30 18:57 mrtg
drwxr-xr-x. 6 root root 4.0K  4月 30 18:52 sarg
-rw-r--r--. 1 root root 2.4K  4月 30 18:49 sarg.css
[root@mail html]# ls -lh /var/www/html/sarg
总用量 24K
drwxr-xr-x. 4 root root 4.0K  4月 30 18:52 daily
-rw-r--r--. 1 root root 1.3K  4月 30 18:52 index.html
drwxr-xr-x. 2 root root 4.0K  4月 30 18:52 monthly
drwxr-xr-x. 6 root root 4.0K  4月 30 18:52 ONE-SHOT
-rw-r--r--. 1 root root 2.4K  4月 30 18:52 sarg.css
drwxr-xr-x. 4 root root 4.0K  4月 30 18:52 weekly
cat /var/www/html/sarg/index.html
我目录里面没squid.html,有这里显示很多..

[root@mail html]# getenforce
Permissive

论坛徽章:
0
发表于 2012-04-30 13:44 |显示全部楼层
我那个文件是自己建的,只是随便写了两个单词:
hello squid.

那现在像你在1楼贴的那样访问一下看看,应该可以了吧

论坛徽章:
0
发表于 2012-04-30 13:56 |显示全部楼层
回复 29# anonymous0502


    [root@mail sarg]# ls -l
总用量 28
drwxr-xr-x. 4 root root 4096  4月 30 18:52 daily
-rw-r--r--. 1 root root   73  4月 30 21:52 hello.html
-rw-r--r--. 1 root root 1305  4月 30 18:52 index.html
drwxr-xr-x. 2 root root 4096  4月 30 18:52 monthly
drwxr-xr-x. 6 root root 4096  4月 30 18:52 ONE-SHOT
-rw-r--r--. 1 root root 2398  4月 30 18:52 sarg.csshello.html
drwxr-xr-x. 4 root root 4096  4月 30 18:52 weekly
我照你说的,新建了一个hello.html放在Sarg下面,http:\\192.168.8.3,有显示..http:\\192.168.8.3\Sarg\hello.html
就是 的撒旦撒.png
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

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

清除 Cookies - ChinaUnix - Archiver - WAP - TOP