Featured Posts

Writing Website Scrapers in PHPWriting Website Scrapers in PHP This article discusses about how to write a website scraper using PHP for web site data extraction. The concepts taught can be applied and programmed in Java, C#, etc. Basically any language that has a...

Readmore

12 common programming mistakes to avoid12 common programming mistakes to avoid Programming is an art and science and like all art and science the only way to learn is from mistakes. I have made many... and I would like to share with you the mistakes that I have made over my journey...

Readmore

7 habits of highly effective freelance programmers7 habits of highly effective freelance programmers I have developed these based on my freelancing experience. Though I have discontinued freelancing, but would like to share my practices with you. These are basic practices and have been developed over...

Readmore

  • Prev
  • Next

Setting up Virtual Hosting in Apache on Windows

Posted on : 29-09-2007 | By : admin | In : Apache Tutorials

0

Setting up Virtual Hosting is easier than you think. You can ignore this step if you want to develop your applications using the http://localhost notation. But in a real case scenario you would like to setup a development environment on your machine to simulate real world conditions.

This tutorial will guide you through the step by step process of how to setup virtual hosting in Apache on Windows. For this example I will be configuring http://dev.sunilb.com as the domain for development purposes. For those of you who don’t have their own domain and/or website to configure, I recommend you seeking advice from a website hosting guide

How to install Apache on Windows

Posted on : 29-09-2007 | By : admin | In : Apache Tutorials

3

So you are interested in working with Apache.

Step 1: Download the package

The first step is to download the package from http://httpd.apache.org/

You should get the latest stable version of the package which is 2.2.6 to the time of this writing. You should download the Microsoft Installer (.msi) package.

Once the package has been downloaded, double click on the icon to run the installation wizard. Click next until you see the Server Information window. Enter localhost for both Network Domain and Server Name. Enter any email that you want for Administrator’s email address.

install-apache-1.png

 

 

Click the Next button and choose Typical installation. Click Next one more time and choose where you want to install Apache. It typically gets installed at C:\Program Files\Apache Group location. Click the Next button and then the Install button to complete the installation process.

Step 2: Verify your Installation

After your installation has been successful, you must open your browser and verify that your installation was indeed successful. Open your browser and type http://localhost. You should get a screen like the one mentioned below:

install-apache-2.jpg

 

By default Apache is configured to read PHP and HTML files from the htdocs folder available under C:\Program Files\Apache Group\Apache2. The location from where PHP and HTML files are stored is called DocumentRoot.

I would recommend that you create a separate folder for your projects and create a virtual hosting for each project to simulate real environment behavior. I follow this principle for my projects/testing. I have a folder by the name C:\sunilbhatia\websites, under which I create sub-folders for each project that I want to execute/develop. Though not a mandate, but you could follow this procedure.

For the time being lets assume that we will be developing our applications under the htdocs folder. In my next article, I will be taking about how to setup virtual domains on your machine.


Notes on Apache Configuration File

Apache stores all configuration details in a file named httpd.conf file. This file is located under the conf folder of the Apache Root folder. Assuming that you installed Apache in C:\Program Files\Apache Group\Apache2 (which is the Apache Root Folder), then the httpd.conf file will be located under C:\Program Files\Apache Group\Apache2\conf\The configuration file for Apache is stored in C:\Program Files\Apache Group\Apache2\conf folder.

Whenever, you change the httpd.conf file you must restart the Apache Server for the changes to be reflected like this: Start > Programs > Apache HTTP Server 2.2.6 > Control Apache Server > Restart

A note of caution, always remember to take a backup of your httpd.conf file before making any changes to it.

You are done with the installation of the Apache Server. Congratulations!!!

After few years, IT persons will face problem without having certified professional status. No doubt that the new coming time is dedicated for 70-631 TS: Microsoft SharePoint Services 3.0 and MCITP 70-443 and 156-315 Check Point Security Administration NGX certified professionals. You should also try to pass the latest Cisco 642-383 CXFF and Cisco DCNS 646-976 Data Center Network Solutions Sales exam.