Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

CGI problems - Internal Server Error

45 views
Skip to first unread message

Casgrove

unread,
Apr 4, 2006, 6:57:14 PM4/4/06
to

Hiya.

I am in Bugzilla installation hell, and hopefully someone will be able
get me out of here soon enough, by showing me the secret passage out of
this. 8-)

So, here is where I stand:

System: Red Hat Enterprise Linux ES release 4 (Nahant Update 3)

The installation seems to have gone OK, (Perl modules, MySQL 4.0.X and
Apache), and the apache server SEEMS to be working fine, since I can
get documents other than cgi documents to work correctly, like the
ant.jpg, and the internal documents, etc. but when I try to get any cgi
document, I get:

Internal Server Error

And the logs from /var/adm/httpd/error_log have:

[Tue Apr 04 04:52:59 2006] [error] [client x.x.x.x] (13)Permission
denied: exec of '/home/bugzilla/index.cgi' failed
[Tue Apr 04 04:52:59 2006] [error] [client x.x.x.x] Premature end of
script headers: index.cgi
[Tue Apr 04 04:53:03 2006] [error] [client x.x.x.x] (13)Permission
denied: exec of '/home/bugzilla/index.cgi' failed
[Tue Apr 04 04:53:03 2006] [error] [client x.x.x.x] Premature end of
script headers: index.cgi
[Tue Apr 04 04:53:09 2006] [error] [client x.x.x.x] (13)Permission
denied: exec of '/home/bugzilla/index.cgi' failed
[Tue Apr 04 04:53:09 2006] [error] [client x.x.x.x] Premature end of
script headers: index.cgi

Now, I know you might think it is a permissions problem, but I already
tried running with everything under the bugzilla home at level 777, and
changing ownership to apache, as well as group, and that didn't help a
bit.

In any case, I am running the httpd daemon as user "apache" and group
"apache", and like I said before, the only problem seems to be with CGI
documents.

Here is the bugzilla section under my httpd.conf:

Alias /bugzilla /home/bugzilla

<Directory /home/bugzilla>
Addhandler cgi-script .cgi
Options +ExecCGI +FollowSymLinks +Indexes
DirectoryIndex index.cgi
AllowOverride Limit
</Directory>

Anybody in the same situation ? or perhaps has seen this before ?

BTW, I am following the bugzilla installation instructions to the
letter http://www.bugzilla.org/docs/2.20/html/installing-bugzilla.html
still I can't get this to work correctly.

Does it matter that user apache and group apache are set to below 100 ?
I been reading a lot trying to solve my problems, and it seems that
suexec likes to have higher userid and groupid values, according to
"suexec -V", but I am not sure that's what is wrong with my situation.

- Casgrove.

Peter Hessler

unread,
Apr 5, 2006, 5:59:39 PM4/5/06
to Casgrove, support-...@lists.mozilla.org
I have the same (or very similar) bug:
https://bugzilla.mozilla.org/show_bug.cgi?id=329556

Mine happens on a regular basis, but with enough reloads things work.


On 4 Apr 2006 15:57:14 -0700
"Casgrove" <tk...@netscape.net> wrote:

:
: Hiya.

:
: _______________________________________________
: support-bugzilla mailing list
: support-...@lists.mozilla.org
: https://lists.mozilla.org/listinfo/support-bugzilla
:


--
Most people wouldn't know music if it came up and bit them on the ass.
-- Frank Zappa

Benton, Kevin

unread,
Apr 5, 2006, 7:24:26 PM4/5/06
to Casgrove, support-...@lists.mozilla.org
What happens when you try to run index.cgi from the command line?

---
Kevin Benton
Perl/Bugzilla Developer/Administrator, Perforce SCM Administrator
AMD - ECSD Software Validation and Tools

The opinions stated in this communication do not necessarily reflect the
view of Advanced Micro Devices and have not been reviewed by management.
This communication may contain sensitive and/or confidential and/or
proprietary information. Distribution of such information is strictly
prohibited without prior consent of Advanced Micro Devices. This
communication is for the intended recipient(s) only. If you have
received this communication in error, please notify the sender, then
destroy any remaining copies of this communication.

Casgrove

unread,
Apr 5, 2006, 9:14:17 PM4/5/06
to

Kevin.

>From the command line, the perl script executes correctly, and produces
an html document:
BTW, I am executing as user "apache" just FYI:

>
>bash-3.00$ ./index.cgi
>Content-Type: text/html
>
>[Wed Apr 5 00:05:08 2006] index.cgi: Use of uninitialized value in pattern match (m//) at (eval 27) line 4.
>[Wed Apr 5 00:05:08 2006] index.cgi: Use of uninitialized value in pattern match (m//) at (eval 27) line 4.
><!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
> "http://www.w3.org/TR/html4/loose.dtd">
><html>
> <head>
> <title>Bugzilla Main Page</title>
...
...
...
></div>
></form>
>
> <div class="outro"></div>
></div>
>
></body>
></html>
>

So perl seems to be working correctly, also, just in case here is the
output from my httpd version info:

]# httpd -V
Server version: Apache/2.0.52
Server built: Dec 15 2005 04:09:14
Server's Module Magic Number: 20020903:9
Architecture: 32-bit
Server compiled with....
-D APACHE_MPM_DIR="server/mpm/prefork"
-D APR_HAS_SENDFILE
-D APR_HAS_MMAP
-D APR_HAVE_IPV6 (IPv4-mapped addresses enabled)
-D APR_USE_SYSVSEM_SERIALIZE
-D APR_USE_PTHREAD_SERIALIZE
-D SINGLE_LISTEN_UNSERIALIZED_ACCEPT
-D APR_HAS_OTHER_CHILD
-D AP_HAVE_RELIABLE_PIPED_LOGS
-D HTTPD_ROOT="/etc/httpd"
-D SUEXEC_BIN="/usr/sbin/suexec"
-D DEFAULT_PIDLOG="logs/httpd.pid"
-D DEFAULT_SCOREBOARD="logs/apache_runtime_status"
-D DEFAULT_LOCKFILE="logs/accept.lock"
-D DEFAULT_ERRORLOG="logs/error_log"
-D AP_TYPES_CONFIG_FILE="conf/mime.types"
-D SERVER_CONFIG_FILE="conf/httpd.conf"

Maybe it is indeed a bug, like Peter mentions in his reply, then I
guess I am out of luck. 8-( although it is hard to believe, since I am
using a very common platform:

-> Red Hat Enterprise Linux ES release 4 (Nahant Update 3)
-> mysql-4.1.12-3.RHEL4.1 (MySQL)
-> httpd-2.0.52-22.ent (Apache)
-> perl-5.8.5-24.RHEL4 (Perl)

- Casgrove.

Casgrove

unread,
Apr 6, 2006, 10:46:18 PM4/6/06
to
My fellow IT brethren.

I found the solution to this particular problem, after several hours of
searching and reading about
Apache and RedHat Linux. In particular this Latest linux version [ ES
release 4 (Nahant Update 3) ]

The problem has to do with the implementation of "selinux" and that it
is activated and fully enforce by default.
Well, needless to say, this particular configuration will cause major
permissions problems with the correct operation
of apache and the processing of CGI documents, and nothing will work,
even if you have all the permissions set correctly.

So the solution is to set the selinux permissions for your specific
directory, or just disable selinux if you are ok with the possible
consequences.

In any case, for my specific case, this is the command that solve all
my problems:

>
>chcon -R -t httpd_sys_content_t /home/bugzilla
>

And just for reference I would recommend that you read the man pages of
"selinux" and "chcon".

BTW, this should be a good side note or addition to the main Bugzilla
installation instructions, just in case someone else
is stuck in the not to distant future.

Note: If you want to install the main bugzilla directory at any other
location other than your main www root (/var/www/html) you better
make sure that selinux is not interfering with that particular
location, otherwise the CGI documents will not be serve, and you will
get permission denied errors in your main httpd logs, as well as
"Internal Server Errors" in reply to your html query.
You can always check the status of selinux by typing: "selinuxenabled",
and if nothing returns back, then it is indeed running, otherwise it is
not. ( please read the "selinux" man page).
If selinux is running and you still want to use a separate location/dir
for bugzilla, then the following command should take care of the
correct settings:

chcon -R -t httpd_sys_content_t <bugzilla new dir. localtion>

For example, if you want to install bugzilla under /opt/bugzilla, then
the command turns into:

chcon -R -t httpd_sys_content_t /opt/bugzilla

Please read the man pages for "chcon" for further info and help.

- Casgrove

0 new messages