banner

[Rule] Rules  [Home] Main Forum  [Portal] Portal  
[Members] Member Listing  [Statistics] Statistics  [Search] Search  [Reading Room] Reading Room 
[Register] Register  
[Login] Loginhttp  | https  ]
 
Forum Index Thảo luận hệ điều hành *nix Lỗi Forbidden You don't have permission to access / on this server  XML
  [Question]   Lỗi Forbidden You don't have permission to access / on this server 26/03/2009 01:12:59 (+0700) | #1 | 174681
[Avatar]
viethungs
Member

[Minus]    0    [Plus]
Joined: 05/07/2006 17:04:03
Messages: 91
Offline
[Profile] [PM] [WWW]
Em đang cài server centos 5.2 và dùng HC7 để quản trị nó.

Nhưng chả nhớ em đã nghịch gì mà tất cả các website em đã add, cả website add mới nữa đều bị gặp lỗi khi try cập vào domain của site đó:

Code:
Forbidden

You don't have permission to access / on this server.


Em đã search trên google, và sửa Allow from all trong file httpd.conf nhưng lỗi vẫn vậy

Em là new bie của linux, xin các anh hướng dẫn khắc phục vấn đề trên với ạ.

Em cảm ơn!

[Up] [Print Copy]
  [Question]   Re: Lỗi Forbidden You don't have permission to access / on this server 26/03/2009 03:47:58 (+0700) | #2 | 174713
[Avatar]
viethungs
Member

[Minus]    0    [Plus]
Joined: 05/07/2006 17:04:03
Messages: 91
Offline
[Profile] [PM] [WWW]
up up, không ai giúp em sao ?
[Up] [Print Copy]
  [Question]   Re: Lỗi Forbidden You don't have permission to access / on this server 26/03/2009 04:01:45 (+0700) | #3 | 174714
[Avatar]
quanta
Moderator

Joined: 28/07/2006 14:44:21
Messages: 7265
Location: $ locate `whoami`
Offline
[Profile] [PM]
Cũng trong httpd.conf, tìm dòng bắt đầu bằng ErrorLog để xem thông tin log được lưu ở đâu. Tìm đến chỗ tương ứng, post nội dung của mấy dòng cuối (liên quan đến cái lỗi trên) lên đây.
Let's build on a great foundation!
[Up] [Print Copy]
  [Question]   Re: Lỗi Forbidden You don't have permission to access / on this server 26/03/2009 04:45:49 (+0700) | #4 | 174716
[Avatar]
viethungs
Member

[Minus]    0    [Plus]
Joined: 05/07/2006 17:04:03
Messages: 91
Offline
[Profile] [PM] [WWW]
ah quên mất.

log của nó ghi là

Code:
[error] [client ::1] Directory index forbidden by Options directive: /var/www/html/


Help me
[Up] [Print Copy]
  [Question]   Re: Lỗi Forbidden You don't have permission to access / on this server 26/03/2009 04:57:19 (+0700) | #5 | 174717
[Avatar]
quanta
Moderator

Joined: 28/07/2006 14:44:21
Messages: 7265
Location: $ locate `whoami`
Offline
[Profile] [PM]
- Bạn đưa nội dùng file httpd.conf lên đây
- Thử thảy một file index.html vào /var/www/html chưa?
Let's build on a great foundation!
[Up] [Print Copy]
  [Question]   Re: Lỗi Forbidden You don't have permission to access / on this server 26/03/2009 05:41:11 (+0700) | #6 | 174727
[Avatar]
viethungs
Member

[Minus]    0    [Plus]
Joined: 05/07/2006 17:04:03
Messages: 91
Offline
[Profile] [PM] [WWW]


dạ đây là nội dung httpd.conf ạ.

Em chạy tử các file index.html, index.php rồi asp rồi v..v.. vẫn chỉ thấy Forbidden

Code:
ServerTokens OS
ServerRoot "/etc/httpd"
PidFile run/httpd.pid
Timeout 120
KeepAlive Off
MaxKeepAliveRequests 100
KeepAliveTimeout 15
<IfModule prefork.c>
StartServers       8
MinSpareServers    5
MaxSpareServers   20
ServerLimit      256
MaxClients       256
MaxRequestsPerChild  4000
</IfModule>
<IfModule worker.c>
StartServers         2
MaxClients         150
MinSpareThreads     25
MaxSpareThreads     75 
ThreadsPerChild     25
MaxRequestsPerChild  0
</IfModule>
Listen 80
LoadModule auth_basic_module modules/mod_auth_basic.so
LoadModule auth_digest_module modules/mod_auth_digest.so
LoadModule authn_file_module modules/mod_authn_file.so
LoadModule authn_alias_module modules/mod_authn_alias.so
LoadModule authn_anon_module modules/mod_authn_anon.so
LoadModule authn_dbm_module modules/mod_authn_dbm.so
LoadModule authn_default_module modules/mod_authn_default.so
LoadModule authz_host_module modules/mod_authz_host.so
LoadModule authz_user_module modules/mod_authz_user.so
LoadModule authz_owner_module modules/mod_authz_owner.so
LoadModule authz_groupfile_module modules/mod_authz_groupfile.so
LoadModule authz_dbm_module modules/mod_authz_dbm.so
LoadModule authz_default_module modules/mod_authz_default.so
LoadModule ldap_module modules/mod_ldap.so
LoadModule authnz_ldap_module modules/mod_authnz_ldap.so
LoadModule include_module modules/mod_include.so
LoadModule log_config_module modules/mod_log_config.so
LoadModule logio_module modules/mod_logio.so
LoadModule env_module modules/mod_env.so
LoadModule ext_filter_module modules/mod_ext_filter.so
LoadModule mime_magic_module modules/mod_mime_magic.so
LoadModule expires_module modules/mod_expires.so
LoadModule deflate_module modules/mod_deflate.so
LoadModule headers_module modules/mod_headers.so
LoadModule usertrack_module modules/mod_usertrack.so
LoadModule setenvif_module modules/mod_setenvif.so
LoadModule mime_module modules/mod_mime.so
LoadModule dav_module modules/mod_dav.so
LoadModule status_module modules/mod_status.so
LoadModule autoindex_module modules/mod_autoindex.so
LoadModule info_module modules/mod_info.so
LoadModule dav_fs_module modules/mod_dav_fs.so
LoadModule vhost_alias_module modules/mod_vhost_alias.so
LoadModule negotiation_module modules/mod_negotiation.so
LoadModule dir_module modules/mod_dir.so
LoadModule actions_module modules/mod_actions.so
LoadModule speling_module modules/mod_speling.so
LoadModule userdir_module modules/mod_userdir.so
LoadModule alias_module modules/mod_alias.so
LoadModule rewrite_module modules/mod_rewrite.so
LoadModule proxy_module modules/mod_proxy.so
LoadModule proxy_balancer_module modules/mod_proxy_balancer.so
LoadModule proxy_ftp_module modules/mod_proxy_ftp.so
LoadModule proxy_http_module modules/mod_proxy_http.so
LoadModule proxy_connect_module modules/mod_proxy_connect.so
LoadModule cache_module modules/mod_cache.so
LoadModule suexec_module modules/mod_suexec.so
LoadModule disk_cache_module modules/mod_disk_cache.so
LoadModule file_cache_module modules/mod_file_cache.so
LoadModule mem_cache_module modules/mod_mem_cache.so
LoadModule cgi_module modules/mod_cgi.so
LoadModule version_module modules/mod_version.so
Include conf.d/*.conf
User apache
Group apache
ServerAdmin root@localhost
UseCanonicalName Off
DocumentRoot "/var/www/html"
<Directory />
    Options +Indexes FollowSymLinks
    AllowOverride None
    Allow from all
</Directory>
<Directory "/var/www/html">
    Options +Indexes FollowSymLinks
    AllowOverride None
    Order allow,deny
    Allow from all
</Directory>
<IfModule mod_userdir.c>
    #
    # UserDir is disabled by default since it can confirm the presence
    # of a username on the system (depending on home directory
    # permissions).
    #
    UserDir disable
    #
    # To enable requests to /~user/ to serve the user's public_html
    # directory, remove the "UserDir disable" line above, and uncomment
    # the following line instead:
    # 
    #UserDir public_html
</IfModule>
DirectoryIndex index.html index.html.var
AccessFileName .htaccess
<Files ~ "^\.ht">
    Order allow,deny
    Allow from all
</Files>
TypesConfig /etc/mime.types
DefaultType text/plain
<IfModule mod_mime_magic.c>
    MIMEMagicFile conf/magic
</IfModule>
HostnameLookups Off
ErrorLog logs/error_log
LogLevel warn
LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined
LogFormat "%h %l %u %t \"%r\" %>s %b" common
LogFormat "%{Referer}i -> %U" referer
LogFormat "%{User-agent}i" agent
CustomLog logs/access_log combined
ServerSignature On
Alias /icons/ "/var/www/icons/"
<Directory "/var/www/icons">
    Options +Indexes MultiViews
    AllowOverride None
    Order allow,deny
    Allow from all
</Directory>
<IfModule mod_dav_fs.c>
    # Location of the WebDAV lock database.
    DAVLockDB /var/lib/dav/lockdb
</IfModule>
ScriptAlias /cgi-bin/ "/var/www/cgi-bin/"
<Directory "/var/www/cgi-bin">
    AllowOverride None
    Options None
    Order allow,deny
    Allow from all
</Directory>
AddIconByEncoding (CMP,/icons/compressed.gif) x-compress x-gzip
AddIconByType (TXT,/icons/text.gif) text/*
AddIconByType (IMG,/icons/image2.gif) image/*
AddIconByType (SND,/icons/sound2.gif) audio/*
AddIconByType (VID,/icons/movie.gif) video/*
AddIcon /icons/binary.gif .bin .exe
AddIcon /icons/binhex.gif .hqx
AddIcon /icons/tar.gif .tar
AddIcon /icons/world2.gif .wrl .wrl.gz .vrml .vrm .iv
AddIcon /icons/compressed.gif .Z .z .tgz .gz .zip
AddIcon /icons/a.gif .ps .ai .eps
AddIcon /icons/layout.gif .html .shtml .htm .pdf
AddIcon /icons/text.gif .txt
AddIcon /icons/c.gif .c
AddIcon /icons/p.gif .pl .py
AddIcon /icons/f.gif .for
AddIcon /icons/dvi.gif .dvi
AddIcon /icons/uuencoded.gif .uu
AddIcon /icons/script.gif .conf .sh .shar .csh .ksh .tcl
AddIcon /icons/tex.gif .tex
AddIcon /icons/bomb.gif core
AddIcon /icons/back.gif ..
AddIcon /icons/hand.right.gif README
AddIcon /icons/folder.gif ^^DIRECTORY^^
AddIcon /icons/blank.gif ^^BLANKICON^^
DefaultIcon /icons/unknown.gif
ReadmeName README.html
HeaderName HEADER.html
IndexIgnore .??* *~ *# HEADER* README* RCS CVS *,v *,t
AddLanguage ca .ca
AddLanguage cs .cz .cs
AddLanguage da .dk
AddLanguage de .de
AddLanguage el .el
AddLanguage en .en
AddLanguage eo .eo
AddLanguage es .es
AddLanguage et .et
AddLanguage fr .fr
AddLanguage he .he
AddLanguage hr .hr
AddLanguage it .it
AddLanguage ja .ja
AddLanguage ko .ko
AddLanguage ltz .ltz
AddLanguage nl .nl
AddLanguage nn .nn
AddLanguage no .no
AddLanguage pl .po
AddLanguage pt .pt
AddLanguage pt-BR .pt-br
AddLanguage ru .ru
AddLanguage sv .sv
AddLanguage zh-CN .zh-cn
AddLanguage zh-TW .zh-tw
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
ForceLanguagePriority Prefer Fallback
AddDefaultCharset UTF-8
AddType application/x-compress .Z
AddType application/x-gzip .gz .tgz
AddHandler type-map var
AddType text/html .shtml
AddOutputFilter INCLUDES .shtml
Alias /error/ "/var/www/error/"
<IfModule mod_negotiation.c>
<IfModule mod_include.c>
    <Directory "/var/www/error">
        AllowOverride None
        Options IncludesNoExec
        AddOutputFilter Includes html
        AddHandler type-map var
        Order allow,deny
        Allow from all
        LanguagePriority en es de fr
        ForceLanguagePriority Prefer Fallback
    </Directory>
</IfModule>
</IfModule>
BrowserMatch "Mozilla/2" nokeepalive
BrowserMatch "MSIE 4\.0b2;" nokeepalive downgrade-1.0 force-response-1.0
BrowserMatch "RealPlayer 4\.0" force-response-1.0
BrowserMatch "Java/1\.0" force-response-1.0
BrowserMatch "JDK/1\.0" force-response-1.0
BrowserMatch "Microsoft Data Access Internet Publishing Provider" wwwect-carefully
BrowserMatch "MS FrontPage" wwwect-carefully
BrowserMatch "^WebDrive" wwwect-carefully
BrowserMatch "^WebDAVFS/1.[0123]" wwwect-carefully
BrowserMatch "^gnome-vfs/1.0" wwwect-carefully
BrowserMatch "^XML Spy" wwwect-carefully
BrowserMatch "^Dreamweaver-WebDAV-SCM1" wwwect-carefully
NameVirtualHost 210.245.80.37
<VirtualHost 210.245.80.37>
	ServerName check.homeftp.net
	ServerAdmin <a href="mailto:viethungs@check.homeftp.net">viethungs@check.homeftp.net</a>
	DocumentRoot "/hostings/salelinux/viethungs/check.homeftp.net/www/html"
	ServerAlias www.check.homeftp.net
ErrorLog /hostings/salelinux/viethungs/check.homeftp.net/log/httpd/error_log
CustomLog /hostings/salelinux/viethungs/check.homeftp.net/log/httpd/access_log "common"
	<Directory "/hostings/salelinux/viethungs/check.homeftp.net">
		AllowOverride AuthConfig
	</Directory>
	<Directory "/hostings/salelinux/viethungs/check.homeftp.net/www">
    Allow from all
	</Directory>
	<Directory "/hostings/salelinux/viethungs/check.homeftp.net/www/html">
		AddHandler cgi-script cgi pl
		Order Allow,Deny
		Allow from All
		Options +Indexes
                Allow from all
	</Directory>
	<Directory "/hostings/salelinux/viethungs/check.homeftp.net/www/cgi-bin/">
		AddHandler cgi-script cgi pl
Options Indexes FollowSymLinks MultiViews
		Order Allow,Deny
		Allow from "All"
		Options +ExecCGI
	</Directory>
	ScriptAlias /cgi-bin/ "/hostings/salelinux/viethungs/check.homeftp.net/www/cgi-bin/"
	Alias /webmail "/hostings/salelinux/viethungs/check.homeftp.net/special/squirrelmail"
	Alias /MySQLAdmin "/hostings/salelinux/viethungs/check.homeftp.net/special/phpMyAdmin"
	<Directory "/hostings/salelinux/viethungs/check.homeftp.net/special/phpMyAdmin">
		Options +Indexes FollowSymLinks MultiViews ExecCGI
		AllowOverride All
		Order allow,deny
		Allow from all
	</Directory>
	DirectoryIndex default.html default.htm default.asp default.aspx index.htm index.html index.cfm index.asp index.aspx index.php
	Include /usr/local/awstats/tools/httpd_conf
	Include conf.d/php.conf.hc
	Redirect "/admin" "http://210.245.80.38:8787"
LogLevel emerg
</VirtualHost>


[Up] [Print Copy]
  [Question]   Re: Lỗi Forbidden You don't have permission to access / on this server 26/03/2009 06:24:42 (+0700) | #7 | 174733
[Avatar]
quanta
Moderator

Joined: 28/07/2006 14:44:21
Messages: 7265
Location: $ locate `whoami`
Offline
[Profile] [PM]

viethungs wrote:
Em chạy thử các file index.html, index.php rồi asp rồi v..v.. vẫn chỉ thấy Forbidden  

Có cả ASP ở đây à?

viethungs wrote:
Code:
AccessFileName .htaccess
 

File .htaccess bạn để ở đâu? Nội dung thế nào?

Thử:
ls -la /var/www/html



Let's build on a great foundation!
[Up] [Print Copy]
  [Question]   Re: Lỗi Forbidden You don't have permission to access / on this server 26/03/2009 10:13:44 (+0700) | #8 | 174759
centos
Member

[Minus]    0    [Plus]
Joined: 28/03/2008 17:13:12
Messages: 219
Offline
[Profile] [PM]
1. trong file http.conf là như vậy
"/hostings/salelinux/viethungs/check.homeftp.net/www/html"

 


2. Log ra như vậy


[error] [client ::1] Directory index forbidden by Options directive: /var/www/html/
 


là sao không hiểu? Vậy thư mục root của httpd là thằng nào, log đó của thằng nào đưa ra. mình thấy nó hơi vô lý một tý bạn truy cập tên bằng tên miền nào để sử dụng dich vụ web
[Up] [Print Copy]
  [Question]   Re: Lỗi Forbidden You don't have permission to access / on this server 26/03/2009 11:27:33 (+0700) | #9 | 174768
[Avatar]
F10
Member

[Minus]    0    [Plus]
Joined: 01/12/2008 23:38:12
Messages: 89
Offline
[Profile] [PM]
Theo mình nghĩ chẳng có vấn đề gì với file conf của httpd đâu ! Theo như bạn nói thì mình thấy nó có vấn đề từ chỗ này
Nhưng chả nhớ em đã nghịch gì mà tất cả các website em đã add, cả website add mới nữa đều bị gặp lỗi khi try cập vào domain của site đó:  

lỗi 1 .
You don't have permission to access / on this server. 

Rất rõ ràng cậu đăng nhập vào bằng tài khoản nào mà truy nhập vào hằn / thì không lỗi mới là lạ !
lỗi 2: Cậu bảo cậu add thêm các website mới vậy cậu đã cho các folder chứa website đó quyền gì . đã đủ để các client đó truy nhập website đó chưa.
Mình thấy đoạn này trong file httpd.conf ghi rất rõ

# UserDir: The name of the directory that is appended onto a user's home
# directory if a ~user request is received.
#
# The path to the end user account 'public_html' directory must be
# accessible to the webserver userid. This usually means that ~userid
# must have permissions of 711, ~userid/public_html must have permissions
# of 755, and documents contained therein must be world-readable.
# Otherwise, the client will only receive a "403 Forbidden" message.
#
# See also: http://httpd.apache.org/docs/misc/FAQ.html#forbidden
#
 

vim httpd.conf nó nằm ở khoảng 33%


cố sửa lại chúc cậu thành công !
[Up] [Print Copy]
  [Question]   Re: Lỗi Forbidden You don't have permission to access / on this server 26/03/2009 11:50:37 (+0700) | #10 | 174771
[Avatar]
F10
Member

[Minus]    0    [Plus]
Joined: 01/12/2008 23:38:12
Messages: 89
Offline
[Profile] [PM]
Thôi đúng rồi vấn đề là ở đây !
<Directory />
Options +Indexes FollowSymLinks
AllowOverride None
Allow from all
</Directory>
 


Đó sửa lại

<Directory "/var/www/html">
Options +Indexes FollowSymLinks
AllowOverride None
Allow from all
</Directory>
[Up] [Print Copy]
  [Question]   Re: Lỗi Forbidden You don't have permission to access / on this server 26/03/2009 21:44:11 (+0700) | #11 | 174813
[Avatar]
viethungs
Member

[Minus]    0    [Plus]
Joined: 05/07/2006 17:04:03
Messages: 91
Offline
[Profile] [PM] [WWW]
ls -la /var/www/html nó cho ra cái này ạ

Code:
total 8736
drwxr-xr-x   7 root     root         4096 Mar 18 06:01 .
drwxrwxrwt  11 root     root         4096 Mar 18 00:00 ..
drwxr-xr-x   3 root     games        4096 Jan 23  2008 cgi-bin
drwxr-xr-x   3 root     games        4096 Mar 16 06:40 data
-rw-r--r--   1 root     root          111 Mar 16 03:02 index.html~
drwxr-xr-x  17 root     root         4096 Mar 17 23:47 mail
drwxr-xr-x   8 root     games        4096 Jan 23  2008 mails
-rw-r--r--   1 root     root      8887260 Mar 16 05:33 openwebmail-2.53.tar.gz
drwxr-xr-x  11 root     root         4096 Mar  6 05:07 phpMyAdmin



Em có search htaccess trong linux nhưng không thấy gì cả.

còn vấn đề ASP, em nói nh] vậy để chứng tỏ rằng dù có chạy trực tiếp file nào trong server nó cũng đều chỉ cho ra forbidden thôi ạ. Giúp em với
[Up] [Print Copy]
  [Question]   Re: Lỗi Forbidden You don't have permission to access / on this server 26/03/2009 22:14:49 (+0700) | #12 | 174815
[Avatar]
viethungs
Member

[Minus]    0    [Plus]
Joined: 05/07/2006 17:04:03
Messages: 91
Offline
[Profile] [PM] [WWW]
Em đã đặt các quyền user là 777 hết rồi, và cũng sửa httpd.conf như anh F10 nói, nhưng nó vẫn gặp lỗi.

Em đang test với tên miền http://check.homeftp.net/

Giúp em với
[Up] [Print Copy]
  [Question]   Re: Lỗi Forbidden You don't have permission to access / on this server 26/03/2009 23:59:02 (+0700) | #13 | 174840
[Avatar]
F10
Member

[Minus]    0    [Plus]
Joined: 01/12/2008 23:38:12
Messages: 89
Offline
[Profile] [PM]
-rw-r--r-- 1 root root 111 Mar 16 03:02 index.html~ 


Trong httpd.conf cậu đã chỉ ra index.html~ chưa ! Cậu cho mình xem cái quyền của thằng /var/www/html đi .
À và cái trang index của cậu có tham chiếu tới cái file nào nằm ở chỗ khác mà không đủ quyền không?

Thử tắt tường lửa xem sao . smilie
[Up] [Print Copy]
  [Question]   Re: Lỗi Forbidden You don't have permission to access / on this server 27/03/2009 00:42:58 (+0700) | #14 | 174847
[Avatar]
viethungs
Member

[Minus]    0    [Plus]
Joined: 05/07/2006 17:04:03
Messages: 91
Offline
[Profile] [PM] [WWW]
ah đúng rồi em chạy ls -la trong thư mục chứa site thì nó ra cái này


Code:
total 16
drwxrwxrwx   2 viethung hc7group     4096 Mar 25 20:50 .
drwxrwxrwx   4 viethung hc7group     4096 Mar 25 21:21 ..
-rwxrwxrwx   1 viethung hc7group     5128 Mar 24 03:09 index.htm


có gì sai không ạ ?

trong đó hiện tại chỉ có file index.html ạ.

Thư mục chứa các website là hostings ạ. còn tất cả thư mục em đều cho quyền read hết rồi.
[Up] [Print Copy]
  [Question]   Re: Lỗi Forbidden You don't have permission to access / on this server 27/03/2009 01:13:49 (+0700) | #15 | 174860
Mr.Khoai
Moderator

Joined: 27/06/2006 01:55:07
Messages: 954
Offline
[Profile] [PM]

viethungs wrote:
Em đã đặt các quyền user là 777 hết rồi, và cũng sửa httpd.conf như anh F10 nói, nhưng nó vẫn gặp lỗi.

Em đang test với tên miền http://check.homeftp.net/

Giúp em với 

Cứ gặp lỗi Permission là chmod 777 thì cái website không sống được bao lâu đâu. Bạn cần xem kỹ lại log và cách cấu hình httpd.conf cho đúng. Trong đoạn Code:
<Directory />
Options +Indexes FollowSymLinks
AllowOverride None
Allow from all
</Directory>
thì Apache xem cái / là directory nào? Apache còn được cấu hình với VirtualHost, vậy bạn chỉ xét permission tại /var/www/html có đủ không? Bạn sử dụng VirtualHost nào? Permission ra sao? Apache chạy dưới chủ quyền nào? Group nào?

khoai
[Up] [Print Copy]
  [Question]   Re: Lỗi Forbidden You don't have permission to access / on this server 27/03/2009 01:23:57 (+0700) | #16 | 174864
vnsp
Member

[Minus]    0    [Plus]
Joined: 26/03/2009 00:15:36
Messages: 3
Offline
[Profile] [PM]
Bạn thử kiểm tra xem permission của cái folder chứa web nó thế nào đã smilie. Permission ở đây ko phải chỉ là 777, còn xem owner của nó nữa.
[Up] [Print Copy]
  [Question]   Re: Lỗi Forbidden You don't have permission to access / on this server 27/03/2009 01:53:57 (+0700) | #17 | 174868
myquartz
Member

[Minus]    0    [Plus]
Joined: 04/01/2005 04:58:30
Messages: 563
Offline
[Profile] [PM]
Rất có thể là do SELinux.
Cậu chạy VirtualHost với directory khác mặc định như thế, mọi thứ có vẻ ok như thế mà vẫn bị permision denied. Thì có thể bị SELinux chặn lại.
Apache khi khai báo VirtualHost thì nó sẽ bỏ qua DocumentRoot cũ, mà coi cái VirtualHost config đầu tiên là site mặc định, mà thư mục này khác với mặc định của nó.
Có thể kiểm tra log việc chặn này ở file: /var/log/audit/audit.log
Để tắt nó đi chạy:
system-config-securitylevel-tui

Mục SELinux thì chọn là Disable, rồi OK. Sau đó khởi động lại máy.

[Up] [Print Copy]
  [Question]   Re: Lỗi Forbidden You don't have permission to access / on this server 27/03/2009 02:33:13 (+0700) | #18 | 174876
centos
Member

[Minus]    0    [Plus]
Joined: 28/03/2008 17:13:12
Messages: 219
Offline
[Profile] [PM]

myquartz wrote:
Rất có thể là do SELinux.
Cậu chạy VirtualHost với directory khác mặc định như thế, mọi thứ có vẻ ok như thế mà vẫn bị permision denied. Thì có thể bị SELinux chặn lại.
Apache khi khai báo VirtualHost thì nó sẽ bỏ qua DocumentRoot cũ, mà coi cái VirtualHost config đầu tiên là site mặc định, mà thư mục này khác với mặc định của nó.
Có thể kiểm tra log việc chặn này ở file: /var/log/audit/audit.log
Để tắt nó đi chạy:
system-config-securitylevel-tui

Mục SELinux thì chọn là Disable, rồi OK. Sau đó khởi động lại máy.

 


Uhm cũng có thể lắm, nhưng mình nghĩ chỉ kt cho chắc thôi chứ lúc đầu server hoạt động bình thường mà với lại lỗi forbiden không thể nào thằng SELinux báo được, mà nó sẽ báo reques time out,

@viethungs: bạn chưa trả lời câu hỏi của mình
[Up] [Print Copy]
  [Question]   Re: Lỗi Forbidden You don't have permission to access / on this server 27/03/2009 02:59:35 (+0700) | #19 | 174883
[Avatar]
viethungs
Member

[Minus]    0    [Plus]
Joined: 05/07/2006 17:04:03
Messages: 91
Offline
[Profile] [PM] [WWW]

vnsp wrote:
Bạn thử kiểm tra xem permission của cái folder chứa web nó thế nào đã smilie. Permission ở đây ko phải chỉ là 777, còn xem owner của nó nữa. 


Em đã tắt Selinux ngay từ đầu rồi ạ. em cũng kiểm tra, nó chưa bao giờ được bật cả.


Bạn thử kiểm tra xem permission của cái folder chứa web nó thế nào đã smilie. Permission ở đây ko phải chỉ là 777, còn xem owner của nó nữa.
 


Không chỉ owner, cả other em cũng cho read và write rồi nữa cơ.

@centos: em quên mất, thư mục chứa các site là hostings, còn thư mục root và /var/www/html. Log vừa rồi là em lấy ở /etc/httpd/logs

còn đây là trích logs ở thư mục chứa wesite /check.homeftp.net/logs ạ:



Code:
[Tue Mar 24 04:04:13 2009] [error] [client 118.68.83.124] (13)Permission denied: access to /home/images/stories/phan_mem/080505_media12.jpg denied, referer: http://karatebkhcm.plus.vn/diendan/newreply.php?do=newreply&p=448
[Tue Mar 24 04:04:20 2009] [error] [client 72.30.79.95] (13)Permission denied: access to /home/search/+c\xc3\xb4ng+c\xe1\xbb\xa5+t\xc3\xacm+ki\xe1\xba\xbfm denied
[Tue Mar 24 04:04:21 2009] [error] [client 72.30.79.95] (13)Permission denied: access to /forums/member.php denied
[Tue Mar 24 04:04:26 2009] [error] [client 222.253.209.90] (13)Permission denied: access to /home/danh-gia/39/372-starcraft-2-trailer-zerg.html denied, referer: http://images.google.com.vn/imgres?imgurl=http://tapchipc.com/home/images/stories/giaitri/121108-vuong7.jpg&imgrefurl=http://tapchipc.com/home/danh-gia/39/372-starcraft-2-trailer-zerg.html&usg=__P_dvAEaC11shDmZmK-JFKQJ29e4=&h=385&w=470&sz=66&hl=vi&start=301&um=1&tbnid=4tVbOF8o_s0ZCM:&tbnh=106&tbnw=129&prev=/images%3Fq%3D10%2Bmy%2Bnhan%2Btrung%2Bquoc%26ndsp%3D18%26hl%3Dvi%26sa%3DN%26start%3D288%26um%3D1
[Tue Mar 24 04:04:26 2009] [error] [client 222.253.209.90] (13)Permission denied: access to /home/images/stories/giaitri/121108-vuong7.jpg denied, referer: http://images.google.com.vn/imgres?imgurl=http://tapchipc.com/home/images/stories/giaitri/121108-vuong7.jpg&imgrefurl=http://tapchipc.com/home/danh-gia/39/372-starcraft-2-trailer-zerg.html&usg=__P_dvAEaC11shDmZmK-JFKQJ29e4=&h=385&w=470&sz=66&hl=vi&start=301&um=1&tbnid=4tVbOF8o_s0ZCM:&tbnh=106&tbnw=129&prev=/images%3Fq%3D10%2Bmy%2Bnhan%2Btrung%2Bquoc%26ndsp%3D18%26hl%3Dvi%26sa%3DN%26start%3D288%26um%3D1
[Tue Mar 24 04:04:28 2009] [error] [client 222.253.209.90] (13)Permission denied: access to /home/danh-gia/39/372-starcraft-2-trailer-zerg.html denied, referer: http://images.google.com.vn/imgres?imgurl=http://tapchipc.com/home/images/stories/giaitri/121108-vuong7.jpg&imgrefurl=http://tapchipc.com/home/danh-gia/39/372-starcraft-2-trailer-zerg.html&usg=__P_dvAEaC11shDmZmK-JFKQJ29e4=&h=385&w=470&sz=66&hl=vi&start=301&um=1&tbnid=4tVbOF8o_s0ZCM:&tbnh=106&tbnw=129&prev=/images%3Fq%3D10%2Bmy%2Bnhan%2Btrung%2Bquoc%26ndsp%3D18%26hl%3Dvi%26sa%3DN%26start%3D288%26um%3D1
[Tue Mar 24 04:04:30 2009] [error] [client 117.1.220.154] (13)Permission denied: access to /home/images/stories/goc_thu_thuat/230808_windows2003 r2.jpeg denied, referer: http://forum.mait.vn/showthread.php?t=5099
[Tue Mar 24 04:04:33 2009] [error] [client 117.1.147.140] (13)Permission denied: access to /home/danh-gia/phan-cung/29.html denied, referer: http://images.google.com.vn/imgres?imgurl=http://tapchipc.com/home/images/stories/goc_thu_thuat/080505-Desktopography1.jpg&imgrefurl=http://tapchipc.com/home/danh-gia/phan-cung/29.html%3F238739312b0b8c8e259085088344b870%3D673368e58658eb84236e6e13d112fd89%26start%3D60&usg=__2M0FfXy8M9LD4SOscC1zxSm3tJM=&h=300&w=375&sz=101&hl=vi&start=8&um=1&tbnid=sx3-F7qRVKaiPM:&tbnh=98&tbnw=122&prev=/images%3Fq%3Dhinh%2Bnen%2Bmay%2Btinh%26hl%3Dvi%26um%3D1
[Tue Mar 24 04:04:33 2009] [error] [client 72.30.79.95] (13)Permission denied: access to /home/search/+c\xc3\xb4ng+c\xe1\xbb\xa5+t\xc3\xacm+ki\xe1\xba\xbfm denied
[Tue Mar 24 04:04:33 2009] [error] [client 117.1.220.154] (13)Permission denied: access to /home/images/stories/goc_thu_thuat/230808_windows2003 r2.jpeg denied, referer: http://forum.mait.vn/showthread.php?t=5099
[Tue Mar 24 04:04:33 2009] [error] [client 195.200.70.23] (13)Permission denied: access to /home/images/stories/giaitri/080518-jo-garcia.jpg denied, referer: http://www.jaythejoke.com/index.php/forums/viewthread/5862/
[Tue Mar 24 04:04:34 2009] [error] [client 81.196.40.94] (13)Permission denied: access to /home/images/stories/goc_thu_thuat/080705-MAYOKO.jpg denied, referer: http://portableturk.com/index.php?cstart=3&do=cat&category=portable-internet-araclari
[Tue Mar 24 04:04:36 2009] [error] [client 123.22.105.184] (13)Permission denied: access to /home/goc-thu-thuat/phan-cung/3774-tu-lap-cpu-gia-100-usd.html denied, referer: http://www.google.com.vn/search?hl=vi&q=tu+lap+cpu&meta=&aq=f&oq=
[Tue Mar 24 04:04:41 2009] [error] [client 118.69.152.115] (13)Permission denied: access to /home/ denied
[Tue Mar 24 04:04:41 2009] [error] [client 118.69.152.115] (13)Permission denied: access to /favicon.ico denied
[Tue Mar 24 04:04:48 2009] [error] [client 72.30.79.95] (13)Permission denied: access to /home/search/+l\xc3\xa2u+nh\xe1\xba\xa5t denied
[Tue Mar 24 04:04:49 2009] [error] [client 219.159.199.34] (13)Permission denied: access to /forums/index.php denied, referer: http://tapchipc.com/forums/index.php
[Tue Mar 24 04:04:51 2009] [error] [client 203.208.60.108] (13)Permission denied: access to /home/danh-gia/phan-mem/phan-mem-giai-tri/1277-windows-media-player-12-beta-1.html denied
[Tue Mar 24 04:04:56 2009] [error] [client 72.30.79.95] (13)Permission denied: access to /home/goc-thu-thuat/he-dieu-hanh/2751-thu-thuat-gui-voice-mail-trong-windows-xp.html denied
[Tue Mar 24 04:04:56 2009] [error] [client 118.71.42.26] (13)Permission denied: access to /forums/showthread.php denied, referer: http://www.google.com.vn/search?hl=vi&q=can+ban+ghost+moi+nhat&meta=&aq=f&oq=


Các anh giúp em với. Cái này em nghiên kíu mãi mà không hiểu lỗi từ đâu nữa.

Mà cũng lạ, tại sao logs lại có nhiều đường dẫn lạ như vậy, domain này em mới add vào website. nó cũng chỉ là domain để test. Liệu có phải em đang bị tấn công ?
[Up] [Print Copy]
  [Question]   Re: Lỗi Forbidden You don't have permission to access / on this server 27/03/2009 03:22:06 (+0700) | #20 | 174885
myquartz
Member

[Minus]    0    [Plus]
Joined: 04/01/2005 04:58:30
Messages: 563
Offline
[Profile] [PM]

centos wrote:


Uhm cũng có thể lắm, nhưng mình nghĩ chỉ kt cho chắc thôi chứ lúc đầu server hoạt động bình thường mà với lại lỗi forbiden không thể nào thằng SELinux báo được, mà nó sẽ báo reques time out,

 


Không cậu ạ, SELinux báo lỗi cho ứng dụng là permission denied ngay. Lỗi Permission Denied này giống hệt lỗi khi không có quyền truy cập file. Dù chmod 777 hay chown đều vô tác dụng hết. Tất cả là do policy của SELinux.
Tớ gặp điều này vài lần rồi, và chưa bao giờ bị lỗi timeout cả.
[Up] [Print Copy]
  [Question]   Re: Lỗi Forbidden You don't have permission to access / on this server 27/03/2009 05:11:23 (+0700) | #21 | 174896
[Avatar]
viethungs
Member

[Minus]    0    [Plus]
Joined: 05/07/2006 17:04:03
Messages: 91
Offline
[Profile] [PM] [WWW]
giúp em với, em đã gửi log ở trên rồi nè. tất cả đều báo là Permission denied.

Khắc phục ra sao ạ
[Up] [Print Copy]
  [Question]   Re: Lỗi Forbidden You don't have permission to access / on this server 27/03/2009 05:18:01 (+0700) | #22 | 174898
centos
Member

[Minus]    0    [Plus]
Joined: 28/03/2008 17:13:12
Messages: 219
Offline
[Profile] [PM]
bây giờ cô lập lại vấn đề nhé,

@viethungs: bạn thử tạo một virtualhost mới đơn giản thôi đừng phức tạp quá, sau đó bỏ vào trong thư mục hosting và tạo ra một file index.html.

Chay thử xem nó có chạy không? để mình khoanh vùng nó bị là lỗi do đâu? và một điều lưu ý với bạn là tuyệt đối không thể change mod 777 khi server đang public. đặc biệt là server web.

PS: mình nghĩ mọi người vẫn đang giúp bạn và đang theo dõi bài viết, đừng hốt hoảng cứ từ từ sẽ có kết quả tôt hehe good luck
[Up] [Print Copy]
  [Question]   Re: Lỗi Forbidden You don't have permission to access / on this server 29/03/2009 05:03:34 (+0700) | #23 | 175133
[Avatar]
viethungs
Member

[Minus]    0    [Plus]
Joined: 05/07/2006 17:04:03
Messages: 91
Offline
[Profile] [PM] [WWW]
Em chạy localhost trên đúng máy server thì thấy ngon, nhưng chạy ở virtual host, tạo từ HC thì nó lại bị thế

Có lẽ lỗi xuất phát vì cấu hình gì đó ở Webmin không ạ ?

Và cũng lạ là máy server chỉ mở một lúc, tầm 20' là mất kết nối. nó báo là "Network Timeout" nếu dùng firefox truy cập vào site nào đó các anh cứ vào http://check.homeftp.net là thấy ngay

không hiểu là vì đâu ạ? do mạng hay do máy server có vấn đề ạ ?
[Up] [Print Copy]
  [Question]   Re: Lỗi Forbidden You don't have permission to access / on this server 29/03/2009 22:12:33 (+0700) | #24 | 175200
centos
Member

[Minus]    0    [Plus]
Joined: 28/03/2008 17:13:12
Messages: 219
Offline
[Profile] [PM]

viethungs wrote:
Em chạy localhost trên đúng máy server thì thấy ngon, nhưng chạy ở virtual host, tạo từ HC thì nó lại bị thế

Có lẽ lỗi xuất phát vì cấu hình gì đó ở Webmin không ạ ?

 


Bạn sài webmin để quản lý webserver ah? Mình nghĩ không phải do webmin gây ra đâu, bạn xem lại document cấu hình của HC và nội dung trong trong virtualhost.

viethungs wrote:


Và cũng lạ là máy server chỉ mở một lúc, tầm 20' là mất kết nối. nó báo là "Network Timeout" nếu dùng firefox truy cập vào site nào đó các anh cứ vào http://check.homeftp.net là thấy ngay
 


Để chắc được bạn đã map port về đúng server chưa, Firewall của bạn có chặn gói ICMP không? trên con server web privileges IP của bạn là bao nhiêu?
[Up] [Print Copy]
  [Question]   Re: Lỗi Forbidden You don't have permission to access / on this server 30/03/2009 00:24:24 (+0700) | #25 | 175209
myquartz
Member

[Minus]    0    [Plus]
Joined: 04/01/2005 04:58:30
Messages: 563
Offline
[Profile] [PM]
Cậu vẫn loay hoay với nó à?
Tớ nói rồi, cậu disable cái SELinux đi, sẽ thấy hiệu quả liền.
Xem cách disable nó ở đây: http://www.centos.org/docs/5/html/5.1/Deployment_Guide/sec-sel-enable-disable.html
[Up] [Print Copy]
  [Question]   Re: Lỗi Forbidden You don't have permission to access / on this server 30/03/2009 03:37:08 (+0700) | #26 | 175222
[Avatar]
viethungs
Member

[Minus]    0    [Plus]
Joined: 05/07/2006 17:04:03
Messages: 91
Offline
[Profile] [PM] [WWW]

myquartz wrote:
Cậu vẫn loay hoay với nó à?
Tớ nói rồi, cậu disable cái SELinux đi, sẽ thấy hiệu quả liền.
Xem cách disable nó ở đây: http://www.centos.org/docs/5/html/5.1/Deployment_Guide/sec-sel-enable-disable.html 


Từ khi cài nó tớ chưa bao giờ bật cái Selinux cả. Và tớ cũng chạy lệnh disable nó mỗi khi khởi động server
[Up] [Print Copy]
  [Question]   Re: Lỗi Forbidden You don't have permission to access / on this server 30/03/2009 06:09:42 (+0700) | #27 | 175231
myquartz
Member

[Minus]    0    [Plus]
Joined: 04/01/2005 04:58:30
Messages: 563
Offline
[Profile] [PM]

viethungs wrote:

Từ khi cài nó tớ chưa bao giờ bật cái Selinux cả. Và tớ cũng chạy lệnh disable nó mỗi khi khởi động server 


Tớ cài CentOS thì nó ko có option bật/tắt, mặc định nó là bật và có thể tắt được khi nó chạy firstboot.

Cậu chạy lệnh gì để tắt nó thế? Cậu thử chạy lệnh sestatus xem nó có ra thế này không?

Code:
SELinux status:                 disabled


Nếu cậu đã tắt SELinux rồi mà vẫn bị ... lỗi đó. Thì tớ xin chịu. Nếu cậu share cho cái SSH account hoặc chạy screen để mọi người coi cụ thể thì có thể giúp đỡ cậu được đấy.
[Up] [Print Copy]
  [Question]   Re: Lỗi Forbidden You don't have permission to access / on this server 31/03/2009 05:25:16 (+0700) | #28 | 175388
[Avatar]
viethungs
Member

[Minus]    0    [Plus]
Joined: 05/07/2006 17:04:03
Messages: 91
Offline
[Profile] [PM] [WWW]
Hix. Em xin chịu thua cái lỗi này. Mò mẫm đủ trò mà nó không chịu ra. Đành cài lại server vậy.

Dẫu sao vẫn rất cảm ơn các anh nhiệt tình chung tay giúp đỡ em ạ.
[Up] [Print Copy]
  [Question]   Lỗi Forbidden You don't have permission to access / on this server 25/02/2010 13:46:47 (+0700) | #29 | 205516
hiep_si_lon
Member

[Minus]    0    [Plus]
Joined: 01/04/2004 18:42:54
Messages: 2
Offline
[Profile] [PM]
Lỗi (13) permission denied access thì bạn cứ check kĩ lại cho mình permission từng thư mục một từ đầu tới file của bạn

/hostings /salelinux /viethungs /check.homeftp.net /www /html

Mình vừa bị như bạn và check lại hóa ra chỉ là lỗi permission cho thư mục thôi. Selinux cũng disable rồi.
[Up] [Print Copy]
  [Question]   Lỗi Forbidden You don't have permission to access / on this server 16/11/2010 10:29:14 (+0700) | #30 | 224981
juhuvn
Member

[Minus]    0    [Plus]
Joined: 25/02/2005 18:11:22
Messages: 1
Offline
[Profile] [PM] [WWW]
Tôi xin bổ sung solution cho vấn đề này để thread hoàn chỉnh mặc dù bài này đã rất cũ rồi (cách đây gần 4 năm).

Vấn đề Forbidden You don't have permission to access / on this server là do bạn chưa Allow proxy ở mods-enabled/proxy.conf

Code:
vim <apache>/mods-enabled/proxy.conf


Và đổi Allow from sang các domain của bạn.

Code:
<Proxy *>
                AddDefaultCharset off
                Order deny,allow
                Deny from all
                Allow from .example.com
        </Proxy>


You can win if you want
[Up] [Print Copy]
[digg] [delicious] [google] [yahoo] [technorati] [reddit] [stumbleupon]
Go to: 
 Users currently in here 
1 Anonymous

Powered by JForum - Extended by HVAOnline
 hvaonline.net  |  hvaforum.net  |  hvazone.net  |  hvanews.net  |  vnhacker.org
1999 - 2013 © v2012|0504|218|