简体   繁体   English

Symfony app 403禁止错误:您无权访问此服务器上的/

[英]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. 还要验证您是否可以使用wgetcurl在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.

相关问题 Heroku 上的 Symfony:403 Forbidden 您无权访问 / 在此服务器上 - Symfony on Heroku: 403 Forbidden You don't have permission to access / on this server 403 Forbidden您无权访问此服务器上的/ mytesting / &lt;。 错误 - 403 Forbidden You don't have permission to access /mytesting/< on this server. ERROR 迁移和错误:禁止您无权访问此服务器上的/ - Migration and Error: Forbidden You don't have permission to access / on this server 403 Forbidden 您无权访问此资源 - 403 Forbidden You don't have permission to access this resource 403禁止访问:您无权访问 - 403 Forbidden : You don't have permission to access 403 Forbidden:您无权在wordpress中访问 - 403 Forbidden : You don't have permission to access in wordpress 403 Forbidden:您无权访问Codeigniter - 403 Forbidden : You don't have permission to access in Codeigniter (403) 禁止。 您无权访问此资源 - (403) Forbidden. You don't have permission to access this resource 错误403访问禁止! 您无权访问请求的对象。 它受读保护或服务器无法读取 - error 403 ACCESS FORBIDDEN! You don't have permission to access the requested object. It is either read-protected or not readable by the server MacOS XAMPP Access Forbidden Error 403 - 您无权访问请求的目录 - MacOS XAMPP Access Forbidden Error 403 - You don't have permission to access the requested directory
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM