2

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.

Evandro Silva
  • 9,472
  • 6
  • 35
  • 44

1 Answers1

2

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.

  • 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. –  Oct 15 '12 at 12:02
  • 1
    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. –  Oct 15 '12 at 12:13