Sharing Name based Virtual Host over LAN
Create project folder in your webserver folder #
My webserver is Apache
for eg: i created 'our_project' folder in my server i.e /home/auto-w24/public_html/
Creating named Vhost #
In Ubuntu
Create a file in /etc/apache/sites-available folder with the name of you Vhost
for eg:ourserver.local.
Now open the newly craeted ourservre.local file and enter following content.
<VirtualHost *:80>
ServerAdmin webmaster@localhost
ServerName ourserver.local
ServerAlias www.ourserver.local
DocumentRoot /home/auto-w24/public_html/our_project
SetEnv APPLICATION_ENV "development"
Make modifications to your requirements
In terminal
sudo a2ensite ourserver.local
Changes to /etc/hosts file
Open your /etc/hosts file and following line to it
127.0.0.1 ourserver.local www.ourserver.local
Restart apache webserver
Now you should be able access our_project folder in browsesr if you type ourserver.local or www.ourserver.loacl
Settings to access 'our_project' in other systems connecting same network #
In linux ststems like Ubuntu #
Lets assume System-1 as the system in which we have all the above settings and System-2 is a ubuntu system connected to the same network as system-1.
In System-1 find your IP address.
Let us assume System-1 IP is 00.00.00.00
In System-2 open /etc/hosts file and add following line to it
00.00.00.00 ourserver.local www.ourserver.local
Save the file
Now you can access our_project from System-2 in browser by typing either ourserver.local or www.ourserver.local
In windows systems #
Open the hosts file in windows/system32/drivers/ folder
Add following line to it
00.00.00.00 ourserver.local www.ourserver.local
Save the file
Now you can access 'our_project' from this windows system in browser by typing either ourserver.local or www.ourserver.local
In OSX Snow leopard systems #
Open the hosts file private/etc/hosts
Add following line to it
00.00.00.00 ourserver.local www.ourserver.local
Save the file
Now you can access 'our_project' from this system in browser by typing either ourserver.local or www.ourserver.local
- Previous: Curious case of critics
- Next: AAPs angle ... as i see it