SELinux

To install MediaWiki on a system running SELinux the following additional steps must be performed:


 * chcon -R -t httpd_user_content_t /path/to/mediawiki_install

After building the PHP fileinfo extension:
 * chcon -t httpd_sys_script_exec_t /usr/lib/php/modules/fileinfo.so

Any additional files which will be execed by apache must be httpd_user_script_exec_t (not including PHP files). Files which are httpd_*_script_exec_t may not be written to by the apache process. Ideally the MediaWiki executable (PHP) files should all be set httpd_user_script_exec_t but this is not required by the current SELinux policy.

If uploads are enabled in your configuration, one might encounter a context problem because of the tmp directory used during the file upload process. Creating a tmp directory in /var/www/ instead of using /tmp or the 'default setting' for upload_tmp_dir in /etc/php.ini can get around this problem. Be sure to correctly chmod chgrp and chcon this new tmp directory.

Other handy SELinux tricks
audit2allow is a perl script that interprets the selinux errors and constructs the right rules to overcome various problems.

/usr/bin/audit2allow -i /var/log/messages

It outputs the lines you need to add to your policies to permit things that are reported as failing.

In /var/log/messages you should find an id corresponding to the selinux error that occurred.

sealert -l 

will give more information. One possible source of error is that you copied the uncompressed installation files from a home directory to a system area thereby invalidating their security context. This can be addressed by a command such as....

restorecon -R -v /var/www/html/mediawiki

When all else fails, try this

man setenforce