Before you get started, you should know that this is a group assignment. The first thing you should do is decide who's account to use for this assignment. You'll be using an OCF account, so if I see any cs198-xx accounts as the name of the account you're using, very bad things will happen to you. Your group was assigned a host and a port to use during class. If you don't remember your group's information, send us an email and we'll get it to you. This assignment only has to be done on one account, but everybody should contribute.
wget (the URL)Hit enter, and this will download the source.
For Solaris' tools:
gzip -dc (filename) | tar xvf -What this will do is run the program gzip, telling it to decompress the file, and send it to standard out (which usually goes to the screen), but we then pipe it to tar (so all the output of the gzip command becomes the input of the tar command), and we tell tar to (e)xtract, be (v)erbose, and that the input comes from a (f)ile (in this case, the dash specifies standard input, usually the keyboard, but since we've redirected it in this case it comes from the output of gzip).
For GNU's tools:
gtar xvzf (filename)As you can see, GNU's tools makes life much happier by just passing in an extra flag, which tells it to take care of (z)ipping and unzipping files on the fly.
./configure --prefix=$HOME/decal --enable-soThis tells the configure script to configure everything to be installed to your home directory, under the subdirectory decal. You'll see what this means when we're done with all the steps. This might take a while, so go play some video games or take a walk.
gmakeand you're done. This will take a long time (20+ minutes), so go do something else for a while.
gmake installwhich will install everything into your home directory, under the subdirectory 'decal'. Try going in there and seeing what's in the directory; you should see some directories like bin, sbin, lib, and others. At this point, we're done installing Apache. Congratulations!
./configure --prefix=$HOME/decal --with-apxs2=$HOME/decal/bin/apxs
Once you've compiled and installed PHP, you'll have to edit Apache's configuration file, which will be located in your home directory, under the decal subdirectory, under conf. In short, it will be in $HOME/decal/conf, and it will be called httpd.conf. This is the file we'll be editing for all changes in the server's configuration, which brings us to our next section*...
Listen 80to:
Listen (the port you were assigned)If you haven't been assigned a port number because you haven't submitted your group information, DO IT NOW. If you do not have a group, you should let us know NOW. At the beginning of the semester I mentioned that there are a few (very few) ways to fail the class. Not being in a group and/or not contributing to the group is one of them. If you don't remember your port, have your group leader contact us and we'll send you a reminder.
Next, we'll be adding support for PHP. Looking in httpd.conf again, look for lines that begin with AddType (some of them might be commented out, which you can tell because they'll have a hash symbol in front of it). We're going to add a line to tell the webserver that files ending in .php should be processed with the PHP engine:
AddType application/x-httpd-php .php
We'll also want to add a line to the configuration file to tell the webserver that if you try to open a web page, it will first look for an index.php, then an index.html, and so forth. The line we're looking for is:
DirectoryIndex index.html (possible trailing stuff here)We want to change that to:
DirectoryIndex index.php index.html (whatever was here as well)After this, we start (or restart) the webserver, by using the apachectl command. You can do this by going to $HOME/decal/bin, as follows:
cd $HOME/decal/bin ./apachectl start (or, alternatively, restart)With this we should be done, so now we test to see if everything went correctly.
Go to the htdocs directory of your Apache installation, which holds default files for the webserver. By default, this will be in $HOME/decal/htdocs (since we installed to $HOME/decal). Make a new directory called test, and create a new file in it. We'll call this file index.php. The whole path to the file is thus $HOME/decal/htdocs/test.php. The contents of this file should be the following (and only the following):
<?php phpinfo(); ?>
Let's see if everything worked correctly.
Open a web browser. The address we'll be going to depends on the machine and port you were assigned. If you were assigned to use firestorm, port 10001, you would go to http://firestorm.ocf.berkeley.edu:10001. If you were assigned blizzard and port 10007, you would go to http://blizzard.ocf.berkeley.edu:10007. When you go to this site, you should see an Apache test page, which means Apache is working. Celebrate! If not, something has gone wrong and you need to retrace your steps. Now, to see that PHP is working, go to the test directory, e.g. http://firestorm.ocf.berkeley.edu:10001/test/index.php. If the script runs and outputs a bunch of information, then congratulations! You're done. Email us and let us know so we can check it out. If you want to be adventurous, feel free to add more files to try it out (but you don't have to...yet.)
This document was generated using the LaTeX2HTML translator Version 2002-2-1 (1.70)
Copyright © 1993, 1994, 1995, 1996,
Nikos Drakos,
Computer Based Learning Unit, University of Leeds.
Copyright © 1997, 1998, 1999,
Ross Moore,
Mathematics Department, Macquarie University, Sydney.
The command line arguments were:
latex2html -split 0 hw4.tex
The translation was initiated by randy on 2005-03-05
randy 2005-03-05