Friday, April 1, 2011

The Server-Side - XAMPP

Introduction

For this week, client-side scripting took the back-seat to make way for server-side scripting. But first, before diving head-on into PHP, an introduction to server-side thinking was due.

One important step was understanding the Dynamic Web Model. This model defines how typical webpage is handled. In basic terms:

  • A user makes a request
  • Server-side language running on server (ex. Perl) recieves it
  • Adjusts reply according to the user input
  • Sends it back in HTML format

This was followed by a look at web-servers and our choice of tools for learning purposes, namely XAMPP.


The Task - XAMPP Configuration

An overview of the task is shown below:

  • Install XAMPP on your computer
  • Test the following functions
    1. Control panel
    2. Check that the http and https services work
    3. Ftp service
    4. Get an XAMPP security report
    5. Get a phpinfo report
    6. Get a visitor report
    7. Test the default guestbook
  • Add an image and a style sheet to C:\xampp\htdocs\index.html and test it out
  • Test your web server from another computer
  • Attempt to replace index.html and other files using an FTP client on another computer

Before continueing with the configuration, the diagram below is intended to illustrate my environment for this configuration

The first step was to download and install XAMPP. I decided to install all it's services; namely, Apache, MySQL and FileZilla on all the environments. When running the setup, on the Windows 7 environment a warning popped up regarding some features not being available and checking your User Account Control. This was solved by probing in the Windows settings right after the installation to turn the required services on and make firewall exceptions for them.

On the Windows 7 environment, I had a previous installation of MySQL, with it's services running which resulted in an "error in port 3306 MySQL connection". Simply stopping and restarting the respective services solved the issue.

The image below shows the installation of XAMPP on the Windows 7 environment

The image below shows the XAMPP control panel running in the Windows 7 environment. Notice that MySQL had been stopped as I was still trying to resolve the conflicting issues between it and XAMPP


The Windows XP installation provided no issues since it was run on a clean Virtual Machine installation.

Turning to the Ubuntu installation, the image below illustrates the intallation of XAMPP

The following image demonstrates the starting of XAMPP server in Ubuntu

The next image checks that XAMPP is runing properly in Ubuntu

Moving through the Control Panel, I now checked what seperate services were running. Using "localhost", you are able to refer to the same machine and the status-running window is displayed in the browser. Through the controls, the next image shows the status of the HTTPS and FTP services (running) in the Windows XP environment.

Next, I took a look at the security report. The Windows 7 XAMPP security report is shown below:

One can also view the PHP info running on the server, as shown in the image below:


XAMPP also provides a simple visitor report, which is shown below:


A guestbook is also provided, as demonstrated below:

To further check the runnings of the server I put the runningMan animation, which is a previous assignment, into the htdocs folder of the Windows XP environment XAMPP setup. I checked if it was running through all machines on the network by refering to the IP address of the Windows XP environment machine followed by the html document name.

In the Windows XP case, I used localhost, as shown below:

By typing 192.168.1.34/runnerRunning.html on the iPod Touch, the page was displayed, as shown below:


Next came the issue of the FTP. I set-up accounts using FileZilla for the guest to connect. On the Windows environment, when attempting to connect to the FTP from another machine, such as the Acer Laptop, no connection was being established. This was later identified as being simply the Windows firewall blocking FTP connections to the machine.

In fact, when I ran the FTP server from the Ubuntu environment, no problems occoured when connecting to it using the Acer Laptop, as shown in the next image:

The next image shows the guest connection to the FTP from the server side, on the Windows 7 environment.


Some errors encountered along the way were primarily seen in the Windows 7 environment. When trying to start or stop a service, it sometimes gave a "-1" error. This is probably attributed to some conflicting services running on this machine at the same time (ex: Skype, MySQL etc). On the clean Windows XP and Ubuntu environments, no such errors occoured.