Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Can SELinux, in any way, cause Apache to only store web-site files on one partition?

I'm unable to set up a localhost HTTP server with apache using html files that are on another mounted partition. I can access the HTML files in /var/www, but not on /media/HTTP_Server/web_files.

share|improve this question
up vote 2 down vote accepted

You haven't written your configuration. You should tell your os version and apache version in your question. I'm assuming you have 12.04 with apache and selinux set up via the package management system.

A file should be readable by the apache's user. And it is possible that selinux might be blocking the acces to those files. Make sure that /media/HTTP_Server/web_files is universally readable and executable. In case it is not, set it that way:

chmod 755 /media/HTTP_Server/web_files

After this, if the files are still inaccesible, assuming your apache configuration is correct, selinux might be an obstacle for apache. but I have used many servers with ubuntu (lighttpd, nginx, apache) and never had an issue with selinux.

In case everything is ok but the selinux, this tutorial might be helpful.

share|improve this answer
Thank you @g_kaya. I just wanted to know if SELinux affects Apache. I you do not have the problem, then it must be an ID10t error on my part. – user97575 Oct 15 '12 at 12:02
You're welcome. Idk if selinux is installed on ubuntu by default by the way, you may want to have a look at dpkg -l | grep selinux if you didn't set it up. – user91091 Oct 15 '12 at 12:13

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.