Troubleshooting


What happens if you upload all your files to the server and try to display your home page in your browser, and something goes wrong? Here's the first place to look.

I Can't Access the Server

If your browser can't even get to your server, this probably isn't a problem you can fix. Make sure that you have entered the right server name and that it's a complete hostname (usually ending in .com, .edu, .net, or some other common suffix). Make sure that you haven't mistyped your URL and that you're using the right protocol. If your webmaster told you that your URL included a port number, make sure that you're including that port number in the URL after the hostname.

Also make sure that your network connection is working. Can you get to other URLs? Can you get to the top-level home page for the site itself?

If none of these ideas solve the problem, perhaps your server is down or not responding. Call your webmaster to find out whether he or she can help.

I Can't Access Files

What if all your files are showing up as Not Found or Forbidden? First, check your URL. If you're using a URL with a directory name at the end, try using an actual filename at the end. Double-check the path to your files; remember that the path in the URL might be different from the path on the actual disk. Also, keep case sensitivity in mind. If your file is MyFile.html, make sure that you're not trying myfile.html or Myfile.html.

If the URL appears to be correct, check the file permissions. On UNIX systems, all your directories should be world-executable and all your files should be world-readable. You can ensure that all the permissions are correct by using the following commands:

chmod 755 filename chmod 755 directoryname


Tip

Most FTP clients will allow you to modify file and directory permissions remotely.


I Can't Access Images

You can get to your HTML files just fine, but all your images are coming up as icons or broken icons? First, make sure that the references to your images are correct. If you've used relative pathnames, you shouldn't have this problem. If you've used full pathnames or file URLs, the references to your images may have been broken when you moved the files to the server. (I warned you....)

In some browsers, you get a pop-up menu when you select an image with the right mouse button (hold down the button on a Macintosh mouse). Choose the View This Image menu item to try to load the image directly. This will give you the URL of the image where the browser thinks it's supposed to be (which may not be where you think it's supposed to be). You can often track down strange relative pathname problems this way.

If you're using Internet Explorer for Windows, you can also select the Properties option from the menu that appears when you right-click on an image to see its address. You can check the address that appears in the Properties dialog box to see whether it points to the appropriate location.

If the references all look good and the images work just fine on your local system, the only other place a problem could have occurred is in transferring the files from one system to another.

My Links Don't Work

If your HTML and image files are working just fine but your links don't work, you most likely used pathnames for those links that applied only to your local system. For example, you might have used absolute pathnames or file URLs to refer to the files to which you're linking. As mentioned for images, if you used relative pathnames and avoided file URLs, you shouldn't have a problem.

My Files Are Being Displayed Incorrectly

Suppose you have an HTML file or a file in some multimedia format that's displayed correctly or links just fine on your local system. After you upload the file to the server and try to view it, the browser gives you gobbledygook. For example, it displays the HTML code itself instead of the HTML file, or it displays an image or multimedia file as text.

This problem can happen in two cases. The first is that you're not using the right file extensions for your files. Make sure that you're using one of the correct file extensions with the correct uppercase and lowercase.

The second case is that your server is not properly configured to handle your files. If all your HTML files have extensions of .htm, for example, your server might not understand that .htm is an HTML file. (Most modern servers do, but some older ones don't.) Or you might be using a newer form of media that your server doesn't understand. In either case, your server might be using some default content type for your files (usually text/ plain), which your browser probably can't handle. This can happen with server-side scripts as well. If you put up .php files on a server that doesn't support PHP, the server will often send the scripts to the browser as plain text.

To fix this problem, you'll have to configure your server to handle the file extensions for the correct media. If you're working with someone else's server, you'll have to contact your webmaster and have him or her set up the server correctly. Your webmaster will need two types of information: the file extensions you're using and the content type you want him or her to return. If you don't know the content type you want, refer to Appendix E, "MIME Types and File Extensions."




Sams Teach Yourself Web Publishing with HTML and CSS in One Hour a Day
Sams Teach Yourself Web Publishing with HTML and CSS in One Hour a Day (5th Edition)
ISBN: 0672328860
EAN: 2147483647
Year: 2007
Pages: 305

Similar book on Amazon

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net