CTEC1906/2012W Project How To Upload Your Site To technology.niagarac.on.ca ==================================================== Last Modified: Thu Mar 15 08:31:46 EDT 2012 1. Get your site working with Apache (with PHP) 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 192.168.2.17 # if you are in L-2 (IP for LAN) # use your technology.niagarac.on.ca username and password 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 *.php # upload all files ending in .php 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) mput *.png # upload PNG 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. qui # quit FTP Note: You can also use a graphical FTP client like FileZilla 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, which is available at: http://technology.niagarac.on.ca/courses/ctec1906/ssh/ OR http://192.168.2.17/courses/ctec1906/ssh/ # from L-2/17/18/19 SSH servers are listening on both ports 22 (the default) and 443. Port 22 is firewalled inside the College (unless you are using the LAN in L-2, L-17, L-18, or L-19.) 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. 5. Test out your web site using a browser. Your URL is: http://technology.niagarac.on.ca/students/_/_______/ where _ is the first letter of your last name (lower case) and _______ is your home directory name. NOTE: if you are in L-2, you can use 192.168.2.17 to access your site. For example, Joe Blough's URL is: http://technology.niagarac.on.ca/students/b/jblough/ OR http://192.168.2.17/students/b/jblough/ (in L-2) (Refer to Lab #1 for more info on URLs, etc.) Run tail /external/apache2/var/logs/error_log from your PuTTY window if you get Apache errors, or if your PHP scripts are not working correctly. If you open a Duplicate Session on PuTTY (click on the top-left icon), you can leave it dedicated to listing errors, and run tail -f /external/apache2/var/logs/error_log NOTE: You will see errors for the entire site in the Apache error_log, so you have to read through it to identify the ones in your own files. 6. When you are satisfied that your site is working, email your URL to Mike Boldin -- to BOTH ADDRESSES BELOW -- and your project is complete! mboldin@niagaracollege.ca mboldin@gmail.com