Skip to content

Instantly share code, notes, and snippets.

@lelotnk
Created May 9, 2013 01:25
Show Gist options
  • Save lelotnk/5544916 to your computer and use it in GitHub Desktop.
Save lelotnk/5544916 to your computer and use it in GitHub Desktop.
Habilitar Laravel4 no localhost (ubuntu)
First create an additional vhosts file, for example /etc/apache2/sites-available/laravel
<VirtualHost *:80>
ServerAdmin webmaster@localhost
ServerName laravel.dev
ServerAlias *.laravel.dev
DocumentRoot /var/www/laravel/public
</VirtualHost>
Then update your /etc/hosts file and add
127.0.0.1 laravel.dev
This will make a sim link in /etc/apache2/sites-enabled to your vhost config file.
sudo a2ensite laravel
Finally restart your server:
sudo service apache2 restart
You should be able to connect with the url http://laravel.dev, and your rewrites should be working.
----
If you need, run the following command in Terminal to enable mod_rewrite.
sudo a2enmod rewrite
Now restart Apache.
sudo service apache2 restart
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment