我正在尝试部署我的laravel项目,我已经安装了Apache,MySQL,PHP,作曲家和laravel。我通过git引入了我的项目并运行了composer install,php artisan migrate --seed。当我访问我的网站时,我看到我的应用程序的主页很棒!当我尝试转到其他页面时,让我们说/ auth / register我收到错误在此服务器上找不到请求的URL。
以下是我对文件的权限:
drwxr-xr-x 12 root root 4096 Nov 22 16:33 ..
drwxr-x--- 10 apache apache 4096 Nov 22 16:33 app
-rwxr-x--- 1 apache apache 1646 Nov 22 16:33 artisan
-rwxr-x--- 1 apache apache 320 Nov 22 16:33 behat.yml
drwxr-x--- 3 apache apache 4096 Nov 22 16:33 bootstrap
-rwxr-x--- 1 apache apache 1665 Nov 22 16:33 composer.json
-rwxr-x--- 1 apache apache 143064 Nov 22 16:41 composer.lock
drwxr-x--- 2 apache apache 4096 Nov 22 16:33 config
drwxr-x--- 5 apache apache 4096 Nov 22 16:33 database
drwxr-x--- 3 apache apache 4096 Nov 22 16:33 features
drwxr-x--- 8 apache apache 4096 Nov 22 16:33 .git
-rwxr-x--- 1 apache apache 135 Nov 22 16:33 .gitignore
-rwxr-x--- 1 apache apache 503 Nov 22 16:33 gulpfile.js
-rwxr-x--- 1 apache apache 159 Nov 22 16:33 package.json
-rwxr-x--- 1 apache apache 87 Nov 22 16:33 phpspec.yml
-rwxr-x--- 1 apache apache 899 Nov 22 16:33 phpunit.xml
drwxr-x--- 5 apache apache 4096 Nov 22 16:33 public
-rwxr-x--- 1 apache apache 1928 Nov 22 16:33 README.md
drwxr-x--- 5 apache apache 4096 Nov 22 16:33 resources
-rwxr-x--- 1 apache apache 567 Nov 22 16:33 server.php
drwxr-x--- 5 apache apache 4096 Nov 22 16:33 storage
drwxr-x--- 2 apache apache 4096 Nov 22 16:33 tests
-rwxr-x--- 1 apache apache 494 Nov 22 16:33 Vagrantfile
drwxr-x--- 39 apache apache 4096 Nov 22 16:42 vendor
我的虚拟主机文件:
<Directory "/home/spark/public">
Require all granted
</Directory>
<VirtualHost *:80>
ServerName myurl
DocumentRoot "/home/spark/public"
ErrorLog "/var/log/httpd/spark-error"
CustomLog "/var/log/httpd/spark-customlog" Common
</VirtualHost>
答案 0 :(得分:1)
修正了以下内容: Allowoverride All
我的虚拟主机文件现在看起来像这样
<Directory "/home/spark/public">
Require all granted
Allowoverride All
</Directory>
<VirtualHost *:80>
ServerName myurl
DocumentRoot "/home/spark/public"
ErrorLog "/var/log/httpd/spark-error"
CustomLog "/var/log/httpd/spark-customlog" Common
</VirtualHost>
答案 1 :(得分:0)
尝试:
<VirtualHost *:80>
ServerName myurl
DocumentRoot "/home/spark/public"
<Directory "/home/spark/public">
Options Indexes FollowSymLinks
AllowOverride All
Require all granted
</Directory>
ErrorLog "/var/log/httpd/spark-error"
CustomLog "/var/log/httpd/spark-customlog" Common
</VirtualHost>
和sudo restart apache2