26

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?

Brennan Hoeting
  • 1,213
  • 6
  • 18
  • 28

3 Answers3

53

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.

fideloper
  • 12,213
  • 1
  • 41
  • 38
  • Thanks for replying. I am running version 2.4.6 (Ubuntu). I made the changes, but I'm still getting the 403. I also noticed when I start the server I see "Could not reliably determine the servers fully qualified domain name" which I did not have before, and is odd since I have Servername set on the vhost file. – Brennan Hoeting Oct 20 '13 at 20:31
  • Update: I was able to get regular PHP to render by following these guidelines. If anyone is having a problem with Laravel and not raw PHP, look into reinstalling Mcrypt. Also restart your computer if you make changes and it still doesn't work (I could've saved an hour if I'd known that). – Brennan Hoeting Oct 24 '13 at 11:40
  • @Max Małecki : I just wanted to paste the exact same text :D – nozzleman Jun 05 '14 at 17:49
  • Beautiful, thanks for knowing what needed to change! – Jason O'Neil Aug 23 '14 at 08:39
3

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

Staple
  • 712
  • 1
  • 10
  • 20
  • 2
    `Are mods rewrite and mcrypt healthy?` should not be included in your answer. It should be either a comment or a new question. – John Slegers Mar 06 '16 at 16:57
0

I had a problem where in the routes file (web.php) I had two routes (the same link) but different controller action. The second action was empty that's why it was blank.

For example:

Route::get('/route', 'Controller@firstAction');
Route::get('/route', 'Controller@secondAction');
Petar Vasilev
  • 4,281
  • 5
  • 40
  • 74