0

This question already has an answer here:

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.

  1. 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).
  2. I unziped the file.
  3. Inside $TOMCAT_CONNECTORS_UNZIPED_DIR/native I executed
 ./configure --with-apxs=/usr/sbin/apxs && make
  1. I copied $TOMCAT_CONNECTORS_UNZIPED_DIR/native/apache-2.0/mod_jk.so to /etc/httpd/modules
  2. I changed the file's owner to root and file's permissions to 755.
  3. I added the file 10-mod_jk.conf to /etc/httpd/conf.modules.d/ with this content
LoadModule jk_module modules/mod_jk.so
  1. 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.

marked as duplicate by Michael Hampton Jan 11 '17 at 17:58

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

  • Check the file permissions and SELinux if you have enabled. – Federico Sierra Jan 11 '17 at 14:28
  • SElinux and firewall service are disabled (I have rebooted to make sure) and file permissions are set to 755 (step 5) like the other files in modules directory – Carlos Durán Jan 11 '17 at 14:42
  • @Federico_Sierra, I tried that solution and it is still failing. See the update in the question. – Carlos Durán Jan 11 '17 at 15:02
0

After follow the link provided by @Federico-Sierra (SELinux Preventing Apache Start) I rebooted the OS and when I tried again it worked.

Thank you so much!!

Not the answer you're looking for? Browse other questions tagged or ask your own question.