Problem with apache accessing files outside of /var/www/html directory

Josef Kubin jkubin at redhat.com
Tue Feb 19 16:52:50 UTC 2008


Hello David,
consider using the default directory /var/www/cgi-bin/ for your CGI scripts.

If you have moved some files you should also fix context

# restorecon -Rv /var/www/cgi-bin/

Note, cp and mv behaves differently on files as regards of security context.

Josef

David Bartmess wrote:
> I’m trying to get apache to serve up via a CGI script the formatted 
> contents of a directory outside of the DocumentRoot directory structure, 
> and SELinux is giving me a “Permissions Denied” error.
> 
>  
> 
> How can I modify the SELinux context on the files being shown to fix this?
> 
>  
> 
> The current files/dirs have the following context:
> 
>  
> 
> drwxr-xr-x  apache   apache   system_u:object_r:default_t      v1x3x3_R3-6
> 
> drwxr-xr-x  apache   apache   system_u:object_r:default_t      v1x3x4-R1-0
> 
> drwxr-xr-x  apache   apache   system_u:object_r:default_t      v1x3x4-R2-0
> 
> -rwxr-xr-x  apache   apache   system_u:object_r:default_t      
> ASUCTests_v1-2-3_b1x3x4.R2_JUnitReport.zip
> 
> -rwxr-xr-x  apache   apache   system_u:object_r:default_t      
> Emma_Acquisition_Configuration_v2-3-0.zip
> 
>  
> 
> I’m a newbie at this SELinux stuff, so please speak clearly <grin>
> 
>  
> 
> David Bartmess. Configuration Manager
> 
> Cell:   +1 (303) 883-9117
> 
> Office:+1 (303) 256-5123
> 
>  
> 
> 
> ------------------------------------------------------------------------
> 
> --
> fedora-selinux-list mailing list
> fedora-selinux-list at redhat.com
> https://www.redhat.com/mailman/listinfo/fedora-selinux-list




More information about the fedora-selinux-list mailing list