| WebSys Fall 2006 HW1: Web Server, PHP & MySQL Installation/Configuration |
| WebSys Home | HW1 FAQ |
Homework #1 involves the installation and configuration of a web server on your laptop. You will need a properly configured server for subsequent labs and tests - so this assignment is important! Your laptop must be configured so that it can handle the following:
Homework #1 can be done with anyone! Get all the help you can (from anyone at all!). It is certainly useful to be able to do this on your own (you may need to do it again!), but this is not required.
Some information about software installation, configuration and testing is included below. There is also a small application (PHP/MySQL) included below that you need to get running on your laptop in order to get credit for this assignment.
Apache and ISS are the most widely used servers. There is extensive support (on the Web) for using PHP and MySQL with either of these servers. Any Web server that can support CGI can support PHP, but you will be able to find more online help for Apache and IIS.
IIS is the Microsoft Web server (actually it can do lots more than just providing a web server). Configuration is via the Control Panel (Administrative Tools). Using IIS allows you to play with other Microsoft tools, including ASP and .net, but ISS runs only on Windows (it's not portable to other operating systems like Unix and Linux).
IIS Installation
If your operating system comes with IIS, you can find out if
it is already installed by attempting to load the page
http://127.0.0.1/ (this will be the home page of
your web server). If it is installed this page will include
links to basic setup information.
If you don't have IIS installed, you can install it from the Windows CD that came with your computer. Go to the "Add/Remove Programs" control panel (or Add Services) and look for IIS, or "Internet Information Server". Installation should be simple from here...
NOTE: The IP address 127.0.0.1 is called
the "loopback" address. No matter what machine you are on, this
address corresponds to the machine itself. Under some versions of
Windows, the loopback address doesn't seem to work unless you are
actually connected to the Internet (this is a bug)!. To be safe,
make sure your laptop is connected when you do this test.
Apache is a portable, open source, Web server written and supported by The Apache Software Foundation. You can get the source code for Apache and build it yourself, or get pre-built binaries for Windows, MacOS and many Linux distributions.
Apache Configuration has generally been a painful process - you must manually edit some text files to configure the server. There are now a number of third party packages that can make this less painful.
PHP is a popular Web programming language that was designed as a web programming language (not as a general purpose programming language), and includes many useful libraries. PHP is quite often used with MySQL and there are a number of books/web sites dedicated to PHP-MySQL.
You can download and install PHP by itself, then configure your server to support web programs written in PHP, or you can download a package that automatically configures your server to support PHP.
MySQL is an open source database system that has been ported to many Operating Systems. There are a number of MySQL products available, the commonly used (and free) version is called "Community Edition". This software does not come with any fancy GUI support, all communication with the server is via network connections or through a command line interface. We suggest that you find pre-built version for your operating system that includes something like phpMyAdmin to simplyify the configuration of your MySQL database server. There are a number of links below to such packages.
phpMyAdmin is a set of PHP scripts that provide web-based interface to a MySQL database. This software simplifies many common database management tasks (creating databases, editing databases, etc.)
Apache based:
IIS based:
MySQL
phpMyAdmin
In general it doesn't matter the version number of any specific package you install, although you should make sure your software is reasonably well supported by folks on the web (much of the information about how to use these packages can be found on discussion boards, tech web sites, etc). PHP version 4 or 5 is fine, MySQL version 4.1 is probably best, but version 5 should be fine as well.
We expect everyone to get a 100 on HW1! You get a grade for HW1 by demonstrating that your server is working any time before the due date. There is nothing to turn in or write up.
To make it easy for us (and you) to determine that you have things set up properly, you must install the script shown below on your laptop and get it running. The script (PHP script) connects to your MySQL server and displays the names of all of the databases found on your MySQL server. You need to modify the script a little to reflect the settings on your computer (MySQL account name and password).
Once you install this script you can access it via your browser with a URL something like "http://127.0.0.1/websys/test.php" (this assumes that you create a folder named "websys" and put this file in that folder and name it "test.php").
|
| WebSys Fall 2006 |