Blame SOURCES/mod_fcgid-2.1-README.SELinux

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