Once you get the answers from the provider, open bbs.cgi which is nothing but a text document. Use NotePad, a text editor or a word processor. The location of Perl or "Path" must be the first line of the cgi. For example:
| #!/usr/bin/perl |
If your provider does not use UNIX based server but PC server, you may delete the first line altogether. Extension ".cgi" does the trick. Mac based server, though they are small in number, does not need "path" either, instead you save the cgi as a "script". This can be easily done by Perl-installed-Mac. (Only if you have it!)
Go down to
| ################
# basic set up # ################ $pswd = "password"; $seed = "ob"; |
| ################
# basic set up # ################ : : #$addrss = 'nobody@visitware.com'; $smpath = "/usr/sbin/sendmail"; |
| ################
# basic set up # ################ : : $addrss = 'your email address'; $smpath = "as advised by the provider"; |
If your provider does not have sendmail or not let you use it, however, you can keep these two lines as they are. # at the head of $addrss makes the mail command void.
| ################
# basic set up # ################ : : $html = "http://localhost/bbs.html"; |
If your provider advises that you can not place the cgi script and the message board in the same directory, go down to the end of the basic set up (line 32) and uncomment #chdir "/home/httpd/html/"; by deleting # at the head. You need to change its value, too. The right path to the message board (as advised by your provider) replaces /home/httpd/html/. (Even if they seem to be in the same directory, you still might need "chdir" command. If in doubt, ask your provider.)
| ################
# basic set up # ################ : : chdir "/your message board directory/" or &error1("LINE-32",$erro5,$erro3,$!); |
Before file upload
You can make other optional changes on CGIs. Otherwise save the texts. Change carriage return and/or line feed. Mac, Windows and UNIX employ different symbols to tell where a line end (or the return key is pressed). Convert them (a lot of text editors can do this) before you upload bbs.cgi and .htaccess so that your server can understand where the lines end. The easiest way of doing this is, however, just forget about the difference and upload files as text (or ASCII) files. They are, indeed, nothing but text files (except MacPerl).
You may already have .htaccess in your directly. If so, it must have at least
| Options ExecCGI
AddType application/x-httpd-cgi .cgi AddType application/x-httpd-cgi .cgi/ |
Do have line break at the end of every line - that is, do not forget to press return key at the end of .htaccess document if you make it anew.
Few servers may not work right with the dot. Then you need AddType application/x-httpd-cgi cgi instead.
If you are a Windows user, you may not able to have a file name .htaccess. Then you have it in other name. Upload it, and then rename it to .htaccess.
Many servers do not show files that begin with a period "." that is .htaccess. If you must have it yet you cannot see it, don't panic. See if the cgi works first. Next, ask your provider.
If your server is not UNIX with certain server program, you may not need .htaccess . Then forget it and follow the direction given by the provider. PC and Mac handle a file differently.
Permission or file access mask
Since you've already made your homepage, I assume you know how to upload files. You are going to upload bbs.cgi and if necessary .htaccess. After the upload, you set something called permission or file access mask. Usually it can be done by FTP.
Select bbs.cgi and set permission to 755 (or -rwxr-xr-x) which means the owner can read/write/execute the file while others can read/execute only. The directory in which you want to have the message board needs 777 (or drwxrwkrwx) and .htaccess is to be set 644 (or -rw-r--r--). If FTP does not work, ask your provider. You may need to set permission by telnet or you may ask the provider sets permission on behalf of you.
Incidentally you may see the permission a number with four figures instead of three. If so, 755 means 0755, etc.
It's worth to try if any smaller number does the same trick. If you set bbs.cgi 705 instead of 755 and if it works, you can have more security. But I cannot tell if your server allows the cgi works under the tighter security. It all depends on your server. Ask your provider or try and see.
Initiation and test run
Once you set the permissions, run a browser. Type the the location of your cgi into the browser's location window. That is to type http://whatever your url/bbs.cgi. If the cgi works, you see the webmaster's login page. Type your password into the password field.
Else, check if bbs.cgi is in the server, the permissions is 755, and you didn't misspell the location into the browser's location window. Next, check the Perl path is right. It must be the very top of the script, no line, no space before #!. You also check the directory path chdir.. if you uncomment it. The last, check the permission of the directory where you want to have your message board installed.
The error message may tell you what is wrong:
no such file - bbs.cgi may not be uploaded right or you misspelled url.
interal server error - cgi's permission or Perl path may be wrong.
no such directory or permission denied - chdir or directory's permission was wrong.
Once everything is set straight, you will see the message board. Type a word or two, maybe your greeting to your guests. Click "OK/send" button. You will see "thank you" message and then the board with your message. If you want email notice but you can not get one, check the sendmail path ($smpath) and mail address ($addrss).
To use DoubleMessageBoard, make it sure that you have the latest DoubleMessageBoard and try it first without modification but change where you need to (especially perl path) according to the provider.
method="GET"
The last but not least, DoubleMessageBoard (arch) does not work if the server does not accept "POST" type data input. If you want it works with "GET", go to # main script # of the cgi and change the begining of it from
| ################
# main script # ################ if ($ENV{'REQUEST_METHOD'} ne 'POST') { &strts; } else { read(STDIN, $input, $ENV{'CONTENT_LENGTH'}); |
| to |
| ################
# main script # ################ if ($ENV{'QUERY_STRING'} eq "") { &strts; } else { $input = $ENV{'QUERY_STRING'}; |
| :
: <FORM ACTION="..." method="POST"> : : |
| to "GET". |
| :
: <FORM ACTION="..." method="GET"> : : |