CTEC1731/2010F Lab #3 How To Upload Your Site To technology.niagarac.on.ca ==================================================== Last Modified: Mon Aug 30 14:57:10 EDT 2010 NOTE: If you are working under Solaris in L-5, you can simply copy your HTML, CSS, and image files to your ~/public_html directory; and your Perl/CGI scripts to your ~/public_cgi directory. Then you can use UNIX commands in those directories to edit and/or modify your files. You do not have to use FTP or SSH (except to check the error_log on technology.) 1. Get your site working with Apache (with Perl and CGI) on any computer. 2. Upload your site using FTP; for example, from a command prompt: NOTE: # denotes a comment -- do not type them in! # start in your htdocs directory... ftp technology.niagarac.on.ca # from anywhere OR ftp 192.197.62.35 # from anywhere (IP) OR ftp enterprise # if you are in L-5 (LAN connection, # VERY FAST!) OR ftp 192.168.90.17 # if you are in L-5 (IP for LAN) # use your username and password from L-5 to log in cd public_html # this is your web directory on technology asc # switch to ASCII mode (for text files) mput *.html # upload all files ending in .html mput *.css # upload all files ending in .css bin # switch to binary mode mput *.jpg # upload JPEG images (if necessary) mput *.gif # upload GIF images (if necessary) NOTE: if you have subdirectories in your web site, you can use mkdir to create a new directory on technology, cd to change to it, cd .. to go back to public_html, lcd to change to it on your local computer, and lcd .. to change back to your htdocs directory. cd ~/cgi-bin # change to your CGI directory on technology lcd ../cgi-bin # change to your CGI directory on your local computer asc # back to ASCII mode mput *.cgi # do this if your CGI scripts end in .cgi mput *.pl # do this if your CGI scripts end in .pl qui # quit FTP Note: You can also use a graphical FTP client like WS_FTP or a graphical SSH client, like WinSCP. Both can be downloaded from the course web site. 3. SSH to technology.niagarac.on.ca and log in using your username and password. Use an SSH client like PuTTY or TeraTermPro. (Telnet access has been disabled.) SSH clients are available at: http://technology.niagarac.on.ca/courses/ctec1906/ssh/ OR http://192.168.90.17/courses/ctec1906/ssh/ # from L-5 only If you are in L-5, you can run ssh enterprise OR ssh 192.168.90.17 from a Solaris Terminal window. From Windows under SunPCi, use the IP address. SSH servers are listening on both ports 22 (the default) and 443. Port 22 is firewalled inside the College (unless you are in L-5.) 4. cd public_html Edit the HTML files that contain forms to change the form actions. Text editors that you can use are: pico and vi NOTE: Only use vi if you know what you are doing! Optionally, you can edit on your local computer and FTP the updated files. Your CGI directory is /external/cgi-bin/students/______ where _____ is your home directory name (your first initial plus your last name, all lowercase.) For example, Joe Blough's CGI directory is: /external/cgi-bin/students/jblough Your form actions must begin with: /cgi-bin/students/______ For example, if Joe Blough has a form that runs a CGI script called process.cgi, the form tag will look like the following to work with his L-5 Lab #1 Apache installation: