如何将文件上传到正确的文件夹路径?

时间:2016-06-18 19:06:49

标签: apache laravel digital-ocean virtual-hosts

我在14.04上使用数字海洋Ubuntu LAMP来配置我们的加密证书我跟着这篇文章:

https://www.digitalocean.com/community/tutorials/how-to-secure-apache-with-let-s-encrypt-on-ubuntu-14-04

作为先决条件,我在此帖后配置了一个域名:

https://www.digitalocean.com/community/tutorials/how-to-set-up-apache-virtual-hosts-on-ubuntu-14-04-lts

现在我在/var/www/myblog.com上安装了laravel 5.2,但现在我在网站上看不到任何东西它显示404错误,这意味着路径或虚拟路径有问题主持人没有显示php文件。

我不确定该做什么或我的文件应该位于虚拟主机中的哪个位置 要正确显示

1 个答案:

答案 0 :(得分:0)

Laravel using the url rewriting features of .htaccess. This is quite often not the default configuration in a server installation, so you need to enable it manually, either globally, or for the particular virtual host you need it for. I would recommend you enable it only for the sites you need it on. In your virtual host configuration, make sure you include AllowOverride All for the directory that laravel is installed under. It will be something along the lines of this within the particular virtual host.

<Directory /var/www/myblog.com>
    Options Indexes FollowSymLinks MultiViews
    AllowOverride All
    Order allow,deny
    allow from all
</Directory>

Let me know if this fixes your problem.

EDIT:

The other thing that you may not have done yet is set up the correct permissions on the storage directory as described in the answer here.