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