Note: This is a beta release of Red Hat Bugzilla 5.0. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Also email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback here.
Bug 161049 - mod_jk malfunctions when selinux is enforced
Summary: mod_jk malfunctions when selinux is enforced
Alias: None
Product: Fedora
Classification: Fedora
Component: selinux-policy-targeted
Version: 4
Hardware: i386
OS: Linux
Target Milestone: ---
Assignee: Daniel Walsh
QA Contact:
Depends On:
TreeView+ depends on / blocked
Reported: 2005-06-20 08:45 UTC by Kim McCall
Modified: 2007-11-30 22:11 UTC (History)
0 users

Fixed In Version: 1.25.1-7
Doc Type: Bug Fix
Doc Text:
Clone Of:
Last Closed: 2005-08-19 07:56:20 UTC

Attachments (Terms of Use)

Description Kim McCall 2005-06-20 08:45:09 UTC
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.8) Gecko/20050524 Fedora/1.0.4-4 Firefox/1.0.4

Description of problem:
I have servlets that run fine when invoked as
but when I use
I get a "Server Configuration Error" displayed in the browser.

I tried fooling around with enabling/disabling certain specifics via system-config-security level, and I'd get weird, inconsistant results; it seemed to work half the time.

But when I disabled selinux entirely (either via the wizard or by editing /etc/selinux/config to read
it worked flawlessly.

See "additional information" below for some exerpts from my mod_jk.log.

It may be relevant, though I doubt it, that the servlets access mysql.

Version-Release number of selected component (if applicable):
selinux-policy-targeted-1.23.16-6, mod_jk-1.2.6-3jpp_4fc

How reproducible:

Steps to Reproduce:
1. Install tomcat, mod_jk, and mysql-connector-java, and configure them
2. Create a servlet, and configure it via its web.xml, etc.
3. Try to access the servlet from a browser, using a URL without the ":8080" port specification

Actual Results:  The browser displays a "Server Configuration Error" page urging me to report the problem to the webmaster.

Expected Results:  My servlet should have been run and responded with its own web page.

(And this is what in fact happens if you use the ":8080" port specification.)

(And it's not just my servelt; same problem with jsp-examples web app).

Additional info:

Here's a chunk of mod_jk.log showing the failure:
[jk_connect.c (136)]: Into jk_open_socket
[jk_connect.c (143)]: jk_open_socket, try to connect socket = 14 to
[jk_connect.c (159)]: jk_open_socket, after connect ret = -1
[jk_connect.c (188)]: jk_open_socket, connect() failed errno = 13
[jk_ajp_common.c (720)]: Error connecting to tomcat. Tomcat is probably not started or is listening on the wrong host/port ( Failed errno = 13
[jk_ajp_common.c (1024)]: Error connecting to the Tomcat process.
[jk_ajp_common.c (1468)]: sending request to tomcat failed in send loop. err=0

And here's the way it was supposed to work (and did, once I turned off selinux)
[jk_connect.c (136)]: Into jk_open_socket
[jk_connect.c (143)]: jk_open_socket, try to connect socket = 14 to
[jk_connect.c (159)]: jk_open_socket, after connect ret = 0
[jk_connect.c (168)]: jk_open_socket, set TCP_NODELAY to on

Comment 1 Daniel Walsh 2005-07-11 18:37:08 UTC
Fixed in selinux-policy-targeted-1.25.1-7

Note You need to log in before you can comment on or make changes to this bug.