How to use the Lisa's web server

1. If you want your material to be accessible outside your own computer, or if you cannot run a web server on your own computer in order to test your code, you can use the school's web server.

2. You will be using your own account on the school's machines.  Material that would be an embarrassment to the school is prohibited -- don't put it there.  Remember, this is your account, and you'll be responsible.

3. Get an FTP program: You'll need an FTP program to move files from your computer into the school's computers.  I'd recommend FireFTP, which is a plug-in for Firefox, of FileZilla but virtually any other FTP program will do.

4. Use sftp. I'll use the example of FileZilla for the example instructions ... If your home directory is on Lisa, then use the FileZilla to go to sftp://149.89.160.101 and you'll need to enter your student ID and password.  When a directory is displayed, navigate to your public_html directory.

5. Move your files: Now you can move files from your computer to your public_html directory.  This should include your .html files and your .py files.

6. FireFTP -- Setting Execute Permissions on Python program files: You MUST ensure that if the web server has to run a .py file of yours, then that file must have "execute permissions".  To do that, right-click on the name of the file, and a context-menu will appear. Choose "Properties" and you have a chance to turn on "Execute" permissions for all users (three different checkboxes).

7. Not FireFTP -- Setting Execute Permissions on Python program files: If you're not using FireFTP, you'll still have to set the "Execute" permissions on the Python files that the web server needs to run.  Another way of doing this is to use a Telnet program to log into the school's computers.  For Windows, there's Putty (free download).  The Mac has telnet.  Using such an ssh program, go to "149.89.160.101" and log in.  Then change to your public_html directory and change execute permissions of all .py files.  Here are the commands:

cd public_html
chmod +x *.py

...then you can log off.

8. Additional notes: Let's suppose that you have a web page called fred-questions.html that presents some possibilities to the user and when the user has chosen her preferences, it sends the user's answers to the Python program fred-answers.py, which then calculates what the user wants and produces a web page containing the answers.  And both of those files are already inside your public_html directory, and the Python file has its execute permissions correctly set.  Let's also suppose that your school login ID is "mr.voldemort". Then:

a) in the <form> tag inside fred-questions.html, make sure that the "action" attribute specifies fred-answers.py without any directories.  In other words your <form> tag should look like one of the following:

<form action="fred-answers.py" method="GET">
	or
<form action="fred-answers.py" method="POST">

b) The URL to access your program will be:

http://lisa.stuy.edu/~mr.voldemort/fred-questions.html