Page 1 by Mobify



Page 1 of 6

Geeky Fun

How To Install A Windows Web Server On Your PC With XAMPP by Dave Drager on Feb. 21st, 2011

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:

3/1/2011 by Mobify

Page 2 of 6

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 [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.

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

3/1/2011 by Mobify

Page 3 of 6

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 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\

3/1/2011 by Mobify

Page 4 of 6

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.

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!

(By) Dave Drager (@ddrager) is an Information Technology Manager for a non-profit in West Chester, Pennsylvania and believes in using technology to make life easier. Dave blogs on system administration and technology at systemBash and is also attending University for his Master's Degree in Computer Science.

3/1/2011 by Mobify

Page 5 of 6

1 person liked this.

Showing 8 comments Sort by Oldest first

Subscribe by email

Subscribe by RSS

Josh Fox 1 week ago XAMPP is also a pretty good testing web server for Linux if you don't want to go through installing all of the components manually and configuring. I use it for working on my test site under Ubuntu. It's also nice to have a server that's not ALWAYS running. A lot of people would flame me for using XAMPP on Linux, but I'd rather spend more time working on the site than configuring the server. Like


Dave Drager 1 week ago in reply to Josh Fox Haven't used XAMPP on Linux but I understand why you use it to set things up. Although you can do roughly the same thing by running 'sudo apt-get install apache2 php5 mysql-server' Everything is configured for you and will serve content out of the /var/www directory. Like


Josh Fox 1 week ago in reply to Dave Drager That's true, and I've setup servers like that several times, and FTP is easier to work with. However, if I'm not working on a test site, I don't need the server running. With XAMPP, I just don't install it as a service and only start the server when I intend to use it. This is my main computer after all, so I don't really need a web server running all the time. If and when I use a computer dedicated to being a server, I will do a full install of Apache. Like


jasray 1 week ago I've been using XAMPP for years; it's always getting better. Personally, the portable version makes life much easier. May want to show how to enable SSL and other goodies. And one shouldn't have any error messages. I installed the regular version on Windows 7 Ultimate without any problem. The great thing about the portable version is the ability to copy the entire server to a different computer, etc. Like


Dave Drager 1 week ago in reply to jasray

3/1/2011 by Mobify

Page 6 of 6

Do you use 32-bit or 64-bit Windows 7? From what I read on their support forums, it was only a problem with 64-bit versions (which is what I have). Like


Mike 1 week ago I want to add a link to the BitNami Stacks They offer all kinds of out of the box web servers (including WAMP and LAMP) also with pre-installed web applications and systems like WordPress, Drupal, MediaWiki etc. for Windows, Mac, Linux, virtual machines for VMware and some Cloud hosters Like


triclops200 1 week ago I've been using xampp for about a month now and it is working like a charm, I even got me a dynamic dns server for it and have port forwarding, forgive the downtime, I turnoff my PC at night :P. I have also done some mods to get asp .net with apache because my main language is C#. triclops200.dyndns Like


Terryanderson24 6 days ago Would it be possible to use the server as a backup. So that data from my other laptops can be backed up automatically? Like


Add New Comment Type your comment here.

Post as 

Full Site