简体   繁体   中英

Laravel deployment on ubuntu server

I want to deploy my laravel project on an Ubuntu server but it only shows the welcome page. I tried to login and it keeps telling me that the URL is not found on the server. I already modified my conf file in apache:

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.

It has rewrite Engine all and I already executed apache restart command. 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.

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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