首页 文章

如何在Server上部署laravel项目?

提问于
浏览
0

我在digitialocean上构建了一个linux服务器,并安装了从github到/ var / www / html /的软件和克隆laravel文件 . 我收到这个错误

"The 138.68.81.200 page isn’t working" in http://138.68.81.200/socialNetwork/public/

即使上传迁移并创建.env文件和storage / * 777权限 .

我怎么解决这个问题 ?

1 回答

  • 0

    假设您已经通过composer安装了所有php包和依赖项以及所有项目供应商 . 你只需要将其添加到 /etc/apache2/sites-available/000-default.conf

    Alias /socialNetwork /var/www/html/socialNetwork/public/
    <Directory "/var/www/html/socialNetwork/public">
            AllowOverride All
            Order allow,deny
            allow from all
    </Directory>
    

    然后在_1464306中添加:

    Options +FollowSymLinks
    RewriteEngine On
    
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteRule ^ index.php [L]
    

    之后:

    sudo service apache2 restart
    

相关问题