Creative Computing: Week 2

HTML and your Web Server

Assignments for Next Week

Assignment References

Class Notes

Jump to Folder Structure, Local Server or FTP

Folder Structure

We modified our folder structure so that we can run the same code on our local machine and on the Parsons server. First, save all of your work, then update your folder structure so that looks something like this:

After updating your folder structure, you might have to start a new Sublime project. With Sublime open, click File > New Window and then drag your ~net-id folder over the new Sublime window. Then you can close your old one without saving the changes.

Local Server

We started a web server on our laptops to mimic the web server we will ultimately upload our files to. The web server on your laptop can also be called a local server, as opposed to the Parsons server, which is a remote server.

To start our local server, we opened the program Terminal. This program is located in your computer's /Applications/Utilities/ folder. With terminal open, type cd (note that there is a space after the letters) and then drag your creative-computing folder from Finder onto Terminal. Then press enter.

If you type ls into Terminal and hit enter, you should see your ~net-id folder. Now, we can start our web server by typing python -m SimpleHTTPServer and hitting enter.

Now we can navigate our browser to http://0.0.0.0:8000/~your-net-id/ to view our webpage being served locally. Note that only you will be able to see this website - it's not on the internet yet. You can see how we don't have to type /index.html at the end of the web address - this is because web servers know to automatically look for an index.html file in every directory. If we tried to go to http://0.0.0.0:8000/~your-net-id/week1, it wouldn't work, because we don't have an index file in that directory.

To stop the web server in Terminal, press Ctrl-C (that's the Control key, not the Command key). To start it again, you can retype the command or hit the up arrow until you see it again, and then press enter.

Links

We also updated the links in our web pages to reflect the new folder structure. We have a few options for how we format the href attribute of our links.

FTP

Finally, we covered how to upload your files to the Parsons server. To do this, we use the program Cyberduck. With Cyberduck open, click "Open Connection" in the top left and fill in the following fields:

You will get a message saying Unknown fingerprint, check the "Always" box and click "Allow".

Then you should see this screen:

Double click on public_html. This folder is like the ~your-net-id folder that we created on your local machine. Everything in this folder will be put on the internet at the address http://b.parsons.edu/~your-net-id. Now, you can drag all of your files from the ~your-net-id folder in Finder and over on to Cyberduck.

Keep in Mind...

Terminology