Guess what, this post is going to do exactly what it says on the tin. If you have come here from the last post, you will know that I promised in this tutorial we would be installing Apache, the most common web server for the budding web developer.
We will be installing a web sever stack called XAMPP. A stack is simply a number of complimentary programs, modules or applications that work together to solve a problem or need. In this case, our need is for web server, and by installing XAMPP we will conveniently get everything we need to start serving our own web pages. XAMPP is an acronym, so lets find out what each letter stands for, and get to understand what XAMPP is a bit better.
X – Cross Platform
You will notice on the title of this post that I specify we will be installing on the Window’s operating system. Other operating systems or platforms you could be using are Macintosh or Linux. This post will only go through the steps for Windows.
Now XAMPP is also available as WAMP, LAMP and MAMP. You can maybe guess that W = Windows, L = Linux and M = Mac. You’b be correct. I have never used the platform specific stacks, so can only talk about XAMPP. XAMMP can be used on any of the platforms, hence the cross-platform part of the acronym.
A – Apache
If you followed the last post, you will know that Apache is one of the most popular, free web server solutions available, and the one we will be using to set up our server stack.
M – MySQL
MySQL is a database – this is topic we haven’t touched yet, so we won’t be worrying about it for now, just be safe in the knowledge that we are saving ourselves a bit of work later. If you want to know more about MySQL, then have a look at the wikipedia page.
P – PHP
Again, PHP has been explained in the previous post. Installing XAMPP is one way to get the popular scripting language on your computer, leaving you ready to dive into some coding.
P – Perl
Perl is another scripting language, and one that I’ve never used, or found any reason to use. So, I’m afraid I can’t tell you anything more about it, but if you want to find out about Perl, you know where to look :)
Installing Xampp in windows is a simple affair.
First, download the latest version for windows from here – You will see three different types of download. Be sure to pick the ‘Installer’ version. If a dialogue box opens, click on ‘save’. It should only take a few minutes to download, depending on your connection.
After the file has finished downloading, double click on the downloaded .exe file. You will then be asked if you are sure you want to run this software; we are, so click ‘run’. This will start the installation process. You will be asked a few questions regarding configuration during the installation – always just click ‘ok’ or ‘next’ or ‘continue’, whatever will give you the default option. We’re not doing anything fancy here.
The installation process may take a few minutes, but once it is complete, you will be asked if you want to start the XAMPP control panel, click yes!
And there you have it, the control panel for your new web server stack! So lets get it started.
Starting your Web Server
On the control panel you will see a list of processes under the column named ‘Module’ – these are the various processes that make up your XAMPP stack. To get the server running, we need to start the apache and MySQL modules.
Under the ‘Actions’ column, click the ‘Start’ buttons next to the Apache and MySQL modules. If everything goes to plan, then you will see log messages in the bottom panel, something like this:
[Apache] Attempting to start Apache app... [Apache] Status change detected: running [mysql] Attempting to start MySQL app... [mysql] Status change detected: running
Don’t worry if this isn’t exactly what you see, just as long as you are told these two processes are running, that’s fine.
If you don’t get these messages and it doesn’t look like your modules have started, then I can only say to Quit ( bottom right corner ) and restart the control panel. If that doesn’t work, then there may be something wrong with your install. You may have to start again with a fresh installation. First try running the installer again, and if that doesn’t work, then delete XAMPP folder which should be in your C-Drive’s root directory, and then run again.
Testing your Web Server
Assuming we have everything up and running, it’s time to test our server to make sure everything is working properly.
Go to your web brower and type one of the following in the address bar:
If everything is well ,you will see the following:
Congratulations! You have set up your first web server and are now ready to do some proper coding. Click on which ever language suits you best from the options and you will be brought to a XAMPP control panel. From here you can manage configs, get info on your set up and just about everything else you need to know about your server. For now, we only need to know that it works.
In our next tutorial, we will be writing some simple php scripts and serving our first pages using your web server. At this stage, we are starting to learn the skills that will give you real power in the world of web. Once you get passed displaying simple html files to serving PHP scripts using your own XAMPP stack, shit get serious ;)
Until next time…