PDA

View Full Version : [SOLVED] .local domain set-up



H3110
March 7th, 2012, 02:12 AM
Hi All,

I wanted to allow <DOMAIN>.com.local to work. Time simple way was CORRECTLY editing your hosts (typos clearly don't help you).

But to be more helpful I will help explain how I got the basic LAMP set-up locally with .local domains working.

1. Installing the LAMP set-up (obviously the quick-way).


$ sudo apt-get update && sudo apt-get install -y php5 apache2 libapache2-mod-php5 mysql-server subversion

Then we edit our hosts to configure our example.local domain.


$ sudo vi /etc/hosts

127.0.0.1 example.local

Then we edit the apache config to allow multiple virtual hosts..


$ cd /etc/apache2/sites-available/ && sudo vi example.local


<VirtualHost *:80>
ServerAdmin webmaster@localhost
ServerName www.example.local
ServerAlias example.local

DirectoryIndex index.html index.php
DocumentRoot /var/www/example.local

ScriptAlias /cgi-bin/ /var/www/example.local/cgi-bin
Alias /doc/ "/usr/share/doc/"

<Directory />
AllowOverride None
Options FollowSymLinks
</Directory>
</VirtualHost>

Finally, we enable the apache site, and reload the config.

sudo a2ensite exmaple.local && sudo apache2ctl graceful

And you're done (: