Crmgo Blog

CentOS 6.2 Security Policy

CentOS 6.2 Security Policy

The other day, I tried to change the default Apache directory from /var/www and encountered the error: "You don't have permission to access /newdir/ on this server." This can be fixed by running the following commands: yum install policycoreutils-python semanage semanage fcontext -a -t httpd_sys_content_t "/newdir(/.*)?" restorecon -R /newdir

CentOS 6.2 Security Policy

Recently, I tried to change the default Apache directory /var/www and encountered:

You don't have permission to access /newdir/ on this server.

Here's how to fix it:

yum install policycoreutils-python

semanage fcontext -a -t httpd_sys_content_t "/newdir(/.*)?"
restorecon -R -v /newdir

Note: This post may be AI-assisted and then human-edited. Editorial responsibility: Dmytro Lomaka, Kaltenkirchen.