image
image





Superior-Host Customer Guide

Understanding our Linux File System:

Linux web servers are not the same as your home PC using Windows ®. I will try to cover the differences that affect you.

index.html
The first page of your site, and in each folder in your site.

The first page that you want people to see in your web site, should be named index.html or index.htm . I will explain why.

One thing that confuses a lot of new webmasters right off the bat is this. After taking the time to create their web site, they upload all of their files and directories, making sure to put their site in their public_html directory, then want to look at them with their browser, to make sure it is all right.

However, they forgot to name their home page index.html , so here's what happens: They access their site as http://www.mydomain.com or using their IP number, for example, http:// 66.103.135.2, and what they see is their directory structure showing all their sites contents. They can't understand why they can't see their web pages.

When you access your site by calling it as http://www.mydomain.com or by its IP number, the web server looks for the "index.html" file as the default page file, to be sent to visitors, and if it is not there, then it can't show it. So, instead, it will list the whole directory structure so you can see the files you need to select.
The server automatically looks for index.html whenever a domain or directory is called without a filename appended to it such as this, http://www.mydomain.com/homepage.html

If it can't find index.html, it will simply list "your entire web directory" to everyone that access's it, which can be a MAJOR security risk. You should always, use an "index.html" file in any directory you create. It is always a good idea to use "index.html" as your main page in "all sub-directories" of your account too. Forgetting to place an index.html in your web directory, or any subdirectory of your site, for that matter, will leave all of its contents viewable to anyone.

By default, the Index.html is the page that comes up first. The second page it looks for is index.htm . This is important to remember, as some people make an index.htm, then they don't see it come up first when they put their domain name into the browser... they still see index.html . The server looks for .html , then .htm. Even if they are both named index, the html will be used. You have to remove the index.html page to make the index.htm page come up first.

Case Sensitivity:

Another major detail, which sends many newer users into a tailspin. Unlike your windows PC, the Unix file system is very particular about "UPPER CASE" and "lower case" file names.

So, if you were to create your pages on your home PC, then upload the pages and pictures to your site, you could quickly find that your links and pictures stopped working if you made this error. If you create a page called Page2.html , then made a link from your index.html page going to page2.html ,,, it wouldn't show up.

The server sees Page2.html and page2.html as 2 separate pages. One with an upper case P and one with a lower case p. It is the same for images - If you create a picture for your page called ourlogo.jpg , then call it ourlogo.JPG in your design software, it will work on your PC, but not on the server. If any letters are different then what the item is that the server is looking for... it won't find it.

Linux servers are exceptionally fussy on this issue, so make sure you pay close attention to "case' when up-loading files, or installing and configuring cgi scripts. The same rule applies for all files including your .html pages. Again, the server treats .html and .HTML as two entirely different files. Want to keep it simple? Try to stick with lower case letters in all file names and extensions.

Uploading your files in the correct mode (ASCII or Binary) is important!

Uploading in the wrong format for images or binaries will result in a strange mess appearing in place of the file.  For CGI scripts, this mistake has to be the most common cause of that annoying error known as the (Internal Server Error 500 - and Malformed Headers).

While this can be the result of many various programming errors, the most popular amongst new users are uploading their scripts in the WRONG format. Your cgi scripts always MUST be uploaded in ASCII mode. When you upload your images or .exe files, they MUST be done in BINARY mode.

The difference between ASCII and BINARY

In short, html or text based files are supposed to be transferred in ASCII (Text Mode). Uploading them in Binary mode will append ^M's to the end of every line. In most cases, this is OK, with html files because your browser will ignore them. BUT, with other text files such as php and cgi scripts, uploading them in binary will damage them, causing an internal server error. This is because binary mode has added ^M's to the end of every line, which are not supposed to be in the program. This of course, is what causes the additional message of (Malformed Script Headers), which often displays at the bottom of the "Internal Server Error 500" message when a CGI script has crashed.

Once again, BINARY mode is used for transferring executable programs, compressed files and all image files. If you try to upload an image in ASCII mode, you will find a strange mess appearing on the page where the image is suppose to be. ASCII mode in this case, has corrupted the binary coding in the image. If this happens, just re-upload it in the Binary Mode.

Most FTP programs have "AUTO" mode, which will tell the FTP client to automatically detect the file type you're transferring and will select the appropriate mode. By default, most FTP programs will attempt to transfer everything in binary mode, but when "Auto" is selected, the FTP client will check a list of known ASCII extensions, (for example, .pl, .cgi, .txt). Many FTP programs allow you to add to the list of known ASCII types, and allows you to add things like .css. and .pl, etc...
If it detects one of these extensions, it automatically switches to ASCII mode. You should set your FTP preferences to start in auto detect mode.

By Default, most of the well-known files to be uploaded in ASCII are already entered, however you can manually add more extensions that you would like to transfer in ASCII mode by selecting the feature called "Extensions." Here, you can add any additional extensions that will cause the FTP client to toggle to ASCII mode automatically upon detecting an extension entered in its list. Remember, you must set your transfer mode to "Auto" for this to work.

Front Page and FTP:

If you plan on using Microsoft Front Page to create your web site, there are a couple of things you want to keep in mind:

There are two worlds. The General Unix/Linux hosting world, and Microsoft, in its own world. While this is not always a bad thing, Microsoft has decided to play by its own rules.   As a result, Front Page does not always conform to the rules of Unix, so you should be extremely careful when accessing a Front Page web via FTP.  It is easy to damage the Front Page web, as well as it's associated server extensions, and if it happens, you may loose the ability to manage or edit your site from your Front Page Explorer.

To avoid problems like this in FTP:

  • Do not alter, or delete files that are part of your Front Page web
  • Do delete, move, or alter directories ending in _vtf, _vti, or others with an underscore ( _ ) in front of them. These are the Front Page extensions needed to make your site work the way you intended

For more in-depth information on Front Page, please see our Front Page tutorial.



Top

Back to Basic's page




[ Home ]




website design page
image
image
image