apache - centos 网站访问提示 Forbidden You don't have permission to access

 明月思含含 发布于 2022-10-25 04:40

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 内容(自己写的)


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

1 个回答
  • 检查一下 /home/baidu.com/home 有没有 other 的 x 权限。

    2022-10-26 14:16 回答
撰写答案
今天,你开发时遇到什么问题呢?
立即提问
热门标签
PHP1.CN | 中国最专业的PHP中文社区 | PNG素材下载 | DevBox开发工具箱 | json解析格式化 |PHP资讯 | PHP教程 | 数据库技术 | 服务器技术 | 前端开发技术 | PHP框架 | 开发工具 | 在线工具
Copyright © 1998 - 2020 PHP1.CN. All Rights Reserved 京公网安备 11010802041100号 | 京ICP备19059560号-4 | PHP1.CN 第一PHP社区 版权所有