Spyderserve Web Development

I typically move my root directory for Apache and this can get complicated when seLinux is enforced but with a bit of knowledge this can be done without disabling seLinux.

display current state of seLinux:


displays current permissions and seLinux settings for a directory (ex. ls -ldZ /var/www/html)

ls -ldZ [directory path]


ls -ldZ /var/www/html

Results in:

drwxr-xr-x. root root system_u:object_r:httpd_sys_content_t:s0 /var/www/html
Breaking this result down:
 system_u = user
 object_r = role
 httpd_sys_content_t = type
 s0 = level

So then, executing the following would adjust the seLinux settings on the desired directory:

chcon -R -u system_u -t httpd_sys_content_t [directory path]
Source: http://terminalinflection.com/relocating-apache-selinux/
Spyderserve  2225 Bemiss Road Suite D Valdosta, Georgia 31602 United States