Requested URL Not Found - Laravel 5

I am trying to load a web application (which I made using Laravel 5) into a drop of DigitalOcean. But I get 404 Error:

The requested URL / public / login was not found on this server.

This is my apache2.conf

<Directory /> Options FollowSymLinks AllowOverride None Require all denied </Directory> <Directory /usr/share> AllowOverride None Require all granted </Directory> <Directory /var/www/html/hotelguide/public> Options Indexes FollowSymLinks AllowOverride All Require all granted </Directory> 

000-default.conf

 <VirtualHost *:80> ServerAdmin webmaster@localhost DocumentRoot /var/www/html/hotelguide/public ErrorLog ${APACHE_LOG_DIR}/error.log CustomLog ${APACHE_LOG_DIR}/access.log combined </VirtualHost> 

This is my folder structure. This is my folder structure.

This is the result of php artisan: list route This is the result of php artisan: list route

UPDATE: LARAVEL LOG

 Stack trace: #0 /var/www/html/hotelguide/vendor/symfony/console/Application.php(183): Symfony\Component\Console\Application->find('routes') #1 /var/www/html/hotelguide/vendor/symfony/console/Application.php(117): Symfony\Component\Console\Application->doRun(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput)) #2 /var/www/html/hotelguide/vendor/laravel/framework/src/Illuminate/Foundation/Console/Kernel.php(107): Symfony\Component\Console\Application->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput)) #3 /var/www/html/hotelguide/artisan(36): Illuminate\Foundation\Console\Kernel->handle(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput)) #4 {main} 

UPDATE: PHP ERROR LOG (last error)

 124.43.95.22 - - [02/Sep/2016:14:01:29 +0530] "GET /login HTTP/1.1" 500 206 "-" "Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/52.0.2743.116 Safari/537.36" 

After completing the steps described by Alexey, I get an HTTP 500 error message.

UPDATE: HTACCESS FILE

 <IfModule mod_rewrite.c> <IfModule mod_negotiation.c> Options -MultiViews </IfModule> RewriteEngine On # 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> 

UPDATE: CSS AND JS NO ERROR FOUND enter image description here

+5
source share
3 answers

Based on the previous discussion:

  • your APACHE_RUN_USER and APACHE_RUN_GROUP are www-data strong>
  • your owner is /var/www/html/hotelguide/public root and his group is www-pub

The current resolution of your public folder is not suitable for Apache.
Therefore, you must give Apache permission in this directory, and for this you just need to enter the following command:

 chown -R www-data:www-data /var/www/html/hotelguide/ 
+1
source

You need to point Apache to the public directory and restart it:

 DocumentRoot "/var/www/html/hotelguide/public" <Directory "/var/www/html/hotelguide/public"> 

After that, use /login URL instead of /public/login .

0
source

Depending on the location of your project. Add the configuration to httpd.conf as shown below:

 <Directory "/var/www/html/project_name/public"> Allowoverride All </Directory> 
0
source

All Articles