How to create virtual host using Apache


Just go to \xampp\apache\conf\extra\httpd-vhosts.conf and open the file. After open the file write a block of code just like this,

NameVirtualHost *:80
// default localhsot
<VirtualHost *:80>
DocumentRoot “c:/wamp/www/”
ServerName localhost
ServerAlias localhost
</VirtualHost>

// Virtual host
<VirtualHost *:80>
DocumentRoot “C:\wamp\www\projectName\public”
ServerName projectName.localhost
ServerAlias projectName.localhost
</VirtualHost>

After completing this section go to the host file to the path C:\WINDOWS\system32\drivers\etc

and open the file hosts  127.0.0.1       ZendFramework.com

Advertisements

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