1

OK, I formatted my flash to ext4 file system, changed all the permissions to 777 and mounted it to /var/www/html/web.

Now, when i access localhost/web it gives the following error:

"You don't have permission to access /web/cv on this server."

But when I normally access localhost it loads index.html that locates in /var/www/html directory, it means it has to do with mounting of flash.

Can't I hold my web directory inside my flash card in Linux? Why it gives permission error, maybe it could be related to Apache server? All guesses and solutions would be greatly appreciated.

BTW I am using Redhat Linux Enterprise Server 6

1 Answer 1

4

You're probably running into SELinux issues. The directories on the flash drive probably aren't labelled such that httpd_t can touch them. You can do a setenforce 0 ; service httpd restart and attempt to access again to confirm. If that is what's going on then you can either configure SELinux to go into permissive mode (last ditch "just trying to get it to work" solution) or run a recursive restorecon on /var/www

2
  • wow, that actually worked, though i have no idea what "setenforce 0" really did:) Commented Jun 10, 2013 at 11:25
  • It temporarily switches SELinux into permissive mode, where it will log all denials but not actually deny the operations. It's just a useful command for determining if SELinux is the problem. Your issue is probably the labeling issue, in which case doing the recursive restorecon after it's mounted should cause all files and directories to be re-labeled with something SELinux will allow httpd_t processes access to.
    – Bratchley
    Commented Jun 10, 2013 at 12:02

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .