Results 1 to 3 of 3

Thread: Error in mod_jk.log!(Tomcat5 & Aapche2)

  1. #1
    Member honey bee's Avatar
    Join Date
    Feb 2006
    Location
    Pakistan
    Posts
    146

    Error in mod_jk.log!(Tomcat5 & Aapche2)

    Hello!

    I have installed mod_jk again and trying to integrate tomcat5 and apache2.Now, when i start my tomcat and httpd service, i get the following errors in my mod_jk.log:

    [Thu Jul 20 12:43:32 2006] [error] init_jk::mod_jk.c (2370): Initializing shm:/etc/httpd/logs/jk-runtime-status errno=13
    [Thu Jul 20 12:43:34 2006] [error] init_jk::mod_jk.c (2370): Initializing shm:/etc/httpd/logs/jk-runtime-status errno=13
    [Thu Jul 20 12:43:47 2006] [error] jk_child_init::mod_jk.c (2326): Attachning shm:/etc/httpd/logs/jk-runtime-status errno=13
    [Thu Jul 20 12:43:47 2006] [error] jk_child_init::mod_jk.c (2326): Attachning shm:/etc/httpd/logs/jk-runtime-status errno=13
    [Thu Jul 20 12:43:48 2006] [error] jk_child_init::mod_jk.c (2326): Attachning shm:/etc/httpd/logs/jk-runtime-status errno=13
    [Thu Jul 20 12:43:48 2006] [error] jk_child_init::mod_jk.c (2326): Attachning shm:/etc/httpd/logs/jk-runtime-status errno=13
    [Thu Jul 20 12:43:48 2006] [error] jk_child_init::mod_jk.c (2326): Attachning shm:/etc/httpd/logs/jk-runtime-status errno=13
    [Thu Jul 20 12:43:48 2006] [error] jk_child_init::mod_jk.c (2326): Attachning shm:/etc/httpd/logs/jk-runtime-status errno=13
    [Thu Jul 20 12:43:49 2006] [error] jk_child_init::mod_jk.c (2326): Attachning shm:/etc/httpd/logs/jk-runtime-status errno=13
    [Thu Jul 20 12:43:49 2006] [error] jk_child_init::mod_jk.c (2326): Attachning shm:/etc/httpd/logs/jk-runtime-status errno=13
    I followed the following for mod_jk installation:
    http://tech.benellingson.net/roller/...d_jk_on_fedora

  2. #2
    Member honey bee's Avatar
    Join Date
    Feb 2006
    Location
    Pakistan
    Posts
    146

    Smile

    Hello!

    Ok....my problem solved.I made two changes and its working fine now Alhamdulillah.

    First change is adding the following lines to the /etc/httpd/conf/httpd.conf file:
    JkWorkersFile conf/workers.properties
    JkLogFile logs/mod_jk.log
    JkLogLevel info
    JkLogStampFormat "[%a %b %d %H:%M:%S %Y]"
    JkOptions +ForwardKeySize +ForwardURICompat -ForwardDirectories
    JkRequestLogFormat "%w %V %T"
    JkShmFile logs/jk.shm
    JkMount /* default
    and second one is changing the /etc/selinux/config entry to:
    SELINUX=disabled
    I saw it at the following link:
    https://bugzilla.redhat.com/bugzilla....cgi?id=161049

    Regards!

  3. #3
    Newbie
    Join Date
    Sep 2006
    Location
    Chicago, IL
    Posts
    1
    I too ran into this same issue after configuring Apache 2 with the mod_jk Tomcat connector. The fact that temporarily disabling SELinux (setenforce 0) allowed Apache to initialize the mod_jk connector properly told me that an SELinux policy violation was occurring. I verified this by inspecting "/var/log/messages" upon starting the httpd daemon, where two entries were logged that contained the following text segment: '...avc: denied {write } pid=xxxxx comm="httpd" name="jk.shm"...' (the "httpd" daemon was being denied write access to the file "jk.shm"). The two entries were identical except for the pid value. I copied one of the entries, created a temporary directory, and pasted the entry into a file (which I named "avc.tmp"). I then used the audit2allow utility to create an SELinux policy that allows the httpd daemon write access to the class of files that the "jk.shm" file belongs to based solely on the SELinux denial log entry copied from "/var/log/messages", as follows: audit2allow -M local < avc.tmp. This creates a policy file "local.pp" which can then be used to modify the current SELinux kernel policy by executing the command semodule -i local.pp. After performing these steps and restarting the httpd daemon, the mod_jk error log entries, as well as the SELinux "/var/log/messages" log entries were no longer seen.

    A few notes:
    1. Before I could execute audit2allow, I needed to install the "checkpolicy" RPM (yum install checkpolicy.i386)
    2. The "jk.shm" file is used by the mod_jk connector when the "load balancing" feature is utilized. It is created and utilized by the connector via the JkShmFile directive in the mod_jk conf file.
    3. I took this approach due to the fact that I did not want to completely disable SELinux since the project I am working on will be part of a publicly accessible Web site running on a production machine.
    4. I found this solution in a very informative SELinux FAQ at http://fedora.redhat.com/docs/selinu...fc5/#id2961385
    Last edited by grfalk; 09-14-2006 at 12:43 AM.

Similar Threads

  1. Apache2,Tomcat5 and mod_jk2
    By honey bee in forum Linux - Hardware, Networking & Security
    Replies: 2
    Last Post: 07-10-2006, 12:40 PM
  2. Tomcat5, Apache2 and mod_jk!
    By honey bee in forum Linux - Hardware, Networking & Security
    Replies: 6
    Last Post: 07-05-2006, 12:18 PM
  3. Internal Server Error - ASP error
    By Jason Lu in forum Windows - General Topics
    Replies: 2
    Last Post: 02-18-2005, 09:45 AM
  4. Has anyone seen this error before?
    By datamike in forum Linux - General Topics
    Replies: 13
    Last Post: 12-24-2003, 03:15 AM
  5. ran into odd error
    By Inition in forum Linux - General Topics
    Replies: 3
    Last Post: 03-18-2002, 05:59 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •