Create Virtual host for Apache on Windows 10 by Using XAMPP.

Ahmed Thaajwer
Feb 23, 2019 · 3 min read

Nowadays many developers, small businesses, and even large businesses rely on Apache to power their website on a daily basis. Apache was mainly designed to run on linux servers, but has since been ported to run on any operating system.So here we can use apache on windows operating system too.

In this blog, I am going to explain how you can setup and configure virtual hosts for drupal website with XAMPP running on windows 10.

STEP 01

First, you have to stop apache server in XAMPP control panel.

STEP 02

Then,you need to go C:\xampp\apache\conf\extra

Then,edit httpd-vhosts.conf with text editor. Here i edit with notepad++

STEP 03

After editing with text editor you will see like this.

STEP 04

Then uncomment the NameVirtualHost *:80 ,

STEP 05

Then, go to the down of the page and copy following code and paste it.

DocumentRoot: The folder where files of a site will exist. in this case my drupal site folder name is D6-technology.

ServerName: This is the URL for our virtual host.i am using my url as www.d6technology.lk

Directory: This is the directory of our virtual host.

Then save that folder…

STEP 06

Then you need to go C:\Windows\System32\drivers\etc , It look something like this.

Then edit the hosts file in your text editor.it look like this.

At the bottom of the file just type,

127.0.0.1 [ServerName]

Then save hosts file.

Note FOR Drupal Virtual Host:

C:\xampp\htdocs\D6-Technology\sites\default go to this path in your drupal site ,check whether there is a setting.php file.if it is you have to change like this.

In the bottom of the folder you have to add this code => ‘^www\.example\.com$’, →server name

Important: Then go to the Xampp control panel and start apache server.

STEP 07

Once you are done, check whether by browsing your servername URL(www.d6technology.lk)

D6 Digital

D6 Digital provides total business solutions to improve…

D6 Digital

D6 Digital provides total business solutions to improve efficiency and productivity of your business processes using a combination of existing technology and innovative methods.

Ahmed Thaajwer

Written by

B.Sc.(hons) in Computing & Information System(SUSL). Former Software Engineer@D6 Digital. IEEE Brand Ambassador@IEEE. Regional Country Director@UYG.

D6 Digital

D6 Digital provides total business solutions to improve efficiency and productivity of your business processes using a combination of existing technology and innovative methods.

Medium is an open platform where 170 million readers come to find insightful and dynamic thinking. Here, expert and undiscovered voices alike dive into the heart of any topic and bring new ideas to the surface. Learn more

Follow the writers, publications, and topics that matter to you, and you’ll see them on your homepage and in your inbox. Explore

If you have a story to tell, knowledge to share, or a perspective to offer — welcome home. It’s easy and free to post your thinking on any topic. Write on Medium

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store