Friday 24 May 2013

Setting Up Virtual Hosts in XAMPP

PURPOSE
Setting Up Virtual Hosts in XAMPP

ENVIRONMENT

  • XAMPP 1.8.1


Steps
  1. Open  C:\windows\system32\drivers\etc\hosts with admin privilege
  2. Add "127.0.0.1      Site.com" at the end of the file and save
  3. Edit C:\xampp\apache\conf\extra\httpd-vhosts.conf and add the following
NameVirtualHost *:80
  <VirtualHost *>
    DocumentRoot "C:\xampp\htdocs"
    ServerName localhost
    ErrorLog "logs/localhost-error.log"
    CustomLog "logs/localhost-access.log" combined
  </VirtualHost>

  <VirtualHost *>
    DocumentRoot "C:\xampp\htdocs\phpacademy.com"
    ServerName phpacademy.com 
    ErrorLog "logs/phpacademy.com-error.log"
    CustomLog "logs/phpacademy.com-access.log" combined
  <Directory "C:\xampp\htdocs\phpacademy.com">
    Order allow,deny
    Allow from all
  </Directory>
</VirtualHost>



No comments:

Post a Comment