Web Hosting Talk







View Full Version : CGI scripts.. Plz Help...


Cael
02-25-2001, 07:50 AM
I wonder ..
If I don't have SMTP installed on my RaQ. Can I still use scripts which require sendmail features?

anixs
02-25-2001, 11:41 AM
Yes. Tell your scripts to look in /usr/sbin/sendmail.

sodapopinski
02-25-2001, 12:40 PM
telnet into your account and type:

whereis sendmail

the machine should tell you about it :D

allan
02-25-2001, 02:14 PM
Also make sure you have e-mail turned on in your control panel.

Cael
02-26-2001, 11:20 AM
:( ..

Change that path correctly ..
but no luck ...

"The server encountered an internal error or misconfiguration and was unable to complete your request."

any can help me figure out what's wrong with servus.ws/support.html ???

allan
02-26-2001, 11:45 AM
Donovan,

I just submitted the script and got the same error. Check your error logs to see if there is more information. The error logs for your web server should be in /var/log/httpd/error.

Let us know what you see in that file when you try to submit the form and we may be better able to help you. Although generally this error indicates that the script was not loaded in ASCII, has the wrong permissions, or the wrong path to perl.

Also, you might want to consider to locking down your cgi-bin directory so that its contents are not viewable.

You can do that by creating a .htaccess file with the following:

Options +Includes
Options -Indexes

Cael
02-27-2001, 05:40 AM
[Mon Feb 26 08:34:06 2001] [error] [client 153.39.171.204] Premature end of script headers: /usr/cgiwrap/cgiwr$
[Mon Feb 26 08:35:08 2001] [warn] [client 153.39.171.204] handler "cgi-wrapper" not found for: /home/sites/hom$

So anyone can help now???

By the way, thanks for your suggestion...
I made the .htaccess file.

Finally, my error log is kind of big. 478 lines. Anyway to reduce the filesize or delete it?

Cael
02-27-2001, 06:16 AM
I just added the .htaccess in cgi-bin , and it disable the cgi-wrap , then when I try the form, it returns a Forbidden error message. Even if I set the permission to 777, it still returns the same error.

Finally, I decided to delete that file. And now it is back to the internal server misconfiguration error which I suspect to have something to do with cgi-wraps. Anyone can help???

Anyway, how come I can't change the file permission in telnet successfully but can change in ftp even though in ftp it returns an error but in telnet there's no error.

Chicken
02-27-2001, 10:32 AM
Donovan, is that some sort of help desk script/ticket, etc or is it just form mail more or less. Matt's script worked fine on my RaQ3. Maybe it is more complicated that just emailing you the form results (I check the site but couldn't really tell what the script was).

allan
02-27-2001, 10:35 AM
Donovan,

if you would like, I can SSH in and take a look at the script for you, just e-mail me off-board :).

Cael
02-28-2001, 05:51 AM
I got the script from http://www.worldwidemart.com/scripts/formmail.shtml .

I do think it is just a normal formmail script, nothing else.

Chicken, mind to paste ur html code for that form, and the sendmail path plus referrers URL, IP you modified in the script??? If can, please tell me what you have done before running it? Please...

Cael
03-02-2001, 06:27 AM
Harlooo ????

allan
03-02-2001, 07:34 AM
Donovan,

We have a customer running Matt's Formmail script, and they have the following:

path to perl: /usr/bin/perl
path to sendmail: /usr/sbin/sendmail

Not sure what other variables you need.

Cael
03-02-2001, 08:35 AM
Can you post URL of the html page your client using that form at?

Thanks

Chicken
03-02-2001, 08:52 AM
(Working via ICQ to solve this one... let me know if there's any problems after we talk...)

allan
03-02-2001, 09:47 AM
It sounds like Chicken has you covered but if you still need to see the example let me know, I have e-mailed the client and asked his permission to post his URL here.

Cael
03-02-2001, 09:50 AM
Ok :) Thanks for your help anyway...

Cael
03-03-2001, 05:37 AM
Problem fixed :)
Thanks to Chicken.

What I did wrong is uploaded the script in BINARY mode... That's a big NO NO...

allan
03-03-2001, 10:43 AM
Originally posted by Donovan

What I did wrong is uploaded the script in BINARY mode... That's a big NO NO...

Go Chicken!! I take back my lamer nomenclature :D.

Donovan -- that was a tough one, but it should have been one of the first things we asked.

Glad you got it fixed

Cael
03-03-2001, 11:53 AM
hehe... SOrry... I think I am not concerntrating while reading your threads. :( I won't do that next time :p

Now I am going to find out one of my friend who told me to upload in BINARY mode and chop him off... :p

Chicken
03-03-2001, 01:54 PM
Funny how you'd think it was something else first.

Another one that got *me* once, is no CGI checked for the site in the CP. Heh, whoooo, that one made me almost batty. Apparently it helps to have the option turned on when you want to run CGI. Who whudda thunk??? :)

allan
03-03-2001, 02:19 PM
Originally posted by Donovan
hehe... SOrry... I think I am not concerntrating while reading your threads. :( I won't do that next time :p

Now I am going to find out one of my friend who told me to upload in BINARY mode and chop him off... :p

No need to apologize, this forum is great for honing my troubleshooting skills for our customers, so I apologize for not asking that question first :).

As for your friend, normally on the first offense, you should only injure them, that not cause permanent bodily damage :)

Cael
03-04-2001, 06:38 AM
:)