Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am configuring Apache\PHP and noticed Apache complaining about permissions with the php shared object.

Starting httpd: 
httpd: Syntax error on line 206 of /etc/httpd/conf/httpd.conf: 
Cannot load /usr/lib/httpd/modules/ into server: 
/usr/lib/httpd/modules/ cannot restore segment prot after reloc: 
Permission denied

I looked at the context (started fine with enforcement off) and found:

# ls --context /usr/lib/httpd/modules/
-rwxr-xr-x root root root:object_r:httpd_modules_t /usr/lib/httpd/modules/

Shouldn't httpd (apache) be able to access files with a context of httpd_modules_t? I got it fixed by applying

chcon -t textrel_shlib_t '/usr/lib/httpd/modules/'

But I would think the httpd version would work before this one. Can someone explain this to me?

share|improve this question

Under SELinux each item is required to have a context. Text relocation can be described as an error. Changing the context creates an exception coaxing SELinux into allowing it to load even though it in essence is b0rken. Way better text relocation explanation: BTW using 'chcon' isn't permanent: relabeling will reset the context. Use 'semanage fcontext -a -t textrel_shlib_t /usr/lib/httpd/modules/' to make it stick (see /etc/selinux/targeted/contexts/files/file_contexts.local).


share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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