multiple domain/subdomain in localhost

ubuntu server


# create file config for virtualhost

$ sudo nano /etc/apache2/conf.d/virtual.conf

input script to file virtual.conf


# localhost
<VirtualHost *:80>
DocumentRoot "/media/sf_sandbox/"
ServerName localhost
</VirtualHost>

# propertynco virtual host
<VirtualHost *:80>
DocumentRoot "/media/sf_sandbox/propertynco"
ServerName propertynco
</VirtualHost>

edit file /etc/hosts


$ sudo nano /etc/hosts

insert this code to file hosts

127.0.0.1       localhost
127.0.0.1       propertynco

restart/reload apache service


$ sudo service apache2 reload

ping or open website with browser


$ w3m propertynco

w3m-virtualhost

Published by

G3n1k

just to remember what i had known :)

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s