This guestbook script will quickly and easily allow your visitors to post comments to your site.
You can ban IP addresses and keywords to keep spammers from accessing your guestbook.
This software is released under the GPL. Please see the included LICENSE file.
Copyright (C) 2003 Erin Spiceland This program is free software; you can redistribute
it and/or modify it under the terms of the GNU General Public License as published
by the Free Software Foundation; either version 2 of the License, or (at your option)
any later version. This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this
program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite
330, Boston, MA 02111-1307 USA Use this script at your own risk! I make no warranties
that it is hack proof!
1. Upload the .zip or .tar.gz file directly into your cgi-bin directory. Do
this on commandline:
$ unzip filename.zip *** or***
$ tar -zxvpf filename.tar.gz
2. Move the 'guestbookdata' directory out of the cgi-bin. This directory holds the css file and icons for the script, and
cannot be located inside the cgi-bin. You must move it outside the cgi-bin and then specify the new location in the configuration.
3. Check your permissions. Your directory structure will now look like this. Listed out to the side are the
permissions for each file. If you used the tar.gz file, your permissions will
automatically be set, because tar saves them. If you used the zip file, you will
need to set these permissions yourself. A quick way to do this is with the following:
$ chmod 755 *.cgi *.pl protected/*.cgi
| guestbook/data/entries.dat | -r-wr--r--- | chmod 644 |
| guestbook/data/banned_words.dat | -rw-r--r--- | chmod 644 |
| guestbook/data/banned_ips.dat | -rw-r--r--- | chmod 644 |
| guestbook/guestbookdata | drw-r--r--- | chmod 644 |
| guestbook/lib/ | drwxr-xr-x- | chmod 755 |
| guestbook/lib/BBCode.pm | -r-wr--r--- | chmod 644 |
| guestbook/lib/common.pm | -r-wr--r--- | chmod 644 |
| guestbook/lib/Entities.pm | -r-wr--r--- | chmod 644 |
| guestbook/lib/lang.pm | -r-wr--r--- | chmod 644 |
| guestbook/lib/sitevariables.pm | -r-wr--r--- | chmod 644 |
| guestbook/index.cgi | -rwxr-xr-x- | chmod 755 |
| guestbook/LICENSE | -r-wr--r--- | chmod 644 |
| guestbook/protected/ | drwxr-xr-x- | chmod 755 |
| guestbook/protected/manage.cgi | -rwxr-xr-x- | chmod 755 |
| guestbook/post_template.html | -r-wr--r--- | chmod 644 |
| guestbook/README.html | -r-wr--r--- | chmod 644 |
| guestbook/template.html | -r-wr--r--- | chmod 644 |
| guestbook/upgrade-from-1.0-to-1.1.pl | -rwxr-xr-x- | chmod 755 |
4. Make sure all these files are owned by the right user. If you are on a server that is not your own, you
are most likely ok. Ask your system administrator if you think you may need to change the ownership of these files.
If you are on your own webserver or if your server uses mod_perl, sometimes you will have to change the ownership to "apache" or "nobody" to get
the scripts to run. Do this with:
$ chown apache:apache * -R
5. Choose your language. My Guestbook is automatically set up to use English. If you are using another
language that is already supported by My Guestbook, just rename your appropriate language file to be
named "lang.pm," like this:
$ cd lib/
$ cp francais.pm lang.pm
cp: overwrite 'lang.pm'? y
$ cd ../
If you do not see a file with the name of your language, it is not supported yet.
If you end up creating your own language file for a language that My Guestbook does not already have, please send
me a copy of your lang.pm named according to its language (francais.pm, not french.pm, please). To create your own,
open "lib/lang.pm" and only change phrases that are between quotes. If you change anything else, like the "our" or
the phrase following $ , which makes up the variable name, you could break the script. Example:
our $comments = "Comments"; # English
our $comments = "Commentaires"; # French
6. You may need to modify the first line of index.cgi, subscribe.cgi, comments.cgi,
post_from_email.pl, the plugin scripts, protected/post.cgi, and protected/manage.cgi
to point to where perl is located on your server. Basically, its just pound, exclamation point, then the path to
the perl executable.
#!/usr/bin/perl (most common, and the default for this script)
#!/usr/local/bin/perl
7. Password protect the "protected" directory, so others cannot delete your guestbook. If you are on a
UNIX or Linux server, you can use htaccess to do this. Contact your system administrator or google for
"htaccess" to find out how. Also, no matter what kind of server you are on, you may have a tool in your
control panel to password protect files and directories. I cannot stress how important it is that you
password protect the posting portion of this script. Because this script is open source, meaning
anyone can see my code, anyone who has used this script will know how to access the post script.
Your only hope for security is to password protect it.
8. Now just point your browser at it! http://yourdomain.com/cgi-bin/guestbook/index.cgi.
1. Unzip or untar the archive file into a directory on your computer.
2. Move the 'guestbookdata' directory outside the cgi-bin.
This directory holds the css file and icons for the script, and cannot be located inside the cgi-bin. You must move it outside the cgi-bin and then specify the new location in the configuration
3. Choose your language. My Guestbook is automatically set up to use English. If you are using another
language that is already supported by My Guestbook, just rename your appropriate language file to be
named "lang.pm," like this:
$ cd lib/
$ cp francais.pm lang.pm
cp: overwrite 'lang.pm'? y
$ cd ../
If you do not see a file named with your language, it is not supported yet.
If you end up creating your own language file for a language that My Guestbook does not already have, please send
me a copy of your lang.pm named according to its language (francais.pm, not french.pm, please). To create your own,
open "lib/lang.pm" and only change phrases that are between quotes. If you change anything else, like the "our" or
the phrase following $ , which makes up the variable name, you could break the script. Example:
our $comments = "Comments"; # English
our $comments = "Commentaires"; # French
4. You may need to modify the first line of index.cgi, comments.cgi, post_from_email.pl, the plugin scripts, and protected/post.cgi
to point to where perl is located on your server. Basically, its just pound, exclamation point, then the path to the
perl executable.
#!/usr/bin/perl (most common, and the default for this script)
#!/usr/local/bin/perl
5. Upload the files to the server. Make sure the directory structure is the same (all the folders are in the same
place as they werewhen you unzipped the file.) You should put all the files in your cgi-bin directory. Make sure
you upload them in ASCII mode, NOT binary mode. Uploading them in binary mode will turn all the files into useless
garbly goop that cannot be executed.
6. Make sure all the executable files have execute permissions. Use your control panel to give all .cgi and .pl
files executable permissions. If you do not know how to do this, contact your system administrator.
7. Password protect the "protected" directory, so others delete your guestbook. If you are on a
UNIX or Linux server, you can use htaccess to do this. Contact your system administrator or google for
"htaccess" to find out how. Also, no matter what kind of server you are on, you may have a tool in your
control panel to password protect files and directories. I cannot stress how important it is that you
password protect the posting portion of this script. Anyone who has used this script will know how to
access the post script. Your only hope for security is to password protect it.
8. Now just point your browser at it! http://yourdomain.com/cgi-bin/guestbook/index.cgi.
See
our FAQ or read below.
If you get an internal server error, run it from command line so that you can see what
is going wrong and check your server logs for helpful error messages. For instance, if its
index.cgi that's giving you problems, do:
$ ./index.cgi
If it's running correctly, it will return alot of html code. If it does anything else, its obviously
broken. Look at the output and see if you can make sense of it. Here are some sample errors and explanations
on what they mean and how to fix it.
$ ./index.cgi
Can't locate SOMETHING in @INC (@INC contains: /usr/lib/perl5/5.8.0/i386-linux-thread-multi /usr/lib/perl5/5.8.0
/usr/lib/perl5/site_perl/5.8.0/i386-linux-thread-multi /usr/lib/perl5/site_perl/5.8.0 /usr/lib/perl5/site_perl
/usr/lib/perl5/vendor_perl/5.8.0/i386-linux-thread-multi /usr/lib/perl5/vendor_perl/5.8.0 /usr/lib/perl5/vendor_perl
.) at ./index.cgi line 29.
BEGIN failed--compilation aborted at ./index.cgi line 29.
This can mean one of two things. Its looking for a perl module to load. It either means that you do not have that perl
module installed, or that it is installed into the wrong directory and perl can't find it. If SOMETHING is common.pm,
sitevariables.pm, or lang.pm, then you are missing the lib/ directory or one of the files in it, and you
need to download and reinstall My Guestbook. If it is CGI.pm or Digest/MD5.pm, you do not have a perl module
that is required to run My Guestbook. If you do not have one of these perl modules, you must install it. Contact
your system administrator and request that they add that module to the server, or do a
local install of it.
$ ./index.cgi
bash: ./index.cgi: Permission denied
Again, this error message means one of two things. Either index.cgi does not have execute permissions, or it is not owned
by the correct user. See the installation instructions above to determine which of these is the case.
$ ./index.cgi
bash: ./index.cgi: /usr/bin/perl: bad interpreter: No such file or directory
This means that your shebang line (the first line in any perl script) does not point to where perl actually resides on
your server. See the installation instructions on the importance of this and how to fix it.
If you receive any other error messages, feel free to email them to me, and I will do my best to explain what they
mean and how to remedy the situation. These are the three most common error messages you may get, and they are all
easily fixable. There is also a
forum and a
FAQ.
| 10.23.06 | version 1.1 | Completely rewrtten using CSS and in the style of our other scripts. Added many spam-blocking features, such as the ability to ban words and IP addresses. Added an Admin panel where Admin can delete entries and manage banned words and IPs. |
| 04.20.02 | version 1.0 | First Release! |