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