2007-06-15 17:09:39 +00:00
|
|
|
Using mod_fcgid with SELinux in Fedora Core 5 / RHEL 5 onwards
|
|
|
|
==============================================================
|
2006-09-06 13:47:08 +00:00
|
|
|
|
2008-10-22 10:31:34 +00:00
|
|
|
The module uses the same set of SELinux types for FastCGI applications as for
|
|
|
|
regular CGI scripts (or "system scripts" as they are known in SELinux), as
|
|
|
|
described in "man httpd_selinux".
|
2006-09-06 13:47:08 +00:00
|
|
|
|
2008-10-22 10:31:34 +00:00
|
|
|
* httpd_sys_content_t
|
2018-01-26 19:59:25 +00:00
|
|
|
- Set files with httpd_sys_content_t for content that is available to read
|
2006-09-06 13:47:08 +00:00
|
|
|
from all FastCGI scripts and the daemon.
|
|
|
|
|
2018-01-26 19:59:25 +00:00
|
|
|
* httpd_sys_rw_content_t
|
|
|
|
- Set files with httpd_sys_rw_content_t if you want httpd_sys_script_exec_t
|
|
|
|
scripts to read/write the data, and disallow other processes from access.
|
|
|
|
|
2008-10-22 10:31:34 +00:00
|
|
|
* httpd_sys_script_exec_t
|
|
|
|
- Set FastCGI scripts with httpd_sys_script_exec_t to allow them to run
|
|
|
|
with access to all system script types.
|
2006-09-06 13:47:08 +00:00
|
|
|
|
2007-06-15 17:09:39 +00:00
|
|
|
So for the moin wiki layout described in README.RPM of the main mod_fcgid
|
2006-09-06 13:47:08 +00:00
|
|
|
package, the contexts would be set as follows:
|
|
|
|
|
|
|
|
cd /var/www/mywiki
|
2008-10-22 10:31:34 +00:00
|
|
|
chcon -t httpd_sys_content_t .
|
|
|
|
chcon -R -t httpd_sys_script_exec_t cgi-bin
|
2018-01-26 19:59:25 +00:00
|
|
|
chcon -R -t httpd_sys_rw_content_t data underlay
|
2006-09-06 13:47:08 +00:00
|
|
|
|
|
|
|
It is necessary to turn on the httpd_enable_cgi boolean to run either regular
|
|
|
|
or FastCGI scripts:
|
|
|
|
|
|
|
|
setsebool -P httpd_enable_cgi 1
|
|
|
|
|
2008-10-22 10:31:34 +00:00
|
|
|
The httpd_can_sendmail boolean is used to specify whether any of your
|
|
|
|
web applications can make outbound SMTP connections (e.g. moin sending
|
2007-06-15 17:09:39 +00:00
|
|
|
notifications). By default it is off, but can be enabled as follows:
|
|
|
|
|
2008-10-22 10:31:34 +00:00
|
|
|
setsebool -P httpd_can_sendmail 1
|
2007-06-15 17:09:39 +00:00
|
|
|
|
|
|
|
Only enable this functionality if you actually need it, since it increases the
|
2008-10-22 10:31:34 +00:00
|
|
|
chances that any vulnerability in any of your web applications could be
|
2007-06-15 17:09:39 +00:00
|
|
|
exploited by a spammer.
|
|
|
|
|
2006-09-06 13:47:08 +00:00
|
|
|
If you have any questions or issues regarding FastCGI and SELinux, please don't
|
2018-01-26 19:59:25 +00:00
|
|
|
hesitate to bring them up on Fedora's selinux-list.
|
2006-09-06 13:08:59 +00:00
|
|
|
|