您无权访问 / 在此服务器上。(AWS EC2 Ubuntu Laravel 项目)

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/23001646/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-14 09:20:48  来源:igfitidea点击:

You don't have permission to access / on this server. (AWS EC2 Ubuntu Laravel Project)

ubuntuamazon-web-serviceslaravelamazon-ec2laravel-4

提问by user1072337

I have an EC2 Ubuntu instance running on AWS that I have my site on. Previously, I was able to get my site up and running (everything was working fine with url.com, www.url.com, or http://url.com. Now none of these are working).

我有一个在 AWS 上运行的 EC2 Ubuntu 实例,我的站点位于该实例上。以前,我能够启动并运行我的网站(使用 url.com、www.url.com 或http://url.com一切正常。现在这些都不起作用)。

Now I get the message:

现在我收到消息:

You don't have permission to access / on this server. Apache/2.4.7 (Ubuntu) Server at www.url.com Port 80

您无权访问 / 在此服务器上。Apache/2.4.7 (Ubuntu) 服务器在 www.url.com 端口 80

The only thing that changed was that I updated my laravel project (the framework for the site) from 4.0 to 4.1.

唯一改变的是我将 laravel 项目(站点框架)从 4.0 更新到 4.1。

I'm at a loss as to why this changed. Any ideas? Thank you for your help.

我不知道为什么这会改变。有任何想法吗?感谢您的帮助。

回答by ultimate

Delegate application's directory to apache's user

将应用程序的目录委托给 apache 的用户

chgrp -R www-data /var/www/laravel

Make storage folder writable so that laravel can write logs, cache & compiled views to it.

使存储文件夹可写,以便 laravel 可以向其中写入日志、缓存和编译视图。

chmod -R 775 /var/www/laravel/app/storage

After you have done this, everything should be back online.

完成此操作后,一切都应该重新联机。