Some of our articles here on MakeUseOf require the use of your own web server. Although the easiest way to go about finding web space is to purchase hosting where a web server is already set up for you, a free and almost-as-easy to use option is to install a server on your local home computer. We have covered WAMP previously and now I would like to update the topic with a software package known as XAMPP.

XAMPP is a collection of software that includes Apache, MySQL, PHP and Perl. It also includes Tomcat, FileZilla FTP server and Mercury Mail for sending emails. These packages are used for the following tasks:

  • Apache - Web Server, hosts content at http://localhost/
  • MySQL - Database Server, many software packages use this to store data
  • PHP - Programming language, many modern programs use this as a language
  • Perl - Programming language, many programs use this language and has been around longer than PHP
  • Tomcat - Server used to execute Java programs
  • FileZilla - FTP server used to transfer files to/from your local machine (only necessary if you need access remotely)
  • Mercury Mail - Mail system used for sending emails

These programs work together to give you a very robust environment for hosting web programs on your local machine.

Getting Started

Download the correct program for your operating system. This tutorial will go over the Windows version, but the MacOS X, Linux and Solaris versions are very similar. Run the installer and click OK on any security dialogs that pop up. When you get to the following menu:

install windows web server

I would suggest checking off Apache and MySQL as a service as this will allow you to better manage this software later.

When finished, click "Yes" to start the control panel.

windows web server

There is a bug if you are running 64-bit versions of Windows (Vista, 7 or Server 2008). It will say "XAMPP Component Status Check Failure [3]", but it is safe to ignore this error as everything else seems to work fine.

I also received several popups after installing the software. One was from Microsoft Security Essentials asking to send the FileZilla binary to them for analysis (this software can sometimes be used in backdoors - however this use is legitimate) and also the Firewall will pop up a few boxes asking if you want to allow the port to be used. Leave the checkbox unchecked so that your server will not be available over public wifi and other open networks (for example if you connect at a Starbucks), but to still allow your server to be available from your local PC and other computers in your own private network.

Once the control panel is up, click "Start" on Apache and MySQL.

windows web server

Your web server is now up and running, if all went properly!

Managing Your Server

The first thing you should do is click the "Admin..." button for Apache. This will launch your default web browser and send you to the Welcome page. If it gives you the option, click your language (in this case, English) and you will see your administration area.

windows web server

One of the first things to explore are the sample programs. Under the PHP list they include several programs which demonstrate the sorts of things PHP can do.

The "Status" page will show you which services are currently activated. They should all be green except for FTP, SMTP and Tomcat.

set up web server

Next up is ensuring the security of your server. By default there is no password for your MySQL's administrator account, also known as "root". If you are on a small local network and you do not care who has access to the data stored in your machine then it is fine to leave this as is; however if you plan on opening your server up to the internet or you have roomates who you may not fully trust it is good to add a password to this account. You can follow the links to set up security of your system. The first option sets a root MySQL password and the second puts a password on your entire web directory.

Finally, if you plan on accessing your server outside of your home, you will need to log into your router and forward port 80 to your local machine. This is much easier to do if you are set up on a static IP address.

Installing Programs On Your Server

The main thing you need to know about where your server stores data is that it is in a subdirectory of your installation directory named htdocs. In my situation the web directory is:

C:\xampp\htdocs\

This includes the administration program. The default page your web server loads when you visit http://localhost/ is index.php. You can open that file to replace it with your own text or remove it altogether, it is really up to you.

install windows web server

Now that you have a web server set up, what can you do with it? Well one popular thing you can do is to set up wordpress locally. You can set up your own mixtape or even a proxy server, the possibilities are endless.

Really what you get out of it is the ability to learn something new and provide an environment that allows you to create and modify code in a very easy way. Although this server is not meant for production use, it does give you a very reliable development environment and sandbox to learn the ropes, so to speak.

What's Next?

After you have your server up and running, the world is your oyster. Install and run that software you've always wanted to test out. The Apache Friends FAQ page has a lot of information on XAMPP and extended options, check there to take your install further. If you have any problems or questions about your setup, ask below and we'll be sure to help you out!