This page contains a series of links both to useful applications and to useful resources. You should be able to find most of what you need to get started here.
Also, in this course we will be using many different technologies. Because it will be difficult to keep track of them all, I am using this page as a reference guide that should provide instructions for how to use these technologies and links that will help you find them. It might be useful to use this page as a reference page when you run into technical difficulties.
This page will be updated as the class continues. I will try to make announcements when important links are added to the page.
It is somewhat ridiculous that we have multiple locations of the course website. However, given technical difficulties encountered in previous versions of this course, I have found it necessary to have two web locations for this course. Therefore, whenever updates are made to the course website, they will be propagated to all of the following locations. You may use any of these locations when you need to find a copy of this site.
The GSLIS classroom servers do have MySQL access. By default, the database is not set up, but you can activate it automatically:
Now that you have set up your database, it is vital that you adhere to the following practices when using PHP or any other scripting language to access the database.
To use a MySQL database, you must first connect to it. The php command for connecting to a MySQL database is mysql_connect(). However, when you use it, it typically has the following form:
<?php $con = mysql_connect('classrm06.lis.uiuc.edu', 'netid', 'mysqlpassword'); if (!$con) { die('Cannot connect to the MySQL database: ' . mysql_error()); } ?>
Notice that the mysqlpassword is entered in plain text, it is not encrypted! If this command is placed in a file which is in a web accessible directory, then there is the potential that somebody could download the file, obtain the password, and then use it to access the MySQL database. Therefore, do not store the password in a file in a web accessible directory!!! Instead, do the following:
SSH into one of the classroom servers (1-5), e.g. from the command line:
% ssh netid@classrm04.lis.uiuc.edu
Remember to substitute your NetID for "netid" in this step and any steps below when it appears. (Remember, also, the % simply indicates that you are using the command line, it is not something you need to type.)
Once you are logged in, type in the following commands:
% cd /homei/users/netid/ % ls -al
The ls -al command will show you a list of all the files, including hidden files, and will show you the permissions the files have. In this list, if you see a file called .keepperms then you are ready to go to the next step. If it does not exist, then you will need to create it. The easiest way is with the following command:
% touch .keepperms
The file .keepperms is a file specific to the GSLIS infrastructure setup. Our systems administrators have created scripts which run periodically that reset the permissions of all web accessible directories so that people don't accidentally make a file or directory world writable. The .keepperms file prevents the scripts from changing the permissions of files and directories (folders) in the entire directory tree including and below the directory in which the .keepperms file is located. This is necessary because we will need to change the permissions of some of the files and directories we will create.
Once the .keepperms file exists, then create a new directory, e.g.:
% mkdir phpfiles
Once you have created this directory, you will need to change the permissions on it so that the web server can access it:
% chmod a+rwx phpfiles
This command changes the permissions on the directory phpfiles (you don't have to name your directory "phpfiles", you can call it something else if you like) so that all three levels (user, group, and everybody) of access have full read (r), write (w), and execute (x) permissions. The reason for this is that the Apache web server on the GSLIS network is installed under its own user account. Since php scripts are interpreted by a php interpreter running as part of an Apache web server, they access files from this user account. Since this user account is not part of the group which has local access, the files need to be made accessible to everyone.
The reason you are creating this phpfiles directory in your NetID directory instead of in the courseweb_html directory is because this phpfiles directory is not being served to the internet by the GSLIS web server, so the files cannot be accessed by anyone who does not have GSLIS network access.
Now create a new PHP file in the new directory (phpfiles) you have created. You can either do this with your local text editor (e.g., TextWrangler, TextPad, etc.) via a WebDAV connection, or by using one of the text editors which can be run from the command line (e.g., emacs, vi, pico, etc.). For example, from the command line you might do something like:
% cd phpfiles % emacs dbinfo.php
The contents of the php file (dbinfo.php) should be something like this; we will add the database name and use it below:
<?php $dbhost = 'classrm06.lis.uiuc.edu'; $dbuser = 'netid'; $dbpass = 'password'; $dbname = $dbuser; ?>
After you have created and saved this file, you can now access it from the main php file you are creating in the courseweb_html directory. To do so, you must include it as follows:
<?php include '../phpfiles/dbinfo.php'; ?>
When you include a php file in this manner, essentially you are inserting the contents of the php file that is being included (dbinfo.php in this example) into the main php file at the point you have the include statement. Thus, in this example what happens is you now have the three variables $dbhost, $dbuser, and $dbpass defined and initialized to the values specified in dbinfo.php.
Now that you have defined these variables, you can use them in your PHP code. Thus, the main php file might have the following code in it.
<?php include '../phpfiles/dbinfo.php'; $con = mysql_connect($dbhost, $dbuser, $dbpass); if (!$con) { die('Cannot connect to the MySQL database: ' . mysql_error()); } ?>
Remember, the first time you use the database, you have to create it:
<?php include '../phpfiles/dbinfo.php'; $con = mysql_connect($dbhost, $dbuser, $dbpass); if (!$con) { die('Cannot connect to the MySQL database: ' . mysql_error()); } $sql = 'CREATE DATABASE ' . $dbname; if (mysql_query($sql, $con)) { echo $dbname . " database created successfully"; } else { die('Error creating database ' . $dbname . ': ' . mysql_error()); } ?>
When you are finished using the database in your PHP script, you should close the connection, though this is not strictly necessary, since when the script ends, the database connection will close automatically:
<?php mysql_close($con); ?>
If you want to use PHP to write to files, the operation will fail if you try to write to them in your courseweb_html directory in your I: Drive. There is good reason for this. The PHP interpreter runs as part of the Apache web server on the GSLIS network. The way the GSLIS system is setup, the web server is installed under its own user account, and this user account does not have group-level permissions access to your I: drive space. Therefore, in order for it to write to the I: drive, write permissions must be set for all users. However, because your courseweb_html directory is served to the web, if you give write permissions to everybody, this means that anybody on the internet can write to your I: drive, which means that anybody can hack it and put up spam sites that can bring the whole GSLIS (or even UIUC) network down. Obviously, this is undesirable.
This is only complicated by the fact that the GSLIS server infrastructure has complex permissions management, such that the web server cannot write to the file system barring certain complex changes in extended permissions. Therefore, to avoid messing with this, and to avoid the possibility of error, simply follow these instructions:
SSH into one of the classroom servers (1-5), e.g. from the command line:
% ssh netid@classrm04.lis.uiuc.edu
Remember to substitute your NetID for "netid" in this step and any steps below when it appears. (Remember, also, the % simply indicates that you are using the command line, it is not something you need to type.)
Once you are logged in, type in the following commands (substitute your NetID for netid):
% cd /homei/users/ifloyd2/lis390w1a_student_files/ % mkdir netid % chmod o+rwx netid
The directory lis390w1a_student_files has been specially created and associated with special extended permissions to allow the web server to write to the filesystem. To distinguish your files from everybody else's, you will need to create a subdirectory within this directory to store your own material, and change the regular permissions as needed. Which is now what you have done.
You will need your PHP script to create any file(s) you want to edit. Be sure it creates them in the following path:
/homei/users/ifloyd2/lis390w1a_student_files/daswanso/
If this does not work, email me. I can't test this to be sure it works. You might need to use a relative path, instead of an absolute path, though in all likelihood, that shouldn't matter. If you're lucky, this will work, and you will be ready to read and write to files!
Once the .keepperms file exists, then create a new directory, e.g.:
% mkdir datafiles
Once you have created this directory, you will need to change the permissions on it so that the web server can access it:
% chmod a+rwx datafiles
This command changes the permissions on the directory datafiles (you don't have to name your directory "datafiles", you can call it something else if you like) so that all three levels (user, group, and everybody) of access have full read (r), write (w), and execute (x) permissions. Now the GSLIS web server's user account has full write access to the files stored here.
Here are some CSS Tutorials that students in the class have found useful:
Javascript:
Need samples of CSS, HTML, or javascript? Check out these resources and learn via example.
This section is clearly incomplete. Please feel free to suggest examples you come across which you find particularly useful!
Secure remote login programs such as SSH and secure telnet allow you to login to a server (computer) remotely. Thus, if you want to work on files stored on your GSLIS H: drive, you can ssh into the classroom server and access your files that way. A typical command would be "ssh netid@classrm05.lis.uiuc.edu". For more detailed instructions as to how to SSH into your GSLIS home directory, click here. Secure remote login programs tend to be command-line based. While not as intuitive as graphical user interfaces (GUIs), the command line can be much more powerful, and once you are familiar with it, it can be much quicker to use.
Secure file transfer programs allow you to copy files to and from remote servers (computers). There are several standards for secure file transfer, but the most common are secure file transfer protocol (SFTP) and secure copy (SCP). For more detailed instructions on using secure file transfer programs, click here. For Mac users, I recommend getting used to scp, rather than using Fetch. SCP comes free with your computer, and using it helps build familiarity with the command line. Once you leave UIUC, Fetch will no longer be free, and you will find that, if you are dependent on many commercial products, keeping up with the latest versions will quickly become quite expensive.
A third option for working remotely is WebDAV. WebDAV will be covered in the following section.
In order to access your GSLIS space through SSH, you will have to type in the following command from the command prompt (be sure to substitute your netid for the "netid" portion of the command):
ssh netid@classrm04.lis.uiuc.edu
At the prompt, type in your GSLIS password. Once you are logged in, you will be in your H: drive. This is your private space--it is not web accessible. If you want to access your I: drive, you will need to type in the following command (be sure to substitute your netid for the "netid" portion of the command):
cd /homei/users/ifloyd2
Please see either my Unix Tutorial or the GSLIS Unix Tutorial for more information about how to use the Unix/Linux command prompt.
Any macintosh running OS X should come with SSH (remote login) and SCP (file transfer) installed and available through the command line.
WebDAV is another standard which supports remote file access via a set of extensions to the HTTP protocol. The benefit of the WebDAV standard is that most operating systems allow you to integrate files on remote computers directly into your file system. Thus, you can edit the files using the applications you are familiar with directly from your personal computer.
WebDAV is an abbreviation for "Web-based Distributed Authoring and Versioning". For more information about WebDAV please see the WebDAV Resources site. You may also find the WebDAV wikipedia article useful.
In order to use the GSLIS web space, you will have to enable your I: drive. This process is somewhat complex, and you will have to take a quiz at the end which, once completed, will enable your I: drive. If you run into any problems in this process, please do not hesitate to email me or email or call the GSLIS Help Desk (217-244-4903; 1-800-377-1892; open M-F 8:00 am to 5:00 pm) to get some help. I have already activated my I: drive, so I can't actually go through the process again, so the GSLIS Help Desk might be better able to assist you.
For the GSLIS documentation of how to use WebDAV, click here.
Unfortunately, the GSLIS implementation of the WebDAV standard and the Windows XP implementation of the WebDAV standard don't always play nicely together, so we may need to develop some workarounds. Please do not hesitate to contact me if you run into any problems.
These applications cannot be used in the class for completing your assignments. However, you may find them useful in your own work after the class is completed. All of the applications listed here are free, and most are open source as well.
These applications not only provide a means for coding HTML that have significantly more functionality than standard text editors, they also have advanced features such as server integration; IDE-type support for javascript, ajax, php, etc.; virtual server support; etc.
By the time you complete this class, you will probably find these editors unwieldy, and not as useful because they don't give you the power over the HTML & CSS which you are accustomed to. However, they can still be useful editing environments for small projects. These editors are basically free applications which serve the same purpose as Dreamweaver. I don't ever use these kinds of application.
Sites with free, downloadable images which you can use on your own websites as long as you adhere to the licenses. Most are under one of the Creative Commons licenses, so make sure you understand the terms of use before using the images in your own websites. Ask me if you have any questions about what the licenses mean; I'll do my best to answer them (but I'm not a lawyer).
Some website evaluation schemes suggested in the Website Evaluation Assignment:
It is sometimes interesting to look at the growth of the internet and at demographic issues such as the digital divide. The following sites give some resources for doing such research. Be a bit wary of the sites listed below. For example, the Pew foundation is probably one of the more reliable sites for statistics, but they do have a pro-internet bias which colors their results. OCLC is also reliable, but it is not so clear how reliable some of the other sources are. Use your best judgment when evaluating these other sources.