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