Bug 161049 - mod_jk malfunctions when selinux is enforced
mod_jk malfunctions when selinux is enforced
Status: CLOSED CURRENTRELEASE
Product: Fedora
Classification: Fedora
Component: selinux-policy-targeted (Show other bugs)
4
i386 Linux
medium Severity high
: ---
: ---
Assigned To: Daniel Walsh
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2005-06-20 04:45 EDT by Kim McCall
Modified: 2007-11-30 17:11 EST (History)
0 users

See Also:
Fixed In Version: 1.25.1-7
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2005-08-19 03:56:20 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Kim McCall 2005-06-20 04:45:09 EDT
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
  http://localhost:8080/svlt
but when I use
  http://localhost/svlt
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
  SELINUX=permissive
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:
Always

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 127.0.0.1:8009
[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 (127.0.0.1:8009). 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 127.0.0.1:8009
[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 14:37:08 EDT
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.