简体   繁体   English

laravel项目不向Apache工匠加载CSS服务正常

[英]laravel project not loading css with apache artisan serve working fine

I've created a Laravel Project, which I have deployed previously with apache2, and working great. 我创建了一个Laravel项目,该项目以前已与apache2一起部署,并且运行良好。

As I finished with my latest deployment, I found that no external CSS was being loaded when I was done with. 在完成最新部署后,我发现完成后没有加载外部CSS。 So I did a check on all step many times over, but I don't think I have missed on anything. 因此,我对所有步骤进行了多次检查,但我认为我没有错过任何事情。

However, upon running with php artisan serve everything works fine. 但是,使用php artisan serve一切正常。

Here is my virtual_host config file: 这是我的virtual_host配置文件:

<VirtualHost *:80>
    ServerAdmin admin@project
    DocumentRoot /var/www/html/project/public/index.php
    ServerName example.com
    ServerAlias www.example.com
    DirectoryIndex index.php

    <Directory /var/www/html/project/public>
            Options Indexes FollowSymLinks
            AllowOverride All
            Require all granted
    </Directory>

    ErrorLog ${APACHE_LOG_DIR}/error.log
    CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>

In virtualhost configuration, you should try using 在virtualhost配置中,您应该尝试使用

<VirtualHost *:80>
    ServerAdmin admin@project
    DocumentRoot /var/www/html/project/public
    ServerName example.com
    ServerAlias www.example.com
    DirectoryIndex index.php

    <Directory /var/www/html/project/>
        Options Indexes FollowSymLinks
        AllowOverride All
        Require all granted
    </Directory>

    ErrorLog ${APACHE_LOG_DIR}/error.log
    CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>

Remove public folder from <Directory> and also remove index.php from DocumentRoot . 卸下public从文件夹<Directory> ,并删除index.phpDocumentRoot

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM