Installing apache2 web server on windows machine

Apache2 is an web server which is widely in use. http://httpd.apache.org/ website hosts it’s source. One will have to download the source and then using Visual Studio one will have to create binaries.

Downloading Apache and Visual Studio

Luckily there are kind folks out there who have alreadycompiled the source and have created the binaries against various Visual Studio versions. Apache Longue is one such source, which can be used to download the binaries.

Got to Apache VS17 binaries and modules download
There you see various VC14, VC 11 etc options. These are various Visual studio versions against the source has been compiled. For my windows 7 machine, I selected the latest one VC14.

In the description text you will find which redistributable c++ version is required to run the apache2 web server build using Visual Studio. We will need to download and install that version. After redistributable c++ version is installed do not forget to restart the machine otherwise apache2 will throw errors when we will try to start it.

Now select the binary version for your machine ( 64 bit os in my case).

Installing Apache

Instructions at Michael Ross, freelance writer and web developer is of great help.

  • Unzip the zip content under some folder. In my case I unzipped it under E:/softwares/apache.

  • Using any text editor, open httpd.conf, locate the line that defines the value of ServerRoot. By default it is c:/Apache24. It needs to be changed to whatever Apache installation directory you chose — in our example, E:/softwares/apache.

  • Find the line where ServerName is commented out. Remove the comment character, and optionally change the value to whatever you wish. The default value, www.example.com:80, is as good as any, at least for local usage, because apparently it does not have to be any meaningful value. If you do not set it to at least some value, then when you start Apache in a Windows terminal (a.k.a. command prompt, a.k.a. DOS box), then you will probably get a warning message: “AH00558: httpd: Could not reliably determine the server’s fully qualified domain name, using ::1. Set the ‘ServerName’ directive globally to suppress this message”.

  • Change the Document Root to to any folder where you will keep the website pages
    DocumentRoot “E:/personal/learnings/apache”

  • Change the Directory path to “E:/personal/learnings/apache” as well

Running Apache

  • Create index.html file having just one <h3>Hello world!</h3> line under E:/personal/learnings/apache directory.
  • Open command prompt. Go apache installation directory ( E:/softwares/apache/bin in my case ). Start http server by typing httpd on commadn prompt. This will start the Apache webserver.
  • Go to http://localhost/index.html, you should see the hello world.