View Full Version : Need major help installing this script
Whipsmack 02-08-2003, 07:30 PM *please read replies after this because i'm past this part but I have new questions*:stickout:
I have no idea what language it's in. I found an online auction script from everyauctions found at everysoft.com I edited the file a bit which is in .pl format but I have no clue how to install it onto my webhost. It says something about putting it in my Cgi-bin? How do I find my cgi-bin?
I'm such a n00b and I have no idea if i'll be able to pull this off. Even though I have the entire script, I just can't install it
LizMarr 02-08-2003, 08:27 PM First, you need to determine if your host allows scripts to be ran. The CGI-BIN is the standard directory for the scripts to be stored. If you had one, it would be in your web folder (the folder where your index.htm and those files found in the root of your web pages) Look to see if you have a CGI-BIN or SCGI-BIN or simular.
Next, if you don't have a CGI-BIN directory, you can try to create one and drop a script in and see if it runs. You need to be familiar with CMOD permissions. The CGI-BIN folder should have permissions of 755, as should any scripts or folders inside of it. (CGI-BIN does NOT need to be capitalized, I just did it for emphasis - it is better if it is small case)
Your "auction.pl" file should have a non-web accessible folder to put the auction information in. With my provider, the web pages go into a folder called public_html and I have access to the area underneath those to put additional folders. My auction folder is called "auctions" and it's CMOD permissions are set to 777 (which means anyone, anywhere can write, run, or delete stuff - this is why it is kept where web folks can't get to it)
If you have all of this correct, then it should work pretty simple. The key is to find out if your host allows CGI scripting and if so, do they have restrictions as to which directories CGI must be run from.
Whipsmack 02-09-2003, 01:56 AM Well yeehaa!! I'm making some progress very slowly though. I finally found my Cgi-bin. And I figured out where to edit the CMOD permissions. Oh and I also have an Scgi-bin, whats the difference?
I put the .pl file in my cgi-bin and tried to access it from the web but what happened instead of opening it on the web it downloaded the actual .pl file to the computer :( any ideas?
Whipsmack 02-09-2003, 02:07 AM "My auction folder is called "auctions" and it's CMOD permissions are set to 777 (which means anyone, anywhere can write, run, or delete stuff - this is why it is kept where web folks can't get to it)"
Let me get this right this "auctions" folder of yours is in the public_html (My web host also uses public_html for my cgi-bin)
Anyways you say 777 anyone can see/write/delete stuff (that sounds like a bad thing, so shouldn't I change that to 755? Or is the public_html a secure folder that no one can access?
Thanks!!!
Whipsmack 02-09-2003, 02:26 AM Hey lizmarr if you ever read this thread again, do you think you could talk to me over AIM or ICQ? It seems like our webhosts are similar and chatting with someone who knew what they were talking about could REALLY save me some time heh :) Anyways If you catch this message my ICQ is 25347165
LizMarr 02-09-2003, 02:38 AM OK, here is how my server tree looks:
+home
\
accountname
\
+auctions
|
+public_html
\
+cgi-bin
|
+scgi-bin
My "auctions" directory is underneath my public_html so it is not accessable via the web. The "scgi-bin" directory is a special type of cgi directory - called a "cgi wrapper". You might need to put your "auction.pl" file there. If your browser is downloading the file, I'd be willing to bet that you have something like download accelertor or something installed so it recognizing it as something that needs to be downloaded. Try putting a question mark after the name (it confuses download programs)
LizMarr 02-09-2003, 02:42 AM So much for my fancy formatting. A couple of other things -
public_html <-- anything in the public_html directory can be accessed via the web.
your "auctions" folder should be closer to the root - not a sub-folder of your public_html folder. This way it doesn't matter that it is 777 as the only way an outsider can access is via FTP using your login information.
Whipsmack 02-09-2003, 02:46 AM OK, see I was under the impression that the auctions folder had to be in the cgi-bin... But I guess not
Hey are you also using Easy Auctions 1.53? And i'm curious what webhost you're using i'm on hostma t i x
Well i'll mess around a bit with it tommorow i'm burnt out been trying to figure this out ALL day! You've helped alot though! And hopefully you'll still be around so I can bother ya some more :):stickout:
Whipsmack 02-09-2003, 02:59 AM I tried the question mark after the .pl? and it still tries to download the actual .pl itself. ugg getting so frustrating :(
Oh and I don't have any download acceleretor programs...i'm guessing that my configuration on the script is messed up heh
Mind if I go ever a few more things heh? Heres some more questions I had about the script
# The Base Directory. We need an
# absolute path for the base directory.
# Include the trailing slash. THIS SHOULD
# NOT BE WEB-ACCESSIBLE!
$config{'basepath'} = 'What goes here?';
The base directory is the "auction" folder right?
LizMarr 02-09-2003, 03:05 AM That's a browser issue - do you have a different browser to use? How about read the instructions for something that would end in auction.pl?auction=new or simular, then perhaps your browser won't see it that way.
This is the same script that I am using, and the auction=new is one of the commands that it should accept. I'm running it on an Apache server.
Whipsmack 02-09-2003, 03:20 AM tried the auction.pl?auction=new on the end still tries to DL it as a file...hmm but I didn't fill out everything perfectly in the script like the base directory and such...could this be causing this problem heh?
Thanks soooooo much btw i'm also using an apache server
Oh and I don't have another internet browser just using I think the latest of internet explorer...hmmm
LizMarr 02-09-2003, 03:26 AM If my host was up, I'd have you click on my auction and see if you still get the download effect. You can try it tomorrow (I hope my host will be up then) The link should be
Online Auction (http://cc-ent.net/scgi-bin/auction.pl)
The error you should get if the paths are configured wrong would be something like "file not found" or the 500 error (can remember the text) NOT the browser deciding to download it.
Also, the base directory is the complete path on the host - mine looks like:
/home/username/auction/
Whipsmack 02-09-2003, 03:43 AM Well I just registered a domain and i'm using a temporary IP address to access my page until my domain is ready, so maybe that might be a problem *shrug*
ohhh and what sort of permissions should I have on the actual auction.pl 755?
LizMarr 02-09-2003, 04:03 AM As a general rule of thumb, and .cgi or .pl should have 755, don't forget that the "auction" directory (or whatever you called yours) needs to be 777.
Whipsmack 02-09-2003, 04:14 AM heh that was wierd...I was messing around with file options in windows explorer and changed the pl files to open with no program (was using notepad before) and then I tried it to open with my browser this time it opened on the webpage but it was the actual script as if I was viewing the code in notepad but on the web :( I'll figure it out one of these days :)
I'm headed to bed, thanks again sooo much for the assistance I'll check out your site tommorow.
LizMarr 02-09-2003, 03:38 PM Check your permissions on the directory and file then. You might switch between the scgi-bin and the cgi-bin directories. Generally, you get a file listing if the script is not running (in other words, you can't run scripts on your server) Check with your host to see if they have restrictions.
Whipsmack 02-09-2003, 04:14 PM hmm weird all my permissions are correct 777 on the main folder 755 on cgi-bin 755 on the auction.pl... And I know my server supports cgi scripts...
Your auction site worked fine though :( So I don't know...
LizMarr 02-09-2003, 04:27 PM At least you were able to see it. I guess I need to update my DNS so that I can see it - I haven't been able to get on that site all morning. The next thing would be to check to make sure that your path to the perl script is correct (first line in script) Do you have anything that gives you the correct listing?
(hint - if there is anything pre-installed in your cgi-bin, look at them)
Whipsmack 02-09-2003, 05:58 PM Yes my webhost tells me my exact path to perl
/usr/bin/perl
Now my question...In the first line of script it says
#!/usr/bin/perl
Should the # and ! be in front like that?
Oh and should It be /myusername/cig-bin/perl?
or just exactly "/usr/bin/perl heh
elsmore1 02-10-2003, 02:16 AM If your host tells you that the exact path to perl is /usr/bin/perl then the first line of your script should be #!/usr/bin/perl (with the #! at the beginning and nothing else on the line after the perl part.
If the script code is showing up in your browser instead of the output of the script, it means that the webserver is not executing the script. That *could* be because you are accessing it through a temporary URL, but it may be that the server is mis-configured in some way also. It is possible that the cgi-bin directory is not a script-aliased directory, and only .cgi file extensions are treated as scripts, and not .pl extensions. You could try changing the extension to .cgi and see if the webserver tries to execute the script, although the script may not work if it depends on itself having a .pl extension, but at least you should get some indication that the server tried to execute it instead of sending it to you as a text file.
If the problem is with the .pl file extension, you could ask your host to enable cgi handling of .pl files, or you may be able to enable it yourself with an .htaccess file, or you may get lucky and everything works just by changing the extension to .cgi. (I'm not familiar with that particular script, so I can't tell you if it will work or not.) If you need to enable cgi handling of .pl files yourself and your host has the server configured to allow you to do it with .htaccess files, post back here and I can get you the code you will need to put in the .htaccess file.
YUPAPA 02-10-2003, 02:54 AM It could be your perl script not sending any headers... or try to add a cgi-handler extension.
put this in the .htaccess
Addhandler cgi-script .pl
Whipsmack 02-10-2003, 03:40 AM Wahoo I added the
Addhandler cgi-script .pl to my htaccess...and well it doesn't download the file anymore but heres the error message I get this time :)
"500 Internal server error"
"The server encountered an internal error or misconfiguration and was unable to complete your request"
heh..
Whipsmack 02-10-2003, 03:59 AM Also I tried changing the extension from .pl to .cgi and that didn't work at all :(
Man something so easy i'm sure...i'm just missing something REALLY simple...ahhhhhh
LizMarr 02-10-2003, 04:29 AM The most common reason I get 500 errors for is because either I've got a path wrong or the permissions are wrong for something. That script needs to have some directory names (to be created under the 777 mod directory for the auctions) It creates them itself, so you shouldn't need to create them.
Use the following script to see that you can 1) run a pl and 2) that you have the variables correct. Remove the .txt extension and be sure to set it to 755.
If this doesn't work, I can send you a cgi file that does sort-of the same thing.
Whipsmack 02-10-2003, 03:51 PM wait wait I made a mistake there....Your allvars.pl file DOES WORK! YAY heheheh
I just had forgot to keep the "addhandler cgi-script .pl" saved
in my htaccess
Btw thanks everyone especially lizmarr for taking the time to help a newbie :)
Whipsmack 02-10-2003, 04:03 PM I was looking around in my htaccess file and I found this
AddHandler auction .pl
Should that be there?
Oh and I just checked my error log it says
"[Mon Feb 10 15:05:38 2003] [error] [client XXX.XX.XX.XXX] Premature end of script headers: /home/XXXX/public_html/cgi-bin/auction.pl"
hmmm premature end of script headers...
LizMarr 02-10-2003, 08:11 PM Originally posted by Whipsmack
"[Mon Feb 10 15:05:38 2003] [error] [client XXX.XX.XX.XXX] Premature end of script headers: /home/XXXX/public_html/cgi-bin/auction.pl"
hmmm premature end of script headers...
That usually means it was reading the script just fine and came across something it didn't understand or wouldn't resolve and so it exited the script. I've got a couple of scripts I never could get past this - but auction.pl wasn't one of them. :)
Let's look at it line for line then. The places you need to edit are:
Line No.
1 - the "splat-bang" line, needs to have the correct info. Mine reads,
#!/usr/bin/perl
53 - the auction folder path, needs to have a trailing / and a semi-colon. Mine reads,
$config{'basepath'} = '/home/lizmarr/auction/';
Default directories - you can use what is there, needs to have semi-colons at the end:
61 - $config{'closedir'} = 'closed';
69 - $config{'regdir'} = 'reg';
Deafult auction categories, here the line numbering will get mixed up depending on how many you have - the original starts on line 75.
You might start simple and only use the default categories or perhaps just one or two. If you ever need them ordered, put a number or letter as the first character of each category (they become directories in your auction folder)
%category = (
computer => 'Computer Hardware and Software',
elec => 'Consumer Electronics',
other => 'Other Junk',
);
Notice it begins with a % then the = and ( then each item ends with a comma, then the ) and finally a semicolon. It could be all one line and the computer wouldn't care. It is broken up to make it easier to see. You can get that break-out error if a comma isn't right.
Once you get it going, you can get fancier with sub-categories and such. Let's not do that yet. ;)
The password line, shown below as found on the original script:
84 - $config{'adminpass'} = 'auction';
notice it ends with a semi-colon.
Then next few lines depend on your mail program, leave the first one alone unless you know differently:
96 - $config{'mailhost'} = 'localhost';
100 - $config{'admin_address'} = 'nobody@yourhost.com';
(replace the default email with the one you'll use for auctions)
The next one is easy to miss, but important -
110 - $config{'scripturl'} = 'www.your.host.com';
Then this one is just to make the page name something more personalized:
123 - $config{'sitename'} = 'Your Site Name Here';
Again, notice that each actual line of code ends in a semi-colon.
Check these and see what you have there.
I don't have anything pertaining to the auction script in my HTACCESS file - just a bunch of stuff that FrontPage put there.
Whipsmack 02-10-2003, 09:07 PM 61 - $config{'closedir'} = 'closed';
69 - $config{'regdir'} = 'reg';
Does the "closed" and "reg" folders need to be inside the "auction" directory or in the same directory as the "auction" folder. I had them inside the auction directory...
Also I think I might know what the problem is...
100 - $config{'admin_address'} = 'nobody@yourhost.com';
my domain name that I registered the other day hasn't been transfered yet so i'm using a temporary IP addy and I don't think that would work...along with
110 - $config{'scripturl'} = 'www.your.host.com';
I put my temporary IP url... I don't know if that could be the problem..?
Lets say what if either of those 2 were filled out incorrectly would that be the source of the problem?
LizMarr 02-11-2003, 02:52 AM Originally posted by Whipsmack
61 - $config{'closedir'} = 'closed';
69 - $config{'regdir'} = 'reg';
Does the "closed" and "reg" folders need to be inside the "auction" directory or in the same directory as the "auction" folder. I had them inside the auction directory...
Also I think I might know what the problem is...
100 - $config{'admin_address'} = 'nobody@yourhost.com';
my domain name that I registered the other day hasn't been transfered yet so i'm using a temporary IP addy and I don't think that would work...along with
110 - $config{'scripturl'} = 'www.your.host.com';
I put my temporary IP url... I don't know if that could be the problem..?
Lets say what if either of those 2 were filled out incorrectly would that be the source of the problem?
The directories will automatically be created inside of your auction directory - if the permissions are correct.
The email address shouldn' t cause an error at this step, but the URL might. Generally, if you were assigned an IP address, it is something like http://xx.xx.xx.xx/~yourname - unless you paid for your own IP address. It seems though that the IP address should work, if you know for sure it brings up your site. Since I haven't run this script using an IP address, I can't tell you for sure. It does use the URL to build it's pages though.
Whipsmack 02-12-2003, 10:18 PM Ahhh!! I finally got my domain registered and I was soo happy because I thought it would work blahh...think again now its giving me a 404 error page not found god so frustrating.
http://www.gameloot.net/cgi-bin/auction.pl Why doesn't it work *cry* Well heres what I have
1 -
#!/usr/bin/perl
53 -
$config{'basepath'} = '/home/whip/auction/';
61 - $config{'closedir'} = 'closed';
69 - $config{'regdir'} = 'reg';
84 - $config{'adminpass'} = 'XXXXX';
96 - $config{'mailhost'} = 'localhost';
100 - $config{'admin_address'} = 'whip@gameloot.net';
110 - $config{'scripturl'} = 'www.gameloot.net';
my auction.pl file goes in the cgi-bin right? Other than that i'm totally stumped
Like I said earlier all my permissions are right 777 for auction 755 for cgi-bin 755 for auction.pl umm hmmm the only thing I can think of is maybe my server doesn't use unix? All I remember seeing was something about apache..what's apache?
Whipsmack 02-12-2003, 10:25 PM Ok i just discovered something the URL
http://www.gameloot.net/~whip/cgi-bin/auction.pl
points to it now but i'm still getting the internal server error 500
also on line
110 - $config{'scripturl'} = 'www.gameloot.net';
Should I put 'http://www.gameloot.net/~whip/' instead?
Whipsmack 02-12-2003, 11:32 PM Oh btw that allvars file heres what I got
All CGI Environment Variables on four.nosdns.com
DOCUMENT_ROOT: /usr/local/apache/htdocs
GATEWAY_INTERFACE: CGI/1.1
HTTP_ACCEPT: image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, application/msword, */*
HTTP_ACCEPT_ENCODING: gzip, deflate
HTTP_ACCEPT_LANGUAGE: en-us
HTTP_CONNECTION: Keep-Alive
HTTP_COOKIE: cprelogin=no
HTTP_HOST: www.gameloot.net
HTTP_USER_AGENT: Mozilla/4.0 (compatible; MSIE 6.0; Windows 98)
PATH: /usr/local/bin:/usr/bin:/bin
QUERY_STRING:
REMOTE_ADDR: XXX.XX.XX.XXX
REMOTE_PORT: XXXX
REQUEST_METHOD: GET
REQUEST_URI: /~whip/cgi-bin/allvars[1].pl
SCRIPT_FILENAME: /home/whip/public_html/cgi-bin/allvars[1].pl
SCRIPT_NAME: /~whip/cgi-bin/allvars[1].pl
SERVER_ADDR: XX.XXX.XX.XXX
SERVER_ADMIN: root@four.nosdns.com
SERVER_NAME: four.nosdns.com
SERVER_PORT: 80
SERVER_PROTOCOL: HTTP/1.1
SERVER_SOFTWARE: Apache/1.3.27 (Unix) DAV/1.0.3 mod_log_bytes/0.3 mod_bwlimited/1.0 PHP/4.2.2 FrontPage/5.0.2.2510 mod_ssl/2.8.11 OpenSSL/0.9.6b
LizMarr 02-13-2003, 04:39 PM Don't dispair yet - I don't think that your domain has propigated (or at least I'm not getting anything at either www.gameloot.net or just gameloot.net)
It still might end up that you need to use the CGI wrapper (scgi-bin) but we'll see.
What does the "allvars" script give you if you call it from your domain name? I see that there is a tilde in the path name (bother) of some of the results.
What's with the [1] on the name of the "allvars" script? Looks like what Internet Explorer does to copied files.
Apache is a name of a web server software - the program that runs on the host server that tells it what to do when a connection is made looking for HTML or simular. Nothing you need to worry about, but sometimes will need to know to make scripts work - some scripts only run on Microsoft servers.
LizMarr 02-13-2003, 04:43 PM Originally posted by Whipsmack
110 - $config{'scripturl'} = 'www.gameloot.net';
Should I put 'http://www.gameloot.net/~whip/' instead?
I think you should try something simular - no http:// and no trailing / try this -
www.gameloot.net/~whip
and see what happens. What bothers me is that you paid for the domain name, you shouldn't need to have the ~whip in the path to make things run.
Let's see if the script will run using this change.
Whipsmack 02-13-2003, 10:12 PM My web host was having trouble with DNS on gameloot.net so it's down at the moment. They said it should be back within a couple hours.
I had someone help who knows what hes doing I let him gain access to my ftp and he can't even get it to work lol Still waiting for his reply of why it's not working :(
I think its my bloody webhost! What webhost should I go with that I know for sure will work with this script! grrr hehehe
Whipsmack 02-13-2003, 11:51 PM ok gameloot.net is up I managed to put in some error code and have it write to an error.txt file heres what happens
"Variable "$config" is not imported at auction.pl line 103.
Global symbol "$config" requires explicit package name at auction.pl line 103."
what does that mean? heh
Whipsmack 02-13-2003, 11:54 PM ahhh hah line 103 points to
$config{'mailhost'} = 'localhost';
so local host doesn't work....what would I put in there then?
Whipsmack 02-14-2003, 04:34 AM wait thats not line 103 is it heh I had to count manually notepad doesn't show what line your on heh
LizMarr 02-14-2003, 08:45 PM Originally posted by Whipsmack
ahhh hah line 103 points to
$config{'mailhost'} = 'localhost';
so local host doesn't work....what would I put in there then?
Does that line have a pound sign in front of it? That is the line that sets the mail program for your account (the mail server I mean) If "localhost" is not recognized, then try the full name - perhaps mail.gameloot.net? Or have they given you a different name for a mail server (like you'd configure in your email program)
There are two choices for that configuation:
# YOU NEED EITHER A MAIL PROGRAM
$config{'mailprog'} = '/usr/lib/sendmail -t';
#
# OR YOU NEED A MAIL HOST (SMTP)
#$config{'mailhost'} = 'localhost';
If you use 'mailprog' then you need to know the path to the program, this might indeed be the problem. If you use 'mailhost' then you need to know where the mail server is. It might be "localhost" or it might be on a different server (mail.gameloot.com or ??)
One or the other of the lines need to be commented. You might try and comment BOTH lines and run it again, or switch to the other one from what you are using now.
The nice thing about it, once you get this script running, you'll know what the variables are for future scripts!
Whipsmack 02-14-2003, 10:24 PM WAHOOOOOOOO guess what lizmarr I finally got it! well not me hahah. I asked my webhost if they could help and what do ya know 30 minutes later he had the script up and running for free! oh and yep thats the line that was causing the trouble
$config{'mailhost'} = '/usr/lib/sendmail -t'; is the correct directory
w00t w00t w00t...still have a problem though now hahah when I try to register it says that I will recieve an e-mail but that never happens :(
LizMarr 02-15-2003, 10:50 PM Originally posted by Whipsmack
still have a problem though now hahah when I try to register it says that I will recieve an e-mail but that never happens :(
How long did you wait? Sometimes there can be quite a bit delay. Which email are you waiting for? One sent to the admin email address (in the script) or one sent to a new user? (I don't remember that one - I'll have to experiment and see myself!)
If it is the "admin" address, be sure to send a regular email to make sure that it works at all! (and that any anti-spam software you might be running isn't killing it)
|