Site Maintenance: File and Directory Structure

Unless you're creating and editing your files online, you'll always have two copies of every file: one on the server (remote) and one on your disk (local). To avoid problems, you should keep these files synchronized; every time you edit a page, upload the new page. If you edit a file remotely (that is, using a Unix text editor such as pico), you'll need to download the new file:

To maintain the proper relative file locations, you should keep your local files arranged in the same structure as the remote files. That is, you could have a folder called public_html on your disk (or whatever removable media you're using. If the local folder is not named public_html, just remember that everything in that folder goes in the public_html directory on the server.

You can nest folders within the top-level folder: for example, a folder called projects for your English 344 class, a folder called images for all your image files, and so on. But you'll need to use these same names for your directories on the server. Fortunately, you can use SSH to upload entire folders. Follow the directions for uploading files, but rather than selecting a file, select an entire folder. The uploaded folder will create a directory on the remote side, and all of your relative links should work.

If the files in an uploaded folder all return Error 403: Forbidden messages, check the permissions:

You can also create directories using SSH :

 

You should also backup your entire site to your home computer. Simply copy the contents of your removable disk or drive to your home computer. Now you have three copies to keep in sync. If you edit a file on your home computer, make sure you copy it to your disk. One of the most frustrating problems is overwriting changes you've made by uploading an outdated file to the server. Remember, when you upload a file, you overwrite the copy on the server.

A good practice is to keep a copy of your entire site on your home computer, and a complete working copy on a removable disk. You can edit and upload files from the disk anytime, but be sure to copy them back to your home machine. You can do this by copying from the removable disk, or by downloading the entire site to your home computer after you've uploaded the edited files.

Remember: always have a backup

 

 


Dean Taciuch
GMU English Department

Valid XHTML 1.0Valid CSS!

Creative Commons License
This work is licensed under a Creative Commons License.