首頁  >  問答  >  主體

apache - centos 網站訪問提示 Forbidden You don't have permission to access

Linode 的伺服器,自己加了一個 VirtualHost

DocumentRoot /home/baidu.com/public_html

訪問網站,提示內容:

Forbidden

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

目錄 /home/baidu.com/public_html 的擁有者 ll:

[root@localhost baidu.com]# pwd
/home/baidu.com
[root@localhost baidu.com]# ll
total 12
drwxr-xr-x 2 root root 4096 Oct 16 22:23 backup
drwxr-xr-x 2 root root 4096 Oct 16 22:32 logs
drwxr-xr-x 2 root root 4096 Oct 16 22:54 public_html

預設的目錄 /var/www/html ,訪問網址可以訪問,目錄 ll資訊:

[root@localhost www]# pwd
/var/www
[root@localhost www]# ll
total 8
drwxr-xr-x 2 root root 4096 Jul 23 22:48 cgi-bin
drwxr-xr-x 2 root root 4096 Oct 16 22:14 html

給目錄 /home/35dalu.com 加了 chmod o+x 之後 可以訪問了。
但不是vhost.conf 設定中的那個目錄,請造訪 http://ln.35dalu.com/index.php (/home/35dalu.com/public_html/index.php) 提示404 Not Find

/etc/httpd/conf.d/vhost.conf 內容(自己寫的)

<VirtualHost ln.35dalu.com>
DocumentRoot /home/35dalu.com/public_html
ServerName 35dalu.com
ServerAlias dev.35dalu.com info.35dalu.com ln.35dalu.com
ErrorLog /home/35dalu.com/logs/error.log
CustomLog /home/35dalu.com/logs/access.log common
</VirtualHost>
天蓬老师天蓬老师2733 天前744

全部回覆(1)我來回復

  • 怪我咯

    怪我咯2017-04-25 09:03:22

    檢查一下 /home/baidu.com/home 有沒有 other 的 x 權限。

    回覆
    0
  • 取消回覆