How To Configure Apache on Windows Server

When you start the HTTP server, this will give you the opportunity to host a website and upload files for downloadIf you want this web server to work well, you can install the ready-made XAMPP package. It includes Apache, PHP, MySQL.

Apache installation

You need to download the MSI installer for your Windows, it can be found on the Apache download page(http://httpd.apache.org/download.cgi),
filling in all the necessary data. After starting this installer, Apache Monitor will be installed. You cannot monitor the status of all Apache services. This can be done from your Windows » services.msc
Now you can connect to your server http://127.0.0.1 and see the default Apache page.

Also, it is possible to edit, delete and add web files from your web server. To do this, make changes to the htdocs folder in the Apache folder. This location is the default for web files. Alternatively, you can use virtual hosts to use other directories or configure subdomains.

By the way, Apache has two configuration files: 

  • .htaccess It is applicable based on all directories in web files
  • httpd.conf inside Apache’s conf folder, he makes a request to the main configuration

PHP Installation

PHP has the function of using PHP scripts on your web server and display the results for all users

First of all, download the PHP version for Windows from the PHP download for Windows here: (https://windows.php.net/download).
Then you need to download this version and unzip the zip file to c: \ php.

After successful unpacking zip file need edit apache httpd.conf to enable

LoadModule php5_module "c:/php/php5apache2_2.dll"
AddType application/x-httpd-php .php
PHPIniDir "C:/php"

After that, you will need to restart the Apache web server; for testing PHP it is recommended to create test.php, in its htdocs folder, the contents are indicated below:

<?php phpinfo() ?>

Then check the output on

https: //127.0.0.1/test.php

This completes the configuring

Was this article helpful?

Related Articles

Leave A Comment?