Web Hosting Talk







View Full Version : Cgi problem


hs-server
02-09-2002, 12:31 PM
Hi,

I have updated the Apache to 1.3.22 to day,
but now all the cgi scripts is not working in cgi-bin map...

How do I get it to work again ???

Plz need help fast..

zupanm
02-09-2002, 01:24 PM
might help if you have us an error or example you are having

hs-server
02-09-2002, 01:34 PM
in my error_log give me this error..

[Sat Feb 9 18:12:27 2002] [error] [client 62.66.4.3] Premature end of script headers: /home/httpd/vhosts/hs-server.biz/cgi-bin/perldiver.cgi

and httpd error_log don't give me no error....

Hope this can help...

bitserve
02-09-2002, 10:16 PM
How did you upgrade?

Did you use an RPM? If so, give us the links to where you got the old one and your new one.

If you did it from source, did you change your configure options any?

Did you change your httpd configuration file any? Are you sure you didn't overwrite the old one accidentally?

Do the two versions differ regarding mod_cgi or mod_perl?

Tim Greer
02-09-2002, 11:55 PM
What all did you change or add or try and re-add? There could be a few reasons for this, of course, so it's difficult to guess. One change usually associated with CGI suddenly stopping, is to change the user that it runs as. I.e., having SuEXEC before and then not compiling SuEXEC into the new build, or visa versa. Although, if you went from SuEXEC to a global user, it usually has a better chance of at least executing the script, whereas from a global user to using SuEXEC, it will fail due to permissions (and sometimes ownership), for example.

Be sure compare your previous Apache configuration with the new one (BTW, why didn't you upgrade to the newest version -- its 1.3.23, instead of 1.3.22?). Did you back up your previous configuration (It mgiht have been backed up for you), or the previous binary's, etc.?

What does "/path/to/apache's/bin/httpd -l" show?

You could be missing a module you once had, or it isn't configured the same on this build. One thing to check, as I said above, is the permissions on the CGI script itself and the directory that CGI script is in. A new build, even if done properly, can bring up some problems you didn't know about in the previous one. I.e., usually, other than ownership issues, SuEXEC should execute scripts fine, yet a lot of people have problems with using SuEXEC all of the sudden, because people often have word writable script and directory permissions and figure it's okay (or even best), because it works -- which is not good and compiling in that module will bring out errors - which isn't a bad thing per se.

Another common thing, is if you use .htaccess files to control mime-types, or other things, which might usually want to or need to work with a certain option or configuration or module that you didn't know to compile into the new build. This is true of the httpd.conf file too, instead of it being .htaccess controlled or whatever. Did you try anything simple, like a Hello World test to see if it works? Be sure to and set the proper permissions for an executable CGI and see what happens.

hs-server
02-10-2002, 12:00 PM
I did use redhat 7.1 RPM apache 1.3.22 to update apache..

and this info did I get from /usr/sbin/httpd -l
Compiled-in modules:
http_core.c
mod_so.c
suexec: enabled; valid wrapper /usr/sbin/suexec

can I get it to work again or need I remove all and install from fresh?

O I forgot to tell that I running a Plesk 2.0 RPM install on this server...

Tim Greer
02-10-2002, 09:02 PM
Originally posted by hs-server
I did use redhat 7.1 RPM apache 1.3.22 to update apache..

and this info did I get from /usr/sbin/httpd -l
Compiled-in modules:
http_core.c
mod_so.c
suexec: enabled; valid wrapper /usr/sbin/suexec

can I get it to work again or need I remove all and install from fresh?

O I forgot to tell that I running a Plesk 2.0 RPM install on this server...

Well, I don't know what you had in the previous version. However, it does show SuEXEC is enabled in this version. I assumed it was SuEXEC and this might be the problem. Rename the "/usr/sbin/suexec" file to "/usr/sbin/suexec_off" and then restart Apache and see if that fixes your problem. It may very well be all you need to do, assuming you don't need any other Apache core modules. Since you have mod_so, tha will allow you to just load in modules via apxs. Anyway, rename the suexec file to something elseand restart Apache -- that will disable SuEXEC and your CGI script will likely work again.

hs-server
02-11-2002, 05:37 AM
Thanks this worked for me :D

bitserve
02-12-2002, 08:27 PM
Go, Tim!

:)