HOME BLOG PORTFOLIO PHOTO CONTACT
How to make virtual host in wamp apache and mamp

How to make virtual host in wamp apache

Close your eyes for 2 minute then relex.
Step1: Open
C:/WINDOWS/system32/drivers/etc/hosts file in pspad
then it looks like
# 102.54.94.97 rhino.acme.com # source server
# 38.25.63.10 x.acme.com # x client host

127.0.0.1 localhost

now add this line

127.0.0.1 admin.com

now it look like this structure

# 102.54.94.97 rhino.acme.com # source server
# 38.25.63.10 x.acme.com # x client host

127.0.0.1 localhost
127.0.0.1 admin.com

and save it

Step2: open
F:/wamp/bin/apache/apache2.2.6/conf/httpd.conf
now go to the end of page and add your project like me(in my condition), I have added these lines
#Include “F:/wamp/www/admin/”
<VirtualHost 127.0.0.1>
ServerAdmin your@email.com
DocumentRoot F:/wamp/www/admin/
</VirtualHost>

so, it look like this:
<IfModule ssl_module>
SSLRandomSeed startup builtin
SSLRandomSeed connect builtin
</IfModule>

Include “F:/wamp/alias/*”
#Include “F:/wamp/www/admin/”

<VirtualHost 127.0.0.1>
ServerAdmin your@email.com
DocumentRoot F:/wamp/www/admin/
</VirtualHost>

congrates then restart your wamp server
and write in IE or any browser

http://admin.com

Work done

 

Making Virtual host in mamp

Actually multiple virtual host work in this way

NameVirtualHost *
<VirtualHost *>
DocumentRoot "/Users/jaybharat/Desktop/im-mac-desktop/php-mamp-wamp"
ServerName localhost
</VirtualHost>

<VirtualHost *>
DocumentRoot "/Users/jaybharat/Desktop/im-mac-desktop/php-mamp-wamp/crop_live/"
ServerName jay1.local
</VirtualHost>

<VirtualHost *>
DocumentRoot "/Users/jaybharat/Desktop/im-mac-desktop/php-mamp-wamp/synth-gm/"
ServerName jay2.local
</VirtualHost>

Above line for the file of httpd.conf  (/Applications/MAMP/conf/apache/httpd.conf)

and below lines for the file of hosts  (/private/etc/hosts)
127.0.0.1    localhost
127.0.0.1    jay2.local
127.0.0.1    jay1.local

Now restart the apache and multiple virtual host is ready to work ex:
jay2.local:8888
jay2.local:8888
http://localhost:8888/


 

   Share on Facebook

Page views:3