########################################################################### # Testing Server Side Includes - readme.txt # Copyright 1997 1999 by Advanced Business Systems # http://www.scrubtheweb.com/abs/ # Written By : AMF abs@scrubtheweb.com # # Date Last Modified : Saturday, January 09, 1999 12:00:00 AM ########################################################################### Below are the files which are included in your test.zip file: 1) readme.txt - This file, which explains installation etc. 2) test.pl - The executable Perl program for testing SSI 8) test.shtml - A sample/test page that includes the SSI command ########################################################################### BASIC INSTALLATION (SETTING PERMISSIONS) Before I go any further I would like to point out that 99% of all Host Providers which allow you to run your OWN Perl applications have Server Side Includes turned ON. If for some reason this program does NOT work for you, chances are you did something wrong. Please ask your provider for assistance. Your Web server must have permission to read, write or execute as needed. Once you have unzipped the files, you must then set the correct permissions after they are placed on the server. On UNIX systems, you will use the "chmod" command. The following table is a quick guide to setting permissions for UNIX servers. You can also use many FTP programs to set permission levels after upload. PERMISSION COMMAND rwxr-xr-x chmod 755 filename Note: Not setting your permissions correctly is the NUMBER 1 reason why installations fail. Take time to get this right. The actual permissions required for this application is listed in the next section. ########################################################################### BASIC INSTALLATION Before making ANY modifications to these files you should make a backup and work with the backup files instead of the originals. All files which have the extension of ".pl" are program files. At the top of your "test.pl" file (in the source code), there is a line that reads: #!/usr/bin/perl This is the path to "your" Perl. This path MUST be set correctly or the applications will NOT run. Check with your Host Provider and ask them what is your correct path for Perl. Most providers have a FAQ file which will give you this information. This is the ONLY line in your test.pl file which may need modification. If you are not sure what this should be, ask your provider. If your provider doesn't know, get a new provider! ########################################################################### FILES AND PERMISSIONS For example purposes, we are assuming your CGI directory is called "cgi-bin". Substitute your "cgi-bin" directory name with your correct path. ** WARNING ** MAKE SURE YOU UPLOAD ALL "*.pl" FILES AS ASCII. For some reason people are NOT doing this and the program will NOT work. cgi-bin (drwxr-xr-x) - chmod 755 | |____test.pl (rwxr-xr-x) - chmod 755 -- (www.your-domain.com) Your normal area for storing HTML files | |____test.shtml - upload as any other *.html, *.htm etc.. Your "cgi-bin" directory is the root directory of the application. It must have permissions which allow the web server to read and execute. This should already be set by your Host Provider. ########################################################################### FILE EXPLANATIONS The "test.pl" file is the ONLY program file. It will simply print a couple of HTML lines when you load test.shtml with your browser. No modifications are needed (except for the line that reads: "#!/usr/bin/perl"). Make sure you set your Perl path correctly! This file MUST be uploaded as ASCII. The "test.shtml" file is a sample file so you can see if your server has Server Side Includes turned on (almost every server we have tested had this option turned on). Place this file on your server anywhere you can access it via a browser. Before trying to access this file, make sure you have uploaded test.pl to your server as outlined above and set the proper permissions. Once on the server, use your browser to view the test.shtml file. If this was successful, you will see a special message telling you that SSI does work! In your "test.shtml" file you will notice this line: This is a Server Side Includes command. This command assumes you have a "cgi-bin" directory. This is what most providers use for running executables. YOURS MAY BE DIFFERENT! Let's say your "cgi-bin" subdirectory is called "my-cgi-bin". You would then need to modify your "test.shtml" file to read this: If you are not sure about this or the program doesn't work, ask us and we will install these files on your server for you. Advanced Business Systems has been in business for more than 20 years. We are a very credible company and have no desire to damage our reputation. ########################################################################### QUESTIONS AND HOPEFULLY SOME ANSWERS QUESTION: When try viewing the "test.shtml" Web page, I receive an error message. What could be wrong? ANSWER: There are a couple of reasons you may receive this error message. The first thing I would check is your path to Perl. On the first line of every Perl CGI script there is a line that reads something like this: #!/usr/bin/perl/ 1. You will need to set the correct path to your Perl. See above for more information or ask your Host Provider for assistance. 2. It might be that you uploaded the test.pl script as BINARY instead of ASCII. All Perl CGI scripts MUST be uploaded as ASCII. 3. You may not have set the file permissions correctly for test.pl. This must be set to rwxr-xr-x chmod 755. 4. The path you have set in your test.shtml file could be wrong. Make sure you are using the correct path. In your "test.shtml" file you will notice this line: This is a Server Side Includes command. This command assumes you have a "cgi-bin" directory. This is what most providers use for running executables. YOURS MAY BE DIFFERENT! Let's say your "cgi-bin" subdirectory is called "my-cgi-bin". You would then need to modify your "test.shtml" file to read this: 5. You simply don't have Server Side Includes turned on. To test if this is indeed the problem. Try running the script directly without using the Server Side Includes Web page (test.shtml). To do this simply type the URL of the test.pl script. This would look something like this: http://www.your-domain.com/cgi-bin/test.pl If you can run the script from your browser then either Server Side Includes is not turned on or your SSI tag in the test.shtml Web page is incorrect. You might want to ask your host provider for help (see below for more information about SSI). ########################################################################### SERVER SIDE INCLUDES: I hope that you already know how to accomplish a Server Side Includes, and therefore I am not going to go into detail about how. If you are having trouble getting this to work I suggest you contact your sysadmin and ask them if you have access to Server Side Includes and what you need to change about your file to make it work. (See SPECIAL TIP below). SPECIAL TIP: On newer servers, by default .shtml files will parse Server Side Includes for performance considerations. On older servers, only .html files will parse server side includes for legacy reasons. All html file types, .shtml, .html, and .htm may be enabled by modifying your server setup. You can ask your provider to turn SSI on for all your browser type files if you wish. ########################################################################### Good luck and happy promotions, ABS