Installing CGI/PERL Scripts

June 10th, 2007

This section is more of an expansion on the initial discussion of CGI/PERL scripts from the “Creating Forms” section. It is intended to make you become acquainted with installation procedures relating to your Web directory.

If you would like to use CGI/PERL scripts and plan on installing yourself on your directory, be sure to follow the script’s instructions, if available. Helpful instruction sets are included with most freeware CGI and PERL scripts available on the World Wide Web. When you upload your scripts, be sure to have you FTP client set in ASCII mode (click the “A” button or “ASCII” radio tab in FTP Explorer) since the file is composed of straight ASCII based text. And definitely make sure you’re uploading the scripts in the correct folder, usually titled “cgi-bin” on most servers. The “cgi-bin” directory is usually assigned special administrative permissions so that only you can access its contents over the Net. Speaking of permissions, you’ll want to set your CGI/PERL scripts to various administrative, group, and user access rights. Using Telnet (a UNIX-based environment based entirely on text), you can set permissions to either chmod 755 or 777, depending on the script’s behavior. The “chmod” command is followed by obviously the number (i.e. 755) and the location of the file you wish to apply specific permissions to. The command chmod 755 allows virtually all permissions to be implemented except “Write” permissions for the group and user while chmod 777 sets permissions for everything (Read, Write, and Execute) for all groups.

In any case, be sure to look at the files that came with your CGI/PERL script for the proper installation of the program. Many CGI/PERL packages come with a “readme” file that contains valuable information regarding the file setup. You might also want to refer to the lines following continuous number symbols (#) since these lines are not part of the CGI/PERL script’s performance and are generally intended for identification and installation guidance purposes. Number symbols are also used to “rem” (or remove) lines to make them dormant or unable to initialize from within the script without actually deleting the entire line in case its wanted in the future. (Just be careful not to “rem” too many lines because it adds to the script’s file size, which increases it’s download time.) In addition, its also important to point out that if you wish to use any special characters (i.e. “$” or “@”) you must place a backslash “\” in front of them so the script does not recognize the character as a variable (which can send an error message on-screen).

Side Note: Although Telnet may be accessed within the Microsoft Windows interface by going to “Start”, “Run…” and typing in “telnet” followed by a space and the location, most FTP clients support chmod permission settings directly within the program. You might find taking advantage of setting permissions within FTP helpful, especially since logging onto Telnet can be rather slow at times.

Also, if you don’t have a “cgi-bin” you can create one by making a new directory and using the “chmod” command to set permissions to chmod 777. Normally, you’ll want to set permissions to chmod to other directories you create from within this “cgi-bin” directory, especially for scripts that save user-inputted data (i.e. scripts that create customized Web pages).

Updating your Site

June 10th, 2007

It’s important to update your site every once in a while. No one likes to view out-dated information. Of course they can always leave and get it somewhere else, but the point of your Web site is to attract as much visitors as possible.

If updating your site on a frequent basis is too much of a hassle, you can insert a JavaScript into your pages to produce the current date. You can also install another script that greets the user with “Good morning!” or “Good afternoon!” appropriately to the time of day. And best of all, its all automated so you don’t have to maintain the scripts. This is a great marketing strategy to make your visitors believe your pages are updated with current information. If you’re interested, you can test these scripts and copy/paste them to your Web pages from an excellent online resource intended as a companion Web site for the book “JavaScript for the World Wide Web.” The Web site is located at http://www.chalcedony.com/javascript. If you’re ever interested in expanding your knowledge for more powerful Web page functionality, this book is definitely worth looking into.

If you would be interested in adding news headlines that automatically update, check out http://www.isyndicate.com. Their “express” version of this service should be fine for most cases and it doesn’t cost you a dime. Basically the way this works is you sign up for their service, choose the content you want and copy/paste JavaScript code to your HTML. Whenever your page is viewed online, the user will see fresh, updated content that didn’t require you to update yourself. You might also want to look into Reuters news photographs that automatically update. This is a free service through your membership with isyndicate.com and you will have the opportunity to add additional services to your site with your membership. Just be careful you don’t make the mistake adding too much content. All of these special features can only be accessed through other servers, which means you’ll have to attach a link to these locations. With the high popularity of many of these free and useful services, you can expect a somewhat moderate delay for the additional content to load.

Updating files is easy. Simply select the file(s) you want to update and transfer it to the appropriate directory on your online account. The update occurs almost instantly.

To view Web page document updates, you may have to click your browser’s “Reload” button. The reason for this is because the programmers of Web browsers created a method where Web pages, graphics, and other content become cached. With cached Web pages, the Web sites you visit most often load faster than having to download the entire site all over again. By clicking the “Reload” button, the cache file will regenerate.

Side Note: Speaking of the caches, it’s a good idea to erase these collective files on a frequent basis (we recommend once every week) because they are known to take up large amounts of disk space and virtual memory.

The default cache folder for Netscape Communicator is: C:/Program Files/Netscape/username/Cache (where “username” is your specific username.

The default cache folder for Microsoft Internet Explorer is: C:/Windows/Temporary Internet Files

Determining the Web Site URL

June 10th, 2007

When you’ve done uploading your site for the first time, you’ll want to check it to confirm it looks the same as you’re locally stored copy.

Your “host address” is generally the determinant of your URL. If you uploaded your contents to “www.pcmachines.com” or “www2.pcmachines.com”, your URL would most likely be http://www.pcmachines.com/username or http://www.pcmachines.com/~username. If none of these variations work, give your hosting provider a call and ask them how to determine your site’s URL.

If you get a listing of your directory structure instead of having your home page display, most likely you forgot to name your home page as “index.html” (the Internet standard for naming home pages). Another possible variation of a proper home page filename is “home.html”. If none of these variations work, there may be a server misconfiguration error. Contact your hosting provider if you need further assistance at this point.

Transferring Files for the First Time

June 10th, 2007

For this process, you are essentially creating a clone of your locally stored Web site. Its detrimental, however, that you upload every file and that they’re stored in the same folder as on your personal computer. If you’re local and Web versions aren’t the same, then its likely you’ll have plenty of annoying Apache “Error 404: File not found” messages showing up. The file transfer process is very simple. You’ve already created the folders so it’s just a matter of uploading their associative files and you should be all set.

To upload files with FTP Explorer, first switch to Binary mode if its not already set there (click the “B” button). We suggest clicking on the “Details” button (showing a list) on the taskbar. This will allow you to view information pertaining to a specific file’s size, type, creation date, etc. You can upload files through using the “Upload” button (the up arrow). Be sure to be in the current directory that you plan to upload the files in and that the directory matches the directory you’re uploading your files from. In the “Upload” dialog box, select the files you want to transfer (use the “Ctrl” button to select specific scattered files or click the first file and hold down the “Shift” key and click on the last file listed to select all you files in the current directory) and click “Open.” Repeat this process to upload files from other directory locations.

Side Note: If you ever want to download files from your directory, be sure to set a download path in your profile. If you download files using the “Download” button, they will download to the default path provided by FTP Explorer. This will save you valuable time trying to find your downloaded files. (You can always use the “Download To” option if you don’t set a download path or use the download feature on a less frequent basis.)

Setting up your Web Directory

June 10th, 2007

You’ll need an Internet connection for this step (unless of course you’re on an Intranet). When you’re logged on, load FTP Explorer. Double-click on your profile name you created in the previous tutorial to log on to your account. You should see some files in this area, among them a folder titled “www.” If this folder is currently non-existent, create one for your account. This folder will be termed your “root directory” and your Web site will be set-up here. Double-click on this folder and create the same folders you created with your locally stored Web site. Make sure the spelling and capitalization for the folders are correct and entirely alike. The Internet is very much case-sensitive. When you’re done, move onto the next step where you will finally “go live” and have an on-line presence on the World Wide Web.

Setting up FTP Explorer

June 10th, 2007

If you haven’t done so already, download FTP Explorer from http://www.ftpx.com. When you get to the Web site, click on the “Download It!” button to proceed. Choose the “FTP” version of FTP Explorer and click the appropriate link to download the program.

We’re going to assume that you already know how to install programs to your hard drive. If you don’t, installation is simple. If you have WinZip (available at http://www.winzip.com) or another program capable of decompressing ZIP (.zip) files, then double click on the installation icon and “unzip” them to a temporary folder (such as C:/temp). Afterwards, double-click on the “Setup” file to proceed with installation. Follow the given instructions for assistance in the program installation process.

  1. Click “Next”
  2. By default, the installer will specify the path “C:\Program Files\FTP Explorer”. If this is ok with you, click “Ok.” If you get a message asking if you want to create the directory, click “Yes” to continue.
  3. By default, you’ll see 4 checkbox fields checked. Unless you really want to read the “readme” file to view program-related information, you can eliminate the fourth choice (deselect “Display Readme File”). This will leave you with 3 choices, which you may find useful at some point.
  4. You’ll get a message saying your system needs to be restarted. Click “Yes” to restart your computer to complete the initial program set-up process.
  5. Read the License Agreement and click “I Agree” if you agree to the specified terms.
  6. Click “Yes” to provide an e-mail address to log onto FTP sites anonymously in the future. If you don’t have an e-mail address at this time, or wish to provide an acceptable temporary e-mail address, enter “someone@somewhere.com” for the time being. This e-mail address will serve as your password to log onto FTP sites allowing anonymous users. Click “Ok” to proceed.
  7. Click “Yes” to create some sample connection profiles. You will find these profiles useful for assisting you in setting up future profiles, if needed.

Among these profiles includes addresses to the Microsoft and Netscape FTP sites. From here, you can download the most recent copy of either browser program faster on the FTP network.

At this point, the program set-up is complete. To set-up your directory to reflect your specific directory information, give your ISP (Internet Service Provider) or Web hosting provider a call. Some ISPs actually provide free hosting as a promotional offer, so it’s worthwhile checking with them. Just ask them for information on setting up your Web directory for hosting your Web site. Additionally (and if the phone lines are busy) you might want to check the company’s Web site as another option. Be sure to write this information down in the case you may need reference to it in the future or you accidentally delete your profile information. Refer to page 92 for a listing of popular hosting providers and their appropriate URL so you can obtain an account with them.

When you get this information (make sure you get the host address, login, and password), refer below for profile set-up assistance. When you load FTP Explorer (or click on the “Connect” button) you’ll see a list of profiles you created in step 7 above. Click the “Add” button to add your new profile and use the explanations and/or recommendations given below to assist your input.

Fields marked with an asterisk (*) are generally supplied by your hosting provider.

  • Profile Name: Use your Web site’s name
  • Host Address: *
  • Port: 21 (default for most servers)
  • Login: *
  • Password: *
  • Initial Path: This field is typically non-mandatory. It’s generally used when your Web site is hosted off a shared account. It’s also helpful when you want easier, faster access to a specific area far from your root directory.
  • Attempts: 1 (default). This field allows you to specify the amount of log-on attempts in the case you’re disconnected from your server due to heavy traffic, etc.
  • Retry Delay: 10 (default time in seconds). This field specifies the wait period before continuing the next log-on attempt, if given.
  • Download Path: This field sets the default path for all server downloads. It is typically non-mandatory but helpful if you need to download files from your account and don’t want to click the “Download To” button and specify a location all the time.
  • Description: This area allows you to place a short description of your site if you maintain several Web sites at one time. We recommend you provide a copy of your username and password in this area in the case you misplace your written record or accidentally change your username and password information, usually crucial for logging on to your directory. Accidentally deleting your log-on information can easily be done in the event you select “Anonymous.”

Click the “Save” button when you’re done entering your account information.

Making Last Minute Changes

June 10th, 2007

Make sure you make all the necessary changes before publishing your files on-line (a process commonly referred to as “going live”). You surely don’t want any spelling mistakes or hyperlinks that don’t link anywhere. And you’ll definitely want to check your Web pages with Microsoft Internet Explorer and a copy of Netscape Communicator. If you’re site isn’t visually compatible with both browsers, now is the time to make the appropriate corrections. You don’t have to make you’re Web pages appear exactly 100% alike in both browser programs. Just make sure they appear nicely in both of them.

Make sure your Web site elements are nicely arranged in an organized manner. For example, why would you want Web pages in a graphics folder? Your elements should be placed in areas that not only make sense to you, but also to others. You may need help in the future if your site becomes incredibly successful and need more Web pages and elements created.

Look back at the tutorials given throughout the book up to this point. Have you forgotten anything? If you have, create what you want now. When you’re absolutely sure (or have a good sense) that everything is correct, feel free to continue with the next chapter.

Troubleshooting

June 10th, 2007

This section will help you troubleshoot some common mistakes relative to your design. Be sure to check your program’s help file for specific program-related help. Simply click on the “Help” tab on the program’s file menu to access this information, if provided.

My pages load too slowly. What can I do?

Try running an HTML validator. If possible, try removing some graphics if your have a large number on your pages. Every Web page should preferably be less than 100 kilobytes in size. If all else fails, try compressing them. A nice JPEG compressor called JPEG Imager is available for download at http://www.geocities.com/SiliconValley/Grid/7726/index.html. You can compress GIF images with GifClean32 from http://members.tripod.com/~mharing/gifclean.html. A fairly new concept, compressing the HTML pages themselves can be done with HTML (Un)Compress (http://gallery.uunet.be/Jacobs.Jan/htmlcomp/index.htm) or HTML Compressor (http://www.pc-guru.com/Products/html_compressor.htm). If your pages are still loading slowly, try switching to another hosting provider offering greater speed. And its possible the problem could be your modem or the processing capability of your computer system.

There are online GIF and JPEG image compressors if you’d rather compress your images there. For GIF images, go to http://www.gifcruncher.com and http://www.jpegcruncher.com for JPEG images.

I created my graphics in an image editor and they looked fine. Now they’re too big on screen. What can I do?

Look at your HTML and use your program’s “Find” feature (if available) and type in “<IMG” in the appropriate field. This will give you all the image tags in your document. If you happen to come across any graphics that have dimensions greater than what you created them at, find the graphic’s true dimensions (which can usually be done with your graphic editor by looking up the “Image Information”) and enter the correct dimensions into the HTML. Sometimes graphic editors use different zooming ratios other than 1:1 (the standard view). If you created your image in a ratio greater (or smaller) than 1:1 and saved them, then they would show up larger on Web browsers because the browser program calls images up at a 1:1 ratio level. To correct this problem, simply use your graphic editor’s “Resize” feature, if available. (Some programs may use a different name.)

My Web page address isn’t called up in any search engine. What can I do?

You have one of two options here. You can try re-submitting them or deleting a file called “robots.txt” if it exists. Usually, it takes about 2 weeks for a search engine to list a URL in their database. Sometimes, for some odd reason, your URL submission never makes it in. If you used a free promotional URL submission services (like http://submititfree.linkexchange.com), try re-submitting your URL to some of the more popular search engines. You’ll conveniently find a listing of these search engines starting on page 87. There are also valuable programs on the market that have the ability to submit your URL to thousands search engines. If you’re interested in obtaining a copy of one of these programs, we recommend SubmitWolf Pro (http://www.trellian.com/swolf) from Trellian.

If re-submitting your site fails, try looking for a file called “robots.txt.” This file’s intention is to prohibit search engines from searching your site, which is generally not recommended. To remove it, look in your root directory for this file. If it exists, simply click on it delete it by clicking the “Delete” button on your keyboard.

If trouble still exists trying to get your site listed in an acceptable position among other Web sites, try a professional Web site marketing service. A nice promotion service, Global Promote (http://www.gloprom.com) and they submit your site for international exposure. Although it may cost you some money, you’ll find it well worth it in the future as your site starts making a profit of its own.

It’s important to realize that not all Web sites can be listed in the top positions. Search engines generally list their URLs from specific criteria. You might want to take at various search engines’ submit page to learn more about this criteria.

Testing the Site Appearance

June 10th, 2007

Do your Web pages look like the way you created them in FrontPage Express? They should match well because you used a WYSIWYG type editor to create them. But sometimes in different browsers the overall appearance of your Web pages can get a little messy (i.e. skewed buttons, text formatting errors, etc.). The best way to fix these mistakes would be to first go back and correct them using the WYSIWYG view of FPE. After saving them, go back and update your Web browser’s view by clicking the “Reload” button. If you’re still having problems, use an HTML validator to check your code.

Behavioral Studies

June 10th, 2007

Unfortunately, as with most things in the world, not all things get along with each other. In the “browser war” every Web browser tries to rule over each other with new and improved functionality on the Web. What this creates is a somewhat different behavior (and appearance) between the programs. Simply looking at a Web site with Microsoft Internet Explorer and Netscape Communicator, for instance may produce a very different look. This is due in part to how the programmers programmed their browser to act with various HTML elements, etc. Fortunately, you have the ability to correct major mistakes, namely through using HTML validators (simple programs that check the HTML code of your Web pages for errors). A common mistake that can be corrected through using HTML validators is slowly-loading Web pages. The most common problem is that some of your tags haven’t been closed or they weren’t closed properly. A nice HTML validator called CSE HTML Validator Lite (the special edition of the full version package) has the ability to check your HTML documents for syntax errors and other problems. It’s available for download at http://www.htmlvalidator.com.

To check the behavior of your Web pages, we recommend downloading a copy of Netscape 3 and a version of Microsoft Internet Explorer (version 4 or above would be fine because its installed on most computers). The reason why we recommended testing your pages on an old copy of Netscape is because pages tend to act a little differently on that version than on the newer versions. You can be assured that the errors you correct with Netscape 3 will view correctly with most other versions of Netscape (and especially the newer ones). Unfortunately, you won’t be able to find a copy of Netscape 3 on Netscape’s corporate Web site since they promote their most recently developed versions. Probably the best method to obtain a copy of version 3 online would be to conduct a search using your favorite search engine (i.e. HotBot, Infoseek, Yahoo!) for the query “Netscape 3.” If that doesn’t produce satisfactory results, try using “Netscape Navigator 3,” or more specifically “Netscape Navigator 3.03″ or “Netscape Navigator 3.04,” for example. At the time of this publication, both versions were available for download at the FTP address: ftp://ftp.netaxis.qc.ca.