I'm pretty close to doing what I want, but alas, the solution to the final hurdle eludes me. Essentially I'm trying to get to a position where I can host multiple sites on one vb and access them using a simple url from either machine...
My setup:
Windows 7 host which contains an entry in hosts file which reads: 192.168.0.30 laravel.dev
I have a DHCP reservation for this address, which reserves it for my virtualbox's unique mac address
Virtualbox is set up with a bridged network adapter and promiscuous mode: allow all (not sure if this is necessary) I have made no changes to the hosts file on guest os.
I have created a new file named laravel.dev at /etc/apache2/sites-available
called laravel.dev
and edited it as follows:
<VirtualHost *:80>
ServerAdmin webmaster@localhost
ServerName *.laravel.dev
DocumentRoot /var/www/laravel.dev/public/
<Directory />
Options FollowSymLinks
AllowOverride None
</Directory>
<Directory /var/www/laravel.dev/public/>
Options Indexes FollowSymLinks MultiViews
AllowOverride None
Order allow,deny
allow from all
</Directory>
ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
<Directory "/usr/lib/cgi-bin">
AllowOverride None
Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
Order allow,deny
Allow from all
</Directory>
ErrorLog ${APACHE_LOG_DIR}/laravel_error.log
# Possible values include: debug, info, notice, warn, error, crit,
# alert, emerg.
LogLevel warn
CustomLog ${APACHE_LOG_DIR}/laravel_access.log combined
</VirtualHost>
I have then enabled it (I thought) by typing sudo a2ensite laravel.dev
and restarting apache
Current Situation:
So at the moment I can access by web root (/var/www/
) from the host by typing http://laravel.dev/
in my address bar and I can access it from my guests browser by typing localhost
I can access my projects index file (/var/www/laravel.dev/public/index.php
) from the host by typing http://laravel.dev/laravel.dev/public
in my address bar and I can access it from my guests browser by typing localhost/laravel.dev/public
What I want
This is OK but what I would like is to be able to access the root of my site (/var/www/laravel.dev/public/index.php
) by simply typing laravel.dev in the address bar of either machine - Can anyone explain what I'm doing wrong here. I would be eternally grateful.
Additional info requested:
result of ls -l in /etc/apache2/sites-enabled/
total 0
lrwxrwxrwx 1 root root 26 Feb 26 17:16 000-default -> ../sites-available/default
lrwxrwxrwx 1 root root 30 Feb 26 18:27 laravel.dev -> ../sites-available/laravel.dev
...happy to provide any other info which may help solve this.
Also, other than install the lamp stack. I really haven't done anything other than what is listed here - if I haven't mentioned I probably haven't done it so ANY suggestions are appreciated. Safe to assume your dealing with a linux noob... no offense will be taken.