Friday, December 25, 2009

Writing custom SELinux policy for Apache

I am using Drupal and CakePHP and had issues with file caching because of SELinux.

Here is a simple module which adds a new type to handle that:

Store it in a file named let's say apachewrite.te

Now we declare the file context:

You can store this in apachewrite.fc

Now on to compile,package and install the module:

The final step is to relabel the directories:

You can edit the context file and add or alter the expressions. Just do not forget to increment the version of the module in order to update it using -u with semodule.

No comments: