403 laravel项目禁止,但没有别的

时间:2014-12-22 17:56:15

标签: php laravel nginx digital-ocean

我有一个数字海洋水滴,我在网站的根目录上有一个测试页面,它工作正常,但是当我尝试连接到laravel项目时,它会遇到403 Forbidden错误。< / p>

基本上,如果我去:

mysite.com/

显示正常页面

如果我去:

mysite.com/public

它显示了403 error

我尝试使用chmod -R 755 app/storage更改权限,甚至尝试更改整个文件夹/目录的权限,但无效。

以下是错误日志的最后一部分:

2014/12/22 11:13:02 [error] 14447#0: *1 directory index of "/var/www/mysite.com/public_html/" is forbidden, client: 41.150.139.252, server: mysite.com, request$
2014/12/22 11:13:07 [error] 14447#0: *2 directory index of "/var/www/mysite.com/public_html/" is forbidden, client: 41.150.139.252, server: mysite.com, request$
2014/12/22 11:15:29 [emerg] 14465#0: bind() to 0.0.0.0:80 failed (98: Address already in use)
2014/12/22 11:15:29 [emerg] 14465#0: bind() to [::]:80 failed (98: Address already in use)
2014/12/22 11:15:29 [emerg] 14465#0: bind() to 0.0.0.0:80 failed (98: Address already in use)
2014/12/22 11:15:29 [emerg] 14465#0: bind() to [::]:80 failed (98: Address already in use)
2014/12/22 11:15:29 [emerg] 14465#0: bind() to 0.0.0.0:80 failed (98: Address already in use)
2014/12/22 11:15:29 [emerg] 14465#0: bind() to [::]:80 failed (98: Address already in use)
2014/12/22 11:15:29 [emerg] 14465#0: bind() to 0.0.0.0:80 failed (98: Address already in use)
2014/12/22 11:15:29 [emerg] 14465#0: bind() to [::]:80 failed (98: Address already in use)
2014/12/22 11:15:29 [emerg] 14465#0: bind() to 0.0.0.0:80 failed (98: Address already in use)
2014/12/22 11:15:29 [emerg] 14465#0: bind() to [::]:80 failed (98: Address already in use)
2014/12/22 11:15:29 [emerg] 14465#0: still could not bind()
2014/12/22 11:16:14 [error] 14447#0: *3 directory index of "/var/www/mysite.com/public_html/" is forbidden, client: 41.150.139.252, server: mysite.com, request$

1 个答案:

答案 0 :(得分:2)

根据你在评论中的回答,我认为关于东西在哪里以及你期望它的位置存在脱节。

你说:&#34;目录是/var/www/mysite.com,laravel直接安装在那里&#34;

所以我希望这样的事情:

/var/www/mysite.com/
    app/
    public/
    vendor/
    etc...

然后你说:&#34; [webserver] root被设置为/var/www/mysite.com/public_html/&#34;

因此,当您在浏览器中转到mysite.com时,它会指向/var/www/mysite.com/public_html/mysite.com/public指向/var/www/mysite.com/public_html/public/,这似乎与您无关想。

尝试更改网络服务器根目录以指向/var/www/mysite.com/public/(Laravel&#39; s&#34; public&#34; dir)。