« June 2005 | Main | December 2005 »

October 15, 2005

SELinux and loading dynamic Apache modules

This past week, for work, I set up a KnowledgeTree document server. It required installing MySQL, PHP, Apache, Java, and the IMAP Toolkit.

It actually went pretty well, but I did hit a wall when I went to start Apache. System Admin uses Fedora Core 4, and from what I can tell, it automatically runs with SELinux. Either way, I kept getting this error starting Apache:

Cannot load /usr/lib/httpd/modules/libphp4.so into server: /usr/lib/httpd/modules/libphp4.so: cannot restore segment prot after reloc: Permission denied

Most hits I found searching on the web suggested turning off SELinux via "setenforce 0" which, I guess (based on the man page) turns SELinux into "permissive" mode.

This seemed like a bit of overkill, and searching I found this instead:

chcon /usr/local/apache2/modules/libphp4.so -t shlib_t

That did the trick...

Posted by alan at 12:09 PM