VnLamp

Go Back   VnLamp > Khu vực Training > Linux Advance > Apache Web server

Trả lời
 
LinkBack Ðiều Chỉnh Xếp Bài
Lỗi Forbidden!!!-- you dont have permissionto access / on this web
Old
  (#1 (permalink))
 
Status: Offline
Posts: 21
Tham gia: Mar 2010
Học viên VNLAMP
Default Lỗi Forbidden!!!-- you dont have permissionto access / on this web - 07-07-2010, 12:7 07-07-2010

em cấu hình Virtual host như sau:
<VirtualHost *:80>
ServerAdmin webmaster@dicho.vn
DocumentRoot "/home/dichotructuyen"
ServerName dicho.vn
ServerAlias dicho.vn
ErrorLog "logs/dicho-error_log"
CustomLog "logs/dicho-access_log" common
</VirtualHost>

<VirtualHost *:80>
ServerAdmin webmaster@phpmyadmin.com
DocumentRoot "/home/pma"
ServerName phpmyadmin.com
ServerAlias phpmyadmin.com
ErrorLog "logs/phpmyadmin.com-error_log"
CustomLog "logs/phpmyadmin.com-access_log" common
</VirtualHost>


Em gõ phpmyadmin.com thì chạy
gõ dicho.vn thì báo lỗi Forbidden!!!-- you dont have permissionto access / on this web.
Không biết lỗi này có em chép nguyen thư mục file từ window sang linux không? em copy bằng winscp qua liệu nó có gây nên vấn đề này không?
   
Trả Lời Với Trích Dẫn
Old
  (#2 (permalink))
 
Status: Offline
Posts: 53
Tham gia: Nov 2009
BQT VNLAMP
 
kingcasino's Avatar
Default 07-07-2010, 17:7 07-07-2010

Hi,

Bạn đã chown về owner và group là apache:apache cho thư mục chứa websites chưa ?

Và chmod cho user và group apache được toàn quyền trên thư mục chứa websites chưa ?

Nếu vẫn ko được, bạn post log file lên để mọi người giúp bạn nhé
   
Trả Lời Với Trích Dẫn
Old
  (#3 (permalink))
 
Status: Offline
Posts: 21
Tham gia: Mar 2010
Học viên VNLAMP
Default 07-07-2010, 23:7 07-07-2010

mình đã change chown -R apache:apache dichotructuyen
và chmod 755 dichotructuyen rồi vẫn ko truy cập dc. Mình post log file :
file dicho-access_log
127.0.0.1 - - [03/Jul/2010:17:36:13 +0700] "GET / HTTP/1.1" 403 202
127.0.0.1 - - [03/Jul/2010:17:36:14 +0700] "GET / HTTP/1.1" 403 202
127.0.0.1 - - [03/Jul/2010:17:36:14 +0700] "GET / HTTP/1.1" 403 202
127.0.0.1 - - [03/Jul/2010:17:36:14 +0700] "GET / HTTP/1.1" 403 202
127.0.0.1 - - [03/Jul/2010:17:36:14 +0700] "GET / HTTP/1.1" 403 202
127.0.0.1 - - [03/Jul/2010:17:36:15 +0700] "GET / HTTP/1.1" 403 202
127.0.0.1 - - [03/Jul/2010:17:36:15 +0700] "GET / HTTP/1.1" 403 202
127.0.0.1 - - [03/Jul/2010:17:36:15 +0700] "GET / HTTP/1.1" 403 202
127.0.0.1 - - [03/Jul/2010:17:36:15 +0700] "GET / HTTP/1.1" 403 202
127.0.0.1 - - [03/Jul/2010:17:36:16 +0700] "GET / HTTP/1.1" 403 202
127.0.0.1 - - [03/Jul/2010:17:36:16 +0700] "GET / HTTP/1.1" 403 202
127.0.0.1 - - [03/Jul/2010:17:36:16 +0700] "GET / HTTP/1.1" 403 202
và : dicho-error_log
[Sat Jul 03 17:36:15 2010] [error] [client 127.0.0.1] client denied by server co
nfiguration: /home/dichotructuyen/
[Sat Jul 03 17:36:16 2010] [error] [client 127.0.0.1] client denied by server co
nfiguration: /home/dichotructuyen/
[Sat Jul 03 17:36:16 2010] [error] [client 127.0.0.1] client denied by server co
nfiguration: /home/dichotructuyen/
[Sat Jul 03 17:36:16 2010] [error] [client 127.0.0.1] client denied by server co
nfiguration: /home/dichotructuyen/

Mong bà con giúp đỡ nhé
   
Trả Lời Với Trích Dẫn
Old
  (#4 (permalink))
 
Status: Offline
Posts: 53
Tham gia: Nov 2009
BQT VNLAMP
 
kingcasino's Avatar
Default 07-07-2010, 23:7 07-07-2010

HI,

Bạn thử

Trích:
chown -R apache:apache /home

chmod 755 /home
và restart lại service httpd xem sao nhé !
   
Trả Lời Với Trích Dẫn
Old
  (#5 (permalink))
 
Status: Offline
Posts: 21
Tham gia: Mar 2010
Học viên VNLAMP
Default 08-07-2010, 12:8 08-07-2010

vẫn không truy cập được dù đã sửa lại và restart lại dịch vụ.
em chuyển thư mục qua gõ localhost cũng bị báo lỗi trên.
vậy có phải lỗi file cấu hình không? File cấu hình em chỉ mở rào dòng vhost thôi

thay đổi nội dung bởi: razer_krait, 08-07-2010 lúc 13:8 08-07-2010.
   
Trả Lời Với Trích Dẫn
Old
  (#6 (permalink))
 
Status: Offline
Posts: 53
Tham gia: Nov 2009
BQT VNLAMP
 
kingcasino's Avatar
Default 08-07-2010, 12:8 08-07-2010

Bạn đã disable --> SELinux chưa ?

và chắc chắn đã mở rào dòng sau chưa

Trích:
NameVirtualHost *:80
Hoặc bạn tạo một VirtualHost khác, như ví dụ dưới đây xem sao:

Trích:
<VirtualHost *:80>
ServerAdmin webmaster@dicho.vn
DocumentRoot "/var/www/html/dichotructuyen"
ServerName dicho.vn
ServerAlias www.dicho.vn
ErrorLog "logs/dicho-error_log"
CustomLog "logs/dicho-access_log" common
</VirtualHost>


Trích:
chown -R apache:apache /var/www/html/dichotructuyen

chmod 755 /var/www/html/dichotructuyen
Bạn thực hiện thử những bước trên và xem kết quả thế nào ?

@ Bạn vui lòng post file httpd.conf lên để mọi người xem thử nhé !

thay đổi nội dung bởi: kingcasino, 08-07-2010 lúc 17:8 08-07-2010.
   
Trả Lời Với Trích Dẫn
Old
  (#7 (permalink))
 
Status: Offline
Posts: 25
Tham gia: Mar 2010
Học viên VNLAMP
Default 08-07-2010, 21:8 08-07-2010

Bạn chỉ cần chỉnh lại dòng AllowOverride all trong thẻ directory là sẽ hết lỗi trên.
   
Trả Lời Với Trích Dẫn
Trả lời


Ðiều Chỉnh
Xếp Bài

Quyền Sử Dụng Ở Diễn Ðàn
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is Mở
Smilies đang Mở
[IMG] đang Mở
HTML đang Tắt
Trackbacks are Mở
Pingbacks are Mở
Refbacks are Mở


Múi giờ GMT. Hiện tại là 02:21 21-05-2012.