Pages

Wednesday, 18 April 2012

Adding Apache document root permission to SELinux

On redhat linux with SELinux enabled, merely changing the document root path in the /etc/httpd/conf/httpd.conf file is not enough to make Apache work with the new location. Apache will give "File Not Found" error. To fix this problem, just use the following script. Make sure to change $HTTP_DOC to the location of the new apache document root.

#!/bin/sh

HTTP_DOC=/home/www/html

setsebool -P httpd_enable_homedirs on
chmod 755 $HTTP_DOC
chown -R apache.apache $HTTP_DOC
chcon -R -t httpd_sys_content_t $HTTP_DOC
 

6 comments:

  1. thank you kind sir. I only had information for the last part of the script and was under permission hell

    ReplyDelete
  2. Hi, Great.. Tutorial is just awesome..It is really helpful for a newbie like me.. I am a regular follower of your blog. Really very informative post you shared here. Kindly keep blogging. If anyone wants to become a Java developer learn from Java Training in Chennai. or learn thru Java Online Training in India . Nowadays Java has tons of job opportunities on various vertical industry.


    or Javascript Training in Chennai. Nowadays JavaScript has tons of job opportunities on various vertical industry.

    ReplyDelete
  3. This page contains a list of The Sims 4 cheats, Easter eggs, tips, and other secrets. The following list of Sims 4 cheats are designed specifically for PC.

    ReplyDelete
  4. The web hosting industry is known for its cut-throat competition over pricing, especially with cloud hosting becoming popular. But there are many web hosts who silently provide free services and advise to many organisations that deserve it. This article lists some of the ways in which many local web hosting providers help to get organizations and businesses online. https://onohosting.com/

    ReplyDelete
  5. Playtech - New Zealand's #1 supplier of gaming equipment
    Playtech, sol.edu.kg an innovator of software 토토 사이트 and งานออนไลน์ services gri-go.com for online gaming and iGaming products, 바카라 사이트 have partnered with supplier Casino.

    ReplyDelete