Skip to content

Instantly share code, notes, and snippets.

@hemantajax
Created March 17, 2013 08:24
Show Gist options
  • Select an option

  • Save hemantajax/5180658 to your computer and use it in GitHub Desktop.

Select an option

Save hemantajax/5180658 to your computer and use it in GitHub Desktop.
set-virtual-host
How to set virtual host in windows 7:
1: C:\xampp\apache\conf\extra\httpd-vhosts.conf
add below lines:
<VirtualHost *:80>
DocumentRoot "C:\xampp\htdocs\l3.2\public"
ServerName "site.dev"
</VirtualHost>
2: C:\Windows\System32\drivers\etc\hosts
add below line:
127.0.0.1 site.dev
How to access localhost websites after creating virtual host:
To get it work please follow these steps:
in httpd.conf in C:\wamp\bin\apache\apache2.2.22\conf\httpd.conf find entry: #Include conf/extra/httpd-vhosts.conf and uncomment it
in httpd-vhost.conf add two configurations One for project you need to have virtual host set For example:
<VirtualHost *:80>
ServerAdmin pimcore.test
DocumentRoot "C:\wamp\www\pimcore-latest"
ServerName pimcore.test
ErrorLog "logs/pimcore.test.log"
CustomLog "logs/pimcore.test.log" common
</VirtualHost>
Now You need to set another virtualhost, just to have local host working like before setting first virtual host, so put following (also in httpd-vhost.conf)
<VirtualHost *:80>
ServerAdmin localhost.admin
DocumentRoot "C:\wamp\www"
ServerName localhost
</VirtualHost>
- Also You need to have following entries in C:\WINDOWS\system32\drivers\etc\hosts:
127.0.0.1 localhost
127.0.0.1 pimcore.test
of course these will vary depends of Your virtual server names.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment