############################################################################## # Cliff's Pic-Post Script Version 4.08 # # Copyright 1998 Shaven Ferret Productions # # Created 6/21/98 Last Modified 09/28/99 # # Available at http://www.shavenferret.com/scripts # ############################################################################## # COPYRIGHT NOTICE # # Copyright 1998 Shaven Ferret Productions All Rights Reserved. # # # # This script can be used\modified free of charge as long as you don't # # change this header, or the parts of this script that generate the return # # link\form. If you really need to remove these, go to # # http://www.shavenferret.com/scripts/register.shtml . By using this script # # you agree to indemnify me from any liability that might arise from its use.# # # # Redistributing\selling the code for this program without prior written # # consent is expressly forbidden. # ############################################################################## Hello. These are the instructions for how to install and use the Pic-Post script. You should have the following files... * admin.cgi ------- the script that handles administrative features * picpost.cgi ----- the script that handles publically available features * picpost.shtml --- the temporary main page * pp-lib.cgi ------ the perl library * ppcount.cgi ----- the script that handles the counting * ppsetup.cgi ----- the setup file * readme.txt ------ the file you're reading now If you're missing any of these files, you can download them from http://www.shavenferret.com/scripts/picpost/ . If you're new to the wonderful world of perl, this probably seems like a lot to handle. Just relax, and take it one step at a time. You will need to know the following things to install the script: * Your server path * Your URL * Where perl is on your system * Where your mail program is * How to set a file's permissions If you don't know any of these things, see the bottom of this file. You may also want to plan out where you're going to put everything. You'll need to create one directory for the data, one for the posts, and for the sake of neatness you may want to create a directory for the scripts, though you won't need to. You will, however, need to have all the files that end in .cgi in the same directory. You'll also have a main pic-post page (picpost.shtml) that you can put wherever you want. ****************************************************************************** * Step 1 - Telling the script where it can find perl * * You can skip this step if the path to perl on your system is /usr/bin/perl * ****************************************************************************** Open admin.cgi, picpost.cgi, and ppcount.cgi in a text editor. The absolute first line of these files should read #!/usr/bin/perl . Change this to #! and then the path to perl. For example, if the path to perl is /blah/directory/perl, you'd make the first line #!/blah/directory/perl . ****************************************************************************** * Step 2 - Configuring everything on your computer * ****************************************************************************** * A few quick notes about Windows NT. * This script *might* run under NT. The keyword there is might, as is not * definately, don't be surprised if it doesn't work out. If you are on an NT * server, double the backslashes when entering server paths. For example, if * the server path to the data directory is C:\bleh\somedir\data, enter is as * C:\\bleh\\somedir\\data. Note that you need to use backslashes (\), not the * forward slashes (/) that are already there. If that doesn't work, then I'm * sorry, but I can't help you. Heh, serves you right for patronizing * Microsoft. Bad webmaster.. ****************************************************************************** This is probably the longest part of installing the script. Just bear with me... First of all, open ppsetup.cgi in a text editor. Scroll down to line 25, and change shavenferret.com to the password you want to use. Whatever you do, do NOT leave it as shavenferret.com, as that would make it just a little too easy to hack your pic-post site. Now scroll down to line 28. Change /server/path/to/picpost.shtml to the server path (not the URL) to your main pic-post page (originally picpost.shtml, though you may want to rename it). Scroll down to line 31 and change http://www.yourdomain.com/picpost.shtml to the *full* URL of the main page. It is very important that you use the full URL (including the http:// and the domain), because the script will use this information in e-mail. Scroll down to line 35 and change /server/path/to/posts/ to the server path (not the URL) to your post directory that you will create. Do not inlude a trailing slash. This directory must be publically viewable, because most of the HTML the script creates will go here. Scroll down to line 39 and change http://www.yourdomain.com/posts to the URL of the post directory (the same directory whose path you just entered above). Once again, do not include a trailing slash. Scroll down to line 43 and change /server/path/to/data to the server path to the data directory that you will create. Do not include a trailing slash. While this directory does not need to be publically viewable, it won't contain any sensitive information, so you can really put it wherever you want. Scroll down to line 46 and change http://www.yourdomain.com/cgi-bin/picpost.cgi to the *full* URL of the picpost.cgi file. This has to be the full URL, because the script uses this information in e-mail; and you'll also need it if you join the Get More Posts program. Scroll down to line 49 and change http://www.yourdomain.com/cgi-bin/admin.cgi to the *full* URL of the admin.cgi file. This has to be the full URL because it will be used by the script with the blacklisting feature, and you'll need it if you join the Get More Posts program. Scroll down to line 52 and change http://www.yourdomain.com/cgi-bin/ppcount.cgi to the *full* URL of the ppcount.cgi file. This needs to be the full URL because the script will use it if you choose to track how many hits you receive from other sites. Scroll down to line 55. If the path to your mail program is not /usr/lib/sendmail (it almost always is), change this to the path to your mail program. Now you'll need to tell the script if you have libwww-perl installed. This is required for the link checker, but you can use the script without it. If you have libwww-perl on your system (you probably do), delete the # in front of line 58, so that it just reads: use LWP::Simple; $lwp = -1; If you don't have libwww-perl on your system, leave this as it is. If you're not sure if you have it, I recommend deleting the # and seeing if it works. If it doesn't, you can always put the # back and try again. Finally, if the URL of the picpost.cgi file is not /cgi-bin/picpost.cgi, open picpost.shtml (the temporary main page) in a text editor and change /cgi-bin/picpost.cgi to the URL of picpost.cgi in line 7. Congratulations, you're done the long part! ****************************************************************************** * Step 2 - Setting everything up on your server * ****************************************************************************** First of all, whenever uploading any perl script, use ASCII. This is because if you upload as binary, it screws up the line breaks. Upload all the files that end in .cgi to a directory where you can run CGI. All of these files *must* be in the same directory. Create the data and post directories. These are just normal directories, you don't need to put anything in them (the script will do that). If upgrading from an earlier version of this script, you can obviously skip this step, as you created the directories when you first installed the script. Upload the picpost.shtml file. If upgrading from an earlier version of this script, skip this step. Set the permissions of every file that ends in .cgi or .pl to 755. If whatever you use to set permissions makes you check things off, for 755 you'll check off everything under owner, read and execute under group and others. Set the permissions of both directories and picpost.shtml to 777. If whatever you use to set permissions makes you check things off, for 777 you'll check off everything. ****************************************************************************** * Step 3 - Update your data. * * Skip this step unless you are upgrading from a version of the script before* * version 4.00. * ****************************************************************************** This version of the script holds a lot more data on each post. If you've been using an earlier version of the script, you'll have to update everything. Don't worry, I've created a small script that will do all this for you. If you haven't done so already, you can get it @ http://www.shavenferret.com/scripts/picpost/download/ppupdate.cgi This script will use the information in your ppsetup.pl file, so it shouldn't take more than 30 seconds to get everything done. First, open the ppupdate.cgi file in a text editor, and change the first line to #! and then the path to perl. Now upload ppupdate.cgi as ascii to the directory which holds all the other .cgi and .pl files, and set its permissions to 755. Go to it with your web browser, enter your administrative password, and click the button. You're done. You can now delete the ppupdate.cgi file if you want to, it won't be used again. Do *NOT* run ppupdate.cgi more than once. If you do, it will corrupt your data. ****************************************************************************** * Step 4 - Finishing everything up. * ****************************************************************************** Point your web browser at the uploaded admin.cgi file. This is where you'll go to approve\delete posts, add banners, and pretty much do everything you'll need to do to run the pic-post page. You should see a form asking you to click a button that will let me know that you're using the script, so that I'll be able to keep track of how many sites are using it. Click it (duh), and click the button that you'll see next. This will take you back to your admin page, which will now be ready for you to use. You'll probably want to add some banners, screw around with the settings, etc.; everything will be explained in plain English inside. ****************************************************************************** * Troubleshooting * If you're having problems with the script, please read the following before * asking me for help. ****************************************************************************** * One of the .cgi files returns 500 Internal Server Error * Make sure you've changed the first line of the file to #! and then the path to perl on your system * Make sure you've uploaded the file as ascii, not binary. * Make sure you've set the permissions for the file to 755. * You may not have libwww-perl installed on your system. Try putting a # in front of line 58 of ppsetup.pl . If you don't have libwww-perl on your system, and you want it, you'll have to ask your system administrator. * Main page is not updated * Make sure that you've entered the server path (not the URL) to the main page in ppsetup.cgi * Make sure that you've set the main page's permissions to 777. * Counter doesn't count hits to pages * Try changing the extension of the page's to .shtml. You can do this through the admin page for everything except the main page, which you'll have to do by renaming the file and changing the ppsetup.pl file to reflect the change. * There's a slim chance that you don't have SSI, which the counter requires. Yell at your system administrator, or deal with it. * The text "An error occurred", or something like that, appears at the top of the pic-post pages. * Make sure that you've entered the correct URL to the ppcount.cgi file in ppsetup.pl * Make sure that you changed the first line of ppcount.cgi to #! and then the path to perl on your system. * Make sure that you set ppcount.cgi's permissions to 755. * Script doesn't send e-mail, or crashes whenever it should. * Make sure that you've entered your e-mail address correctly. * Make sure that you've entered the correct path to your mail program. Do not add a -t to the end of this. I know you had to in earlier version of this script, and several other scripts, but you don't have to here. * I'm not getting nearly enough posts! * Okay, this is a pathetic attempt to plug my Get More Posts system. Seriously, though, in the 4 months that have passed since I first created the system, *every* single picpost page has received more posts than it has sent. This may sound impossible, but keep in mind that we're dealing with copies of data (an image can be posted to billions of pic-post pages). * My life feels empty. How can I be happy again? * Send me money. I *really* need it, I was stupid enough to release this script, which is probably worth about $400, for free; and I haven't stopped kicking myself in the ass since. To help me out a little, go to http://www.shavenferret.com/scripts/register.shtml ****************************************************************************** * Getting the information you need to set everything up * ****************************************************************************** You can get any of the information you need by asking your system administrator, though you probably shouldn't do that unless you really can't figure it out yourself. System administrators don't like having their time wasted, and they do have the power to screw you over and all. If your server provides a FAQ, like most do, you'll almost definately be able to find your server path there. This ends the same way as your URL, but begins differently. Don't know your URL? It's the thing that begins with http://. Not to sound too elitist, but if don't know your URL, you might not be just ready to play with CGI. If you don't know the path to perl, I suggest trying it as /usr/bin/perl. That will be correct on about 99.99% of all servers. If it doesn't work, check your FAQ, or if you have telnet access, type "whereis perl" (without quotes) at the command prompt. If your server has multiple versions of perl, use perl5. If you don't know the path to your mail program, first try it as /usr/lib/sendmail . Like the path to perl, this is almost always correct. If it doesn't work, though, consult your FAQ, or telnet in and type "whereis sendmail" at the command prompt. Setting a file's permissions (chmod) - This probably is the one thing that confuses webmasters new to CGI more than anything else. It's not really as confusing as it first seems, though, and if you plan on using CGI you are going to need to know how to do this. What it basically means is that you need to tell your server who can do what with a file. If you have telnet access, cd to the directory which holds the file whose permissions you want to set, and type chmod For example, chmod 755 picpost.cgi for the picpost.cgi file, or chmod 777 data for the data directory. If you update your page with an FTP client, you can probably set permissions this way, too. To find out how, consult the help file for your FTP client. In my experiance, it's usually done by highlighting the file, right-clicking, and selecting chmod for the list. Many servers also provide a way to do this through the web. To find out if your's does, and how to use it, check your FAQ or ask your system administrator. ****************************************************************************** If you still need help, go to http://www.shavenferret.com/scripts/help.shtml