I have installed an Apache HTTP Server in CentOS 7. After installation it runs successfully.
Then I tried to add the mod_jk module following these steps.
- I downloaded the Tomcat Connectors ziped sources file. I tried with v.1.2.35 (this version always worked) and v.1.2.42 (lastest version).
- I unziped the file.
- Inside $TOMCAT_CONNECTORS_UNZIPED_DIR/native I executed
./configure --with-apxs=/usr/sbin/apxs && make
- I copied $TOMCAT_CONNECTORS_UNZIPED_DIR/native/apache-2.0/mod_jk.so to /etc/httpd/modules
- I changed the file's owner to root and file's permissions to 755.
- I added the file 10-mod_jk.conf to /etc/httpd/conf.modules.d/ with this content
LoadModule jk_module modules/mod_jk.so
- I restarted Apache to apply changes.
After step 7, I got this:
Redirecting to /bin/systemctl restart httpd.service Job for httpd.service failed because the control process exited with error code. See "systemctl status httpd.service" and "journalctl -xe" for details.
Taking a look to the log, I got this:
ene 11 15:04:42 esvirlcportal02.amaseguros.local systemd[1]: Stopping The Apache HTTP Server... ene 11 15:04:43 esvirlcportal02.amaseguros.local systemd[1]: Starting The Apache HTTP Server... ene 11 15:04:43 esvirlcportal02.amaseguros.local httpd[14485]: httpd: Syntax error on line 56 of /etc/httpd/conf/httpd.conf: Syntax error on line 1 of /etc/httpd/conf.modules.d/10-jk.conf: Cannot load modules/mod_jk.so into server: /etc/httpd/modules/mod_jk.so: cannot open shared object file: Permission denied ene 11 15:04:43 esvirlcportal02.amaseguros.local systemd[1]: httpd.service: main process exited, code=exited, status=1/FAILURE ene 11 15:04:43 esvirlcportal02.amaseguros.local kill[14486]: kill: cannot find process "" ene 11 15:04:43 esvirlcportal02.amaseguros.local systemd[1]: httpd.service: control process exited, code=exited status=1 ene 11 15:04:43 esvirlcportal02.amaseguros.local systemd[1]: Failed to start The Apache HTTP Server. ene 11 15:04:43 esvirlcportal02.amaseguros.local systemd[1]: Unit httpd.service entered failed state. ene 11 15:04:43 esvirlcportal02.amaseguros.local systemd[1]: httpd.service failed.
I have done these steps many times and I never had a problem. I have repeated them carefully twice more with same result.
Any idea about what could be the problem?
Thanks!
== UPDATE ==
I use the steps explained in SELinux Preventing Apache Start as @Federico_Sierra said, but it is still failing. With the last comand I got this:
# ausearch -m avc -ts recent ---- time->Wed Jan 11 15:46:03 2017 type=SYSCALL msg=audit(1484145963.026:288): arch=c000003e syscall=2 success=no exit=-13 a0=7fcbcb999920 a1=242 a2=1b6 a3=0 items=0 ppid=1 pid=14516 auid=4294967295 uid=0 gid=0 euid=0 suid=0 fsuid=0 egid=0 sgid=0 fsgid=0 tty=(none) ses=4294967295 comm="httpd" exe="/usr/sbin/httpd" subj=system_u:system_r:httpd_t:s0 key=(null) type=AVC msg=audit(1484145963.026:288): avc: denied { write } for pid=14516 comm="httpd" path="/var/log/httpd/jk-runtime-status.14516" dev="dm-1" ino=139239092 scontext=system_u:system_r:httpd_t:s0 tcontext=system_u:object_r:httpd_log_t:s0 tclass=file
But I have no idea about it means.