Before start installing Apache web server you may need to know what is web server actually. A web server is software that listens for requests and returns data. When you hit “www.example.com”, the request is forwarded to a machine running web server software which returns a file or data back to you.
Web server sits between your browser and the requested file. It can process server side code like PHP which connect to a database and finally return data as HTML or xml or json or any other structured data depending on request. You can use your host’s web server but before going live we recommend you to develop in local and they have to be fully tested. What you need is a local web server installation.
I would recommend using Apache for your web server unless you are creating ASP.NET applications on Microsoft IIS. Apache the most widespread and fully-featured web server available. It is open-source project so it will not cost you anything to download or install.
Simple All-in-One packages Solution
Yes there are some excellent all-in-one Windows distributions that contain Apache, PHP, MySQL and other applications all together in a single installation file for quick starter, e.g. XAMPP, WampServer andWeb.Developer. Just go there and download installation package and install by clicking on the package. And you are ready to code in PHP! There is nothing wrong with using these packages, although manually installing Apache will help you learn more about the system and its configuration options.
The Apache Installation Wizard
For novice users or those who installing Apache for the first time we recommend official .msi installation wizard which is available from the Apache download page.
Step 1: configure IIS, Skype (optional)
If you have a Professional or Server version of Windows installed, you may already have IIS installed. You have to remove IIS or disable its services when you want to use Apache.
Apache listens for requests on TCP/IP port 80. If you have Skype installed this can conflicts with Apache. Because the default installation of Skype also listens on this same port. To switch it off, start Skype and choose Tools > Options > Advanced > Connection. And ensure you untick “Use port 80 and 443 as alternatives for incoming connections”.
Step 2: download the files
Download official Windows binary installation file from here. You can use the unofficial Windows binary from Apache Lounge also. This version has performance and stability improvements over the official Apache distribution.
Step3: Install Apache
Now we are going to install Apache on windows 7 running in 32 bit. Installation is so easy! Follow the steps below:
- Unofficial Windows binary from Apache Lounge. Go to http://www.apachelounge.com/download/. Scroll down the page until you find the download for the ‘Apache 2.4.x win32 binaries’ and download. You need to be careful that the module dll in PHP matches the version of Apache you install. Apache won’t load otherwise.
- Unzip the file into C:\. You should see directory ‘Apache24’ (or whatever the latest version is).
- Find Start > All programs > Accessories > Command Prompt
Right click and select ‘Run as administrator’
- Enter the following commands
- cd \Apache24\bin
- httpd -k install
httpd -k start
- Open a web browser and enter the address http://localhost/. You should get a screen up to the effect that Apache is installed and working.