我正在尝试在ubuntu apache服务器上使用虚拟主机设置现有的 laravel 5.1 项目,我已相应地配置了vhosts文件,并完成了以下命令
sudo chown -R $USER:$USER /var/www/example.dev/public
sudo chmod -R 755 /var/www
为我的文件夹目录授予权限。当我转到我的网址时(例如example.dev
)
每次我尝试加载服务器时都会得到一个空白页面。在查看apache2日志文件中的记录记录中,我看到了这个
[Mon Jan 04 20:24:09.072782 2016] [:error] [pid 6002] [client 127.0.0.1:51627] PHP Fatal error: Uncaught exception 'UnexpectedValueException' with message 'The stream or file "/var/www/example.dev/storage/logs/laravel.log" could not be opened: failed to open stream: Permission denied' in /var/www/example.dev/bootstrap/cache/compiled.php:13350\nStack trace:\n#0 /var/www/example.dev/bootstrap/cache/compiled.php(13288): Monolog\\Handler\\StreamHandler->write(Array)\n#1 /var/www/example.dev/bootstrap/cache/compiled.php(13051): Monolog\\Handler\\AbstractProcessingHandler->handle(Array)\n#2 /var/www/example.dev/bootstrap/cache/compiled.php(13147): Monolog\\Logger->addRecord(400, Object(Symfony\\Component\\Debug\\Exception\\FatalErrorException), Array)\n#3 /var/www/example.dev/bootstrap/cache/compiled.php(12864): Monolog\\Logger->error(Object(Symfony\\Component\\Debug\\Exception\\FatalErrorException), Array)\n#4 /var/www/example.dev/bootstrap/cache/compiled.php(12835): Illuminate\\Log\\Writer->writeLog('error', Object(Symfony\\Component\\Debug\\Exception\\FatalErrorException), Array)\n#5 /var/www/example.dev/vendor/laravel/framework/src/Illuminate/Foun in /var/www/example.dev/bootstrap/cache/compiled.php on line 13350
任何想法,我想要实现的只是我自己的虚拟主机'example.dev',遵循本指南
这几乎是我的vhosts.conf
设置:
<VirtualHost *:80>
ServerAdmin admin@pcpal.com
DocumentRoot /var/www/pcpal.dev/public
ServerName pcpal.dev
ServerAlias pcpal.dev
<Directory /var/www/pcpal.dev/public >
Options FollowSymLinks
Options Indexes FollowSymLinks Includes ExecCGI
AllowOverride All
Require all granted
</Directory>
</VirtualHost>