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.
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:
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.
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 ”, 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.
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.
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.
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 toof 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:
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.
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.
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!