I've been at this problem for a few hours and it's been very frustrating. However before I get started I just want to thank everyone who can help me out or give some good advice. Thanks
So, I've spent the last half hour searching through this forum alone. I've spent over an hour going through google and other various forums as well. I've seen a lot of solutions already and tried them as well, and so far nothing so I'll try to list everything I have tried. So here goes.
My problem is with CGI/Perl scripts. For some reason even after httpd configuration and restarts and various other modifications to make this work...it just hasn't.
When I go to the script in my browser, I get the notorious "500 Internal Server Error" Which says:
Quote:
Internal Server Error
The server encountered an internal error or misconfiguration and was unable to complete your request.
Please contact the server administrator, <myemail@site.com> and inform them of the time the error occurred, and anything you might have done that may have caused the error.
More information about this error may be available in the server error log.
--------------------------------------------------------------------------------
Apache/2.0.46 (Red Hat) Server at <mysite> Port 80
|
So naturally, I check the log and I find an error (time stamps and specifics removed):
Quote:
"(2)No such file or directory: exec of '/home/<myuser>/public_html/first.pl' failed, referrer: <a URL>"
"Premature end of script headers: first.pl, referer: <a URL>"
|
The first thing I do is check the permissions on first.pl,
Quote:
[root@localhostRH]# ls -l first.pl
-rwxrwxrwx 1 root root 76 Jun 5:04 first.pl
|
I had already tried chmod 775, 777, just to make sure.
So permissions didn't work so I headed over to my httpd.conf to make sure I had the correct settings configured there. I need CGI/Perl access to each user's directory (public_html). Each user has a virtual host config setup, and they all work.
Quote:
<Directory /home/*/public_html>
Options +ExecCGI
AddHandler cgi-script .cgi
</Directory>
|
After checking this out I decided to have a look to make sure perl is actually in /usr/bin/perl and writable.
Quote:
[root@localhostRH]# which perl
/usr/bin/perl
[root@localhostRH]# ls -l /usr/bin/perl
-rwxrwxr-x 2 root root 16422 Dec 13 15:43 /usr/bin/perl
|
It is. Next, I went to test the actual script on my shell. Here is what first.pl is:
Quote:
#!/usr/bin/perl
print "Content-type: text/html\n\n";
print "Hello, World.";
|
When I run it:
Quote:
[root@localhostRH]# ./first.pl
Content-type: text/html
Hello, World.
|
Yet, I still get the Internal Server Error when I go to it with the browser (Windows XP - IE v6 SP2).
Around this time I'm searching through google to find a solution, and one common problem was Suexec. I went ahead and found it in /usr/sbin/suexec and following the instruction on Apache website docs renamed it.
Keep in mind after each change in configuration I restarted httpd, even after this...no luck.
SELinux is not installed. It's a fresh install of RedHat Enterprise 9. I also want to mention that this _exact_ setup I have in my httpd.conf is working on my FC5 machine.
So now you know what I have done and haven't done. And again thank you all for your time and help. <3