Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

403 error on Apache for a laravel project, after upgrade to Ubuntu 13.10

I upgraded to Ubuntu 13.10. At first when running apache after the update, there were missing/broken files, so I simply re-installed apache. I backed up the vhost file.

When trying to access my Laravel project from the browser, it get a 403 error. I have changed the permissions of the root folder multiple times, but it is still forbidden. I do not believe this is a laravel problem, as I already fixed it on 13.04, and I am using the same files.

Here is my 000-default.conf file, located in /sites-enabled and /sites-available. My apache2.conf file is unchanged since install.

<VirtualHost *:80>     DocumentRoot /home/brennan/development/MasonACM/public      <Directory />         Options FollowSymLinks         AllowOverride None     </Directory>      <Directory /home/brennan/development/MasonACM/public/>         Options Indexes FollowSymLinks MultiViews         AllowOverride All         Order allow,deny         allow from all     </Directory>      ErrorLog /var/log/apache2/error.log     LogLevel warn     CustomLog /var/log/apache2/access.log combined </VirtualHost> 

It should also be important to note that my .htaccess file is not missing, and hasn't been changed since the site was working on 13.04.

UPDATE:

I have apache's host settings working now, but now the browser is displaying the actual code of index.php, meaning apache isn't using php for some reason. I just checked that php was installed, so why wouldn't apache recognize it?

like image 234
Brennan Hoeting Avatar asked Oct 20 '13 19:10

Brennan Hoeting


People also ask

How do I fix 403 Forbidden error in Ubuntu?

If the file or any similar files are not found, and directory index listings are disabled, the web server displays the '403 Forbidden' error message. To fix the issue, add a default directory index. 3. Make sure there is a file in the webroot folder with this name and upload it if it's missing.


2 Answers

Apache2 may have also been upgraded to version 2.4, and there are a few things to note.

First, do you have Apache 2.4.x+ now? Check by running:

$ apache2 -v 

If so, your vhost needs some adjustment:

First: +/- on Options:

Some Options parameters needs the +/- syntax. Read more here. This might be especially important when mixing +/- on some directives (read the previous link to see more).

Change:

Options Indexes FollowSymLinks MultiViews 

to:

Options +Indexes +FollowSymLinks +MultiViews 

Second: Allow/Deny

Apache now does access control via mod_authz_host

Change:

Order allow,deny Allow from all 

to:

Require all granted 

Some more info here on upgrading from Apache 2.2 to 2.4.

like image 108
fideloper Avatar answered Oct 12 '22 15:10

fideloper


I had the same problem, for some reason restarting Apache with Sudo made a difference. Are mods rewrite and mcrypt healthy?

like image 29
Staple Avatar answered Oct 12 '22 16:10

Staple