XAMPP, We’ve Got Some Explaining to Do

XAMPP, Part 2

Now that you have a basic XAMPP for Windows system installed and running, what’s next?  Let’s first look at the XAMPP Status link.  (You can click on the picture to enlarge it, and use your browser’s “back” button to return here.)

Let’s recap what is currently working according to this chart.

  • First, we know Apache is running because we have the page display.
  • Second, the MySQL database server is operational.
  • Next is PHP, the general-purpose scripting language.  Many of the Web applications you will set up are programmed in PHP.
  • Perl is active, and the Apache module mod_perl is used to speed up Web applications using Perl.
  • Apache::ASP is an Active Server Pages implementation using Perl scripting, perhaps a topic for later.
  • HTTPS (SSL) is the Secure Sockets Layer, now renamed to Transport Layer Security (TLS), that cryptographically secures the communications for Web traffic (and other forms, too).
  • Common Gateway Interface (CGI) is a standard protocol used by a web server to use a console application to generate the web page contents.  This is a wonderful kludge and can create a lot of overhead creating the output.
  • Server Side Includes is another interpreted language, but very simple and limited.  It is mostly used to include the contents of one or more files into a web page.
  • IPv4 refers to the standard IP numbering scheme, as in 192.168.0.1.
  • IPv6 refers to the expanded IP numbering scheme.  Although there is general support on the Internet, only a small portion of the traffic uses the new protocol.  The addresses are written with colon separators, as in 2003:db4:85a3::8a2e:170:7334.
  • SMTP (Simple Mail Transport Protocol) Service is the outgoing mail server, or where you will send a message to be delivered to someone else.  It’s provided by Mercury Mail, and I’ll have an article (or three) about setting up and using this later.
  • FTP (File Transfer Protocol) Service, as provided by FileZilla Server.  Very functional, but it requires some important security and configuration care if you plan to open it to the Internet.  I’ll have another article for this later as well.

As you can see from the page, all but the last three items have been activated.  You most likely will not need IPv6 on your local LAN, and SMTP and FTP require some configuration first for realistic use.  As I mentioned above, we’ll cover those later.

If you take a look at the XAMPP Control Panel, you’ll see that there’s a check box for “Svc” that will initiate the installation of the Windows Service form of that subsystem.

Why do we care to do this?  As a Windows Service, the program will run automatically when we restart the computer.  This may be useful if you want to run XAMPP on your network as a service for the other computers; this way you won’t need to restart it manually.

Let’s start with Apache.  Be sure that the program is not currently running by clicking the Stop button and waiting until the Control Panel shows that it’s not running anymore.  Now click the check box, and a notice will pop up:

When you click OK, the service will be installed. Then you can restart Apache and it will be running as a Windows service.

The same thing can be done for MySQL as well, and when we get to FileZilla  and Mercury, we’ll add them to the group.

“This is all well and good, ” you’re thinking, “but when do we do something useful with this web server?”

I felt the same way the first time I put up XAMPP.  The problem I had was understanding what all was happening inside this dark box I had just installed.  To start, let’s take a look at the XAMPP directory tree.

C:\xampp\htdocs is the place that Apache looks for items to serve.  You can see the other directories under xampp, and I’ll describe the important ones later.  For now, let’s see if we can get a new page set up to serve.

I like to have a Table of Contents page for my website, so it tells me what’s available.  You can do that, too, but you need to know a bit more about how web servers do their thing.

Apache has a list of file names which it looks for in order, two of which are index.php and index.html, respectively.  This means that c:\xampp\htdocs\index.php is the file that Apache first finds to serve up from its list. If we rename that file to xampp-index.php, then Apache won’t find it.  Instead, the next file on the list will be served up, which is index.html.

Try this now and see what you get when you point your browser at http://localhost.  Does it work for you?

Now let’s rename the index.html to xampp-index.html and create a new index.html file to act as our Table of Contents. Here’s what’s in the file:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
 <head>
 <title>Localhost's XAMPP</title>
 </head>
 <body>
 <h1>Table of Contents</h1>
 <a href="xampp-index.php"><b>XAMPP main info page</b></a><br />
 </body>
</html>

Use Wordpad, Notepad or your favorite text editor (NOT a word processor).  Copy the text above, paste it to a new file and save it as index.html (remember that you already renamed the original).  When you go to http://localhost now, Apache will find your new page.  If you click on the link, you’ll go to the xampp-index.php, the Welcome page.

In the next article, we’ll go through the security page.  No matter what WAMP you install, this is the one aspect you must be concerned with.

Leave a Reply