一直在搜索关于在我的Linux mint 18.2系统上运行apache 2.4的配置laravel 5.4的最近3天之外,什么都无法访问。当apache服务器启动时,我手动在浏览器中输入localhost,它确实显示了laravel的默认主页,但是当我尝试通过实时预览在括号中进行访问时(实时预览基本URL:http://localhost作为我的laravel项目专业人员的谎言在/ var/www/html /中),但它会引发与我的apache配置中的错误相对应的内部服务器错误。因此,我在apache2和apache2的启用站点的目录中提出了我的.htaccess文件000-default.conf文件。 conf文件: 一件重要的事情:手之前,我有在/ var/WWW我的项目文件夹PRO/HTML/我的Laravel项目除了主页
1. 000-default.conf(sites-enabled)
<VirtualHost *:80>
ServerName localhost
ServerAdmin [email protected]
DocumentRoot /var/www/html/pro/public
<Directory /var/www/html/pro/public>
Options Indexes +FollowSymLinks
AllowOverride All
Require all granted
</Directory>
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>
2. apache2.conf
Mutex file:${APACHE_LOCK_DIR} default
PidFile ${APACHE_PID_FILE}
Timeout 300
KeepAlive On
MaxKeepAliveRequests 100
KeepAliveTimeout 5
User ${APACHE_RUN_USER}
Group ${APACHE_RUN_GROUP}
HostnameLookups Off
ErrorLog ${APACHE_LOG_DIR}/error.log
LogLevel warn
IncludeOptional mods-enabled/*.load
IncludeOptional mods-enabled/*.conf
Include ports.conf
<Directory />
Options FollowSymLinks
AllowOverride None
Require all denied
</Directory>
<Directory /usr/share>
AllowOverride None
Require all granted
</Directory>
<Directory /var/www/html/>
Options Indexes FollowSymLinks
AllowOverride None
Require all granted
</Directory>
AccessFileName .htaccess
<FilesMatch "^\.ht">
Require all denied
</FilesMatch>
IncludeOptional conf-enabled/*.conf
IncludeOptional sites-enabled/*.conf
Include /etc/phpmyadmin/apache.conf
3 .htaccess (/var/www/html/pro/public/.htaccess)
<IfModule mod_rewrite.c>
<IfModule mod_negotiation.c>
Options -MultiViews
</IfModule>
RewriteEngine On
RewriteBase /var/www/html/pro/public/
# Redirect Trailing Slashes If Not A Folder...
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)/$ /$1 [L,R=301]
# Handle Front Controller...
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule^index.php [L]
# Handle Authorization Header
RewriteCond %{HTTP:Authorization} .
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
</IfModule>
谢谢!
您是否通过本cmd :: php artisan serve为您服务laravel项目? –
@GauravGupta是的,我发布这个问题本身之前做到了!这是唯一的原因,我可以看到我的主页运行,没有别的 – acaman