0

I have an apache configuration problem (Apache 2.4.6 on CentOS 7.2) which I can't ferret out with apachectl -t.

Apache runs (it is started anew every Monday because the system is a virtual box for development) but shows the "It works!" page only; apachectl -S doesn't emit any output. In fact, any execution of the /sbin/apachectl script yields no output at all.

Called directly, /sbin/httpd -t tells me, "Syntax OK" (this had found some errors for which apachectl -t had let me down, especially in my macros use).

Probably relevant non-standard features of my configuration:

  • I use apache macros (LoadModule macro_module modules/mod_macro.so)
  • I use symbolic links in my configuration (e.g. links to sites-available/*.conf files in a sites-enabled/ sibling directory which doesn't seem to be used by default in CentOS installations). (No broken links, AFAICS; httpd -t would have complained, as I just tested.)

I found the following error in the journalctl -xe output: Could not open configuration file /etc/httpd/sites-enabled/vhosts-vbox-therp.conf: Permission denied. However, IMHO there is nothing wrong with this file:

lrwxrwxrwx. root root /etc/httpd/sites-enabled/vhosts-vbox-therp.conf -> ../sites-available/vhosts-vbox-therp.conf
-rw-r--r--. root root /etc/httpd/sites-available/vhosts-vbox-therp.conf
drwxr-xr-x. root root /etc/httpd/sites-available
drwxr-xr-x. root root /etc/httpd/sites-enabled
drwxr-xr-x. root root /etc/httpd
drwxr-xr-x. root root /etc
dr-xr-xr-x. root root /

Update: After elimination of that mentioned symlink, Apache reloaded successfully; however, the rest of the problem persists (no virtual hosts, no apachectl -S).

I updated apache (yum update httpd; now 2.4.6-45.el7.centos, was 2.4.6-40.el7.centos before). Didn't help.

There are still some symbolic links (used via macros), but I have a productive CentOS server where they don't cause problems (2.4.6.19.el7.centos).

(... and I fixed a few typos.)

0

Seems like CenOS may have screwed the apachectl script or the envvars file (or you screwed it yourself).

In any case all apachectl does is load envvars file:

. /path/to/apacheinstall/bin/envvars

and then call httpd:

/path/to/apacheinstall/bin/httpd

I would check the contents of both and try to fix what was done wrong or load the environment manually and call httpd directly.

envvars file by default (no distro versions): just adds /path/to/apacheinstall/lib to LD_LIBRARY_PATH apachectl loads previous file and adds a few commands for you to handle httpd easily.

  • I couldn't find any envvars file; /sbin/apachectl sources a /etc/sysconfig/httpd file which contains a LANG=C only (besides comments). This, and {/usr,}/sbin/{httpd,apachectl} all share the same time stamp (ls -l: 18. Jul 2016, with --time=ctime: 22. Nov 13:48), so I'm innocent of having screwed it myself ... – Tobias Feb 3 '17 at 13:28

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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