简体   繁体   English

在 ubuntu 服务器上部署 Laravel

[英]Laravel deployment on ubuntu server

I want to deploy my laravel project on an Ubuntu server but it only shows the welcome page.我想在 Ubuntu 服务器上部署我的 Laravel 项目,但它只显示欢迎页面。 I tried to login and it keeps telling me that the URL is not found on the server.我尝试登录,它一直告诉我在服务器上找不到该 URL。 I already modified my conf file in apache:我已经在 apache 中修改了我的 conf 文件:

Alias /hris/imiforms /var/www/apps/hris/imiforms/public
<Directory /var/www/apps/hris/imiforms>
   Option Indexes FollowSymLinks
   AllowOverride All
   Require all granted
</Directory>

and I my .htaccess file is shown below.我的 .htaccess 文件如下所示。

It has rewrite Engine all and I already executed apache restart command.它已经全部重写了 Engine,我已经执行了 apache restart 命令。 Can you help me and telling me what is wrong?你能帮我告诉我有什么问题吗?

<IfModule mod_rewrite.c>
    <IfModule mod_negotiation.c>
        Options -MultiViews -Indexes
    </IfModule>

    RewriteEngine On

    # Handle Authorization Header
    RewriteCond %{HTTP:Authorization} .
    RewriteRule .* - [E=HTTP_AUTHORIZATION]
{HTTP:Authorization}]

    # Redirect Trailing Slashes If Not A
    RewriteCond %{REQUEST_FILENAME} !—d
    RewriteCond %{REQUEST_URI} (.+)/$
    RewriteRule ^ $1 [L,R=30l]

    # Handle Front Controller...
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteRule ^ index.php [L]
</IfModule>

I see in your apache configuration an alias, but you don't use it.我在您的 apache 配置中看到一个别名,但您没有使用它。

You need to set your full directory like that, or use the alias defined before instead of full path:您需要像这样设置完整目录,或者使用之前定义的别名而不是完整路径:

<Directory /var/www/apps/hris/imiforms/public>
   ...
</Directory>

The /public part is very important because it is the Laravel entry point. /public部分非常重要,因为它是 Laravel 的入口点。

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

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