2

I am running Ubuntu Gnome 14.04, I apt-get installed apache2, php and mysql. From there, localhost was working fine, running from the /var/www/html/ directory.

I created a new file, /etc/apache2/sites-available/laravel.example.conf, and mimicked the 000-default.conf file that already existed in that folder:

<VirtualHost *:80>
    ServerName      laravel.example
    ServerAlias     www.laravel.example
    ServerAdmin [email protected]
    DocumentRoot /var/www/sites/laravel.example
    ErrorLog ${APACHE_LOG_DIR}/laravel.example_error.log
    CustomLog ${APACHE_LOG_DIR}/laravel.example_access.log combined
</VirtualHost>

# vim: syntax=apache ts=4 sw=4 sts=4 sr noet

I created the folder at /var/www/sites/laravel.example, added in 127.0.0.1 laravel.example to /etc/hosts, ran a2ensite laravel.example.conf, restarted apache, but still just get Web page not available when I try load it. Any ideas?

4
  • My guess is a permissions problem. what are the ownership and permissions if the directory and files?
    – Panther
    Aug 30, 2014 at 23:22
  • Have you tried doing http://laravel.example/ in your web browser?
    – Kaz Wolfe
    Aug 30, 2014 at 23:26
  • @bodhi.zazen bingo. just fixed it after i asked after chown and chmodding the /var/www/ directories
    – user322170
    Aug 30, 2014 at 23:30
  • Close-voter(s): Questions are only off-topic as "a problem that can't be reproduced" when they went away and there is no real solution known. Here, the OP has self-answered with a solution that may help others. Sep 7, 2014 at 3:35

2 Answers 2

1

You need to set ownership / permissions of the directories and files to e readable by www-data

Personally I use:

sudo chown -R root:www-data /var/www
chmod 750 /var/www/sites
chmod 750 /var/www/sites/sites/laravel.example
chmod 640 /var/www/sites/sites/laravel.example/*
1

As mentioned in my comment, I fixed this issue by chowning the /var/www/ directory recursively to my current user, and chmodding the directory to 755, restarted and it seemed to be working, so hopefully this was the actual fix.

You must log in to answer this question.