Software Installation

How to install XAMPP

A quick tutorial on how to install the very popular Web Server.

In order to create a complete web application, the first thing to do is to install a Web Server. There are several possibilities, including Apache and Apache Tomcat. In this chapter we will see how to install XAMPP, an Apache distribution, which also contains PHP and MySQL. XAMPP comes as a complete package, which can be installed like any other computer program.

XAMPP can be downloaded from this web address:

Once the package is downloaded, we start the package installation wizard. Select both XAMPP core files and XAMPP developer files. At the end of the installation, we can launch the XAMPP program. In the main screen of the program, there are three menu items: the MySQL database, the FTP server and Apache Web Server. To start Press the buttons START for both Apache and MySql Database. To terminate Apache and MySql use the respective buttons. STOP

Conflicts with other programs

By default the Apache server listens on port 80. However, port 80 could be used by other programs, such as Spotify. To avoid conflicts, close Spotify and the programs that are listening on port 80.

Another possible conflict could be with Skype. In order to solve the problem, and follow Skype, access the Tools menu and then Options, select Advanced menu and then Connection. Deselect the item: Use ports 80 and 443 for additional inbound connections.

Port 80 could be used by Windows for other purposes. Therefore, Apache should be set up to listen on another port. To check if this happens, from XAMPP select netstat and verify that port 80 is used by System. If yes, open the httpd.conf file (from Apache’s configure key), look for the Listen line and replace 80 with 8080. Start Apache. From the browser, the server is now available at this address: http: // localhost: 8080.

Structure of the XAMPP folder

The folder is located under c:\ xampp (in Windows environment) and under Applications (in OS X environment). The folder shows the following structure:

  • bin
  • cgi-bin
  • etc (apache, under Windows)
  • htdocs
  • logs
  • xamppfiles

In our case, the folders of interest are htdocs and etc (apache under Windows). The htdocs folder corresponds to the Document Root, that is, to the root folder where the Apache server searches for the required files. It is the default folder where the files that we want to make reachable from the server must be placed, but it is possible to replace the Document Root with any folder of the file system.

The etc folder (apache under Windows) Contains the configuration files of the development environment. Among these is the httpd.conf file, which allows you to change the document root.

To change the Document Root, search inside the httpd file with the DocumentRoot line and replace in the lines

DocumentRoot "/Applications/XAMPP/xamppfiles/htdocs"
<Directory "/Applications/XAMPP/xamppfiles/htdocs">

with the full path to your file system folder, for example

DocumentRoot "/Users/angelica/Web"
<Directory "/Users/angelica/Web">

Summary

In this tutorial I have illustrated how to install XAMPP, the very popular Web Server. Some applications can generate a conflict with XAMPP, for this reason, it is very important to deal with this problem.

If you wanted to be updated on my research and other activities, you can follow me on Twitter, Youtube and and Github.

Related Articles

Top 1000 Medium Writer in May, June and July 2021. I write on Data Science, Python, Tutorials and, occasionally, Web Applications.

Top 1000 Medium Writer in May, June and July 2021. I write on Data Science, Python, Tutorials and, occasionally, Web Applications.