0ce23f
Using mod_fcgid with SELinux in Fedora Core 5 / RHEL 5 onwards
0ce23f
==============================================================
0ce23f
0ce23f
Versions of this package built for Fedora Core 5, 6, or 7 include an SELinux
0ce23f
policy module to support FastCGI applications. Later Fedora releases and Red
0ce23f
Hat Enterprise Linux 5.3 onwards include the policy in the main selinux-policy
0ce23f
package and do not require the separate module.
0ce23f
0ce23f
The module source (fastcgi.{fc,te}) is included for reference as documentation
0ce23f
in the package.
0ce23f
0ce23f
The module uses the same set of SELinux types for FastCGI applications as for
0ce23f
regular CGI scripts (or "system scripts" as they are known in SELinux), as
0ce23f
described in "man httpd_selinux".
0ce23f
0ce23f
 * httpd_sys_content_t
0ce23f
 - Set files with httpd_sys_content_t for content that is available
0ce23f
   from all FastCGI scripts and the daemon.
0ce23f
0ce23f
 * httpd_sys_script_exec_t
0ce23f
 - Set FastCGI scripts with httpd_sys_script_exec_t to allow them to run
0ce23f
   with access to all system script types.
0ce23f
0ce23f
 * httpd_sys_script_ro_t
0ce23f
 - Set files with httpd_sys_script_ro_t if you want httpd_sys_script_exec_t
0ce23f
   scripts to read but not write the data, and disallow other processes from
0ce23f
   access.
0ce23f
0ce23f
 * httpd_sys_script_rw_t
0ce23f
 - Set files with httpd_sys_script_rw_t if you want httpd_sys_script_exec_t
0ce23f
   scripts to read/write the data, and disallow other processes from access.
0ce23f
0ce23f
 * httpd_sys_script_ra_t
0ce23f
 - Set files with httpd_sys_script_ra_t if you want httpd_sys_script_exec_t
0ce23f
   scripts to read/append to the file, and disallow other processes from
0ce23f
   access.
0ce23f
0ce23f
So for the moin wiki layout described in README.RPM of the main mod_fcgid
0ce23f
package, the contexts would be set as follows:
0ce23f
0ce23f
    cd /var/www/mywiki
0ce23f
    chcon -t httpd_sys_content_t .
0ce23f
    chcon -R -t httpd_sys_script_exec_t cgi-bin
0ce23f
    chcon -R -t httpd_sys_script_rw_t data underlay
0ce23f
0ce23f
It is necessary to turn on the httpd_enable_cgi boolean to run either regular
0ce23f
or FastCGI scripts:
0ce23f
0ce23f
    setsebool -P httpd_enable_cgi 1
0ce23f
0ce23f
The httpd_can_sendmail boolean is used to specify whether any of your
0ce23f
web applications can make outbound SMTP connections (e.g. moin sending
0ce23f
notifications). By default it is off, but can be enabled as follows:
0ce23f
0ce23f
    setsebool -P httpd_can_sendmail 1
0ce23f
0ce23f
Only enable this functionality if you actually need it, since it increases the
0ce23f
chances that any vulnerability in any of your web applications could be
0ce23f
exploited by a spammer.
0ce23f
0ce23f
If you have any questions or issues regarding FastCGI and SELinux, please don't
0ce23f
hesitate to bring them up on fedora-selinux-list.
0ce23f