[英]Symfony app 403 Forbidden error: You don't have permission to access / on this server
I'm trying to run a symfony app on a CentOS7 linode server, but I'm getting an error: 我正在尝试在CentOS7 linode服务器上运行symfony应用程序,但我收到一个错误:
Cannot serve directory <path to project>: No matching DirectoryIndex (index.html, index.php)
I have a vhost setup for this subdomain with this config: 我有这个配置的子域的vhost设置:
<VirtualHost *:80>
ServerAdmin pak11273@gmail.com
ServerName mister
ServerAlias project.mystuff.com
DocumentRoot /var/www/html/project
ErrorLog /var/www/html/project/logs/error.log
CustomLog /var/www/html/project/logs/access.log combined
<Directory "/var/www/html/project" >
#Options FollowSymLinks
Options -Indexes
AllowOverride All
Require all granted
</Directory>
</VirtualHost>
My current settings are: 我目前的设置是:
1) My webserver user and group is apache 1)我的网络服务器用户和组是apache
2) My permissions to the /var/www/html/project are 755 with apache:apache 2)我对/ var / www / html / project的权限是755 with apache:apache
I've tried the following suggestions on the internet to no avail: 我在互联网上尝试了以下建议无济于事:
1) Changed Options -Indexes to Options +Indexes 1)更改选项 - 指数选项+索引
2) Added DirectoryIndex index.html 2)添加了DirectoryIndex index.html
3) I get server errors if I change root ownership of /var 3)如果我更改/ var的root权限,我会收到服务器错误
I'm using CentOS 6 and Apache. 我正在使用CentOS 6和Apache。 Try this change:
试试这个改变:
<VirtualHost *:80>
ServerAdmin pak11273@gmail.com
ServerName mister
ServerAlias project.mystuff.com
DocumentRoot /var/www/html/project/web
ErrorLog /var/www/html/project/var/logs/error.log
CustomLog /var/www/html/project/var/logs/access.log combined
<Directory "/var/www/html/project/web" >
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Require all granted
</Directory>
</VirtualHost>
Also verify you can use wget
or curl
to get your Symfony index.html page on the localhost. 还要验证您是否可以使用
wget
或curl
在localhost上获取Symfony index.html页面。 CentOS might have enabled SELinux or even iptables. CentOS可能启用了SELinux甚至iptables。
Use sestatus
to see if it is set to enforcing - if so you need to allow web or disable SELinux temporarily. 使用
sestatus
查看是否设置为强制执行 - 如果是这样,您需要允许Web或临时禁用SELinux。
xabbuh is correct. xabbuh是对的。 The "web" directory is the folder you need to use as your web root.
“web”目录是您需要用作Web根目录的文件夹。 If updated my post to reflect the changes needed.
如果更新了我的帖子以反映所需的更改。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.