XAMPP Virtual Host Configuration on Windows

XAMPP is a open source  web server package bundles of (Apache, PHP, Mysql , FTP  & Tomcat Apache).

Installation and virtual hosting configuration on XAMPP server on Windows7 / Windows 2003 / Windows 2008.

XAMPP server  installation & configuration guide have prepared for following platform and services

Operating System       : Windows 7 32 bit

XAMPP webserver        : XAMPP 32 bit

IP Address             : 192.168.1.9

XAMPP Installation Steps :

Step 1 : Download and install XAMPP server

Step 2 : XAMPP virtual hosting configuration

Step 3 : Verify configuration

Let us see the steps in Details :

Step 1 : Download and install XAMPP server

1.1 Download latest version of XAMPP server software package from following URL

http://citylan.dl.sourceforge.net/project/xampp/XAMPP%20Windows/1.8.2/xampp-win32-1.8.2-5-VC9-installer.exe

1.2 Install as administrator xampp-win32-1.8.2-5-VC9-installer.exe .

In our guide we are going to install xampp in c:\ Drive (C:\xampp) , installation location can be changed while installing it.

Step 2 : XAMPP virtual hosting configuration

2.1 The Main configuration file to host virtual hosting Disk Drive:\xampp\apache\conf\extra\httpd-vhosts.conf

(Ex: C:\xampp\apache\conf\extra\httpd-vhosts.conf)

2.1 Uncomment below line in httpd-vhosts.conf

NameVirtualHost *:80

2.2 Add below entries to host website contents to a domain name / sub domain in httpd-vhosts.conf, in our configuration guide we are using demo.com and demo.com for virtual hosting configuration purpose.

<VirtualHost *:80>

ServerAdmin postmaster@demo.com

DocumentRoot “c:\xampp\htdocs\demo.com”

ServerName demo.com

ServerAlias www.demo.com

ErrorLog “logs/demo.com-error.log”

CustomLog “logs/demo.com.log” combined

</VirtualHost>

 

<VirtualHost *:80>

ServerAdmin postmaster@domain.com

DocumentRoot “c:\xampp\htdocs\demo.com”

ServerName demo.com

ServerAlias  www.demo.com

ErrorLog “logs/domain.com-error.log”

CustomLog “logs/domain.com-access.log” combined

</VirtualHost>

2.3  Create two folders under c:\xampp\htdocs\demo.com and

c:\xampp\htdocs\demo.com

upload  .html files under demo.com and solutions folders as created in above step(index.html and other assoicated html files)

index.html (demo.com)

<html>

<body>

<h1>Welcome to demo.com </h1>

</body>

</html>

index.html (demo.com)

<html>

<body>

<h1>Welcome to demo.com </h1>

</body>

</html>

2.4 Create a DNS record of demo.com and demo.com in order to  point it webserver IP. or else you can use hosts file located in Windows\System32\dirvers\etc\hosts.

add below host entries to map IP to hostname / domain name.

Note : Make sure to open hosts file as administrator otherwise changes made in can’t be saved due to permissions

192.168.1.9 demo.com

192.168.1.9 www.demo.com

192.168.1.9 demo.com

192.168.1.9 www.demo.com

Save & Exit!

2.5 Restart / Reload Apache service , changes to take effect.

Step 3 : Verify configuration

3.1 Run ping utility to verify domain name are correct mapped to webserver IP.

3.2 Invoke web browser to launch URL as configured in step 2.

Thanks For Watching.

For more details you can watch Video and also subscribe for more Videos :

 

Both comments and pings are currently closed.

Comments are closed.

Copyright ©Solutions@Experts.com
Copyright © NewWpThemes Techmark Solutions - www.techmarksolutions.co.uk