In this chapter we are going to explain how to install Apache 2.x server.

Unix platform

UNIX - Apache is installed with a few commands on UNIX operating platform. It follows the same process to install as any other software. It includes downloading the software, extracting the software, installation and at last configuration. After downloading the web server from the official Apache website, following steps are to be done:

NOTE: Installation is done in command line mode.
  • $        gzip -d httpd-xx.tar.gz
  • $        tar xvf httpd-xx.tar

These commands will unzip the downloaded file and make it ready to configure and compile. But before that, change the directory to the extracted folder.

  • $        ./configure --prefix= /usr/local/apache2.x
  • $        make
  • $        make install

Configuration, compilation and installation are done with the above mentioned commands. Then customize the configuration file with the set up path and test the installed Apache.

  • $        vi /usr/local/apache2.x/conf/httpd.conf
  • $        /usr/local/apache2.x/apachectl -k start

Windows platform

Windows - Compiling Apache on windows can be difficult, therefore, the binary packages such as XAMPP, WampServerApache Lounge, etc... are recommended. Installation of binary requires Microsoft installer 2.0 or above and later version of Windows 2000. The following steps are most likely to be followed:

  • Download Apache.msi file and run it.
  • Enter the network domain (DNS domain).
  • Enter own server name (DNS name).
  • Enter Administrator’s email address.
  • Enter the information of which users can use it and the port number.
  • Customize the installation if you may.
  • Enter the location of the installation.

Configurations are done during installation of the web server. The configuration can be changed in case it’s needed from conf folder. After installation, the server can be tested from htdocs folder. Any file having the name index.html will run as default webpage in the local server, but alternatives may be index.php, default.html, default.php or others if redirecting is used in the websitr conf itself.


›› go to examples ››