1

I am trying to configure mod_jk in Apache 2.2.3 to connect with Tomcat 7. OS is CentOS 5

After all the configuration, while starting the Apache httpd I am getting -

Starting httpd: httpd: Syntax error on line 200 of /etc/httpd/conf/httpd.conf: Cannot load /etc/httpd/modules/mod_jk.so into server: /etc/httpd/modules/mod_jk.so: cannot open shared object file: Permission denied

I see the permission is set alright

-rwxr-xr-x 1 root root  266752 Jun  3 19:37 mod_jk.so

I don't know what to do. Can any one please help?

Debopam Mitra
  • 1,842
  • 4
  • 27
  • 51
  • copy paste line 200 of /etc/httpd/conf/httpd.conf – Ghayel Jun 03 '16 at 18:17
  • I don't understand the combination of "while starting Tomcat 7" and "/etc/httpd/conf/httpd.conf": Does your tomcat read httpd.conf? It must be a message from Apache httpd, right? As that's typically starting as root, permissions should be good. If it already dropped the permissions, make sure that the *directory* `/etc/httpd/modules` (and its parents) are readable for the unprivileged apache user, whichever CentOS uses. – Olaf Kock Jun 03 '16 at 18:24
  • @Olaf I edited the question. It's not tomcat 7, it's apache. – Debopam Mitra Jun 03 '16 at 19:26
  • @Olaf I am using the Root only. I am totally using root from the beginning of configuration. – Debopam Mitra Jun 03 '16 at 19:27
  • @Ghayel, here is the content of line 200: LoadModule jk_module modules/mod_jk.so – Debopam Mitra Jun 03 '16 at 19:35
  • #Comment line 200 and `service httpd restart` – Ghayel Jun 03 '16 at 19:48
  • Yes it's working fine. – Debopam Mitra Jun 03 '16 at 20:00
  • I don't think I did any mistakes in configuration. I don't if it's a problem that I am using binary instead of building the mod_jk from source. – Debopam Mitra Jun 03 '16 at 20:03
  • I tried building from source and it worked. But still confused why the binaries were not working. – Debopam Mitra Jun 03 '16 at 22:44

1 Answers1

2

Check your SELinux configuration.

Either open file /etc/selinux/config and check selinux setting or

run getenforce and see the output.

If I am correct then you will find it to be Enforcing. Now set it to permissive and restart httpd. You might need to reboot system to take effect.

Pramod
  • 768
  • 1
  • 12
  • 27