1
sinisas
7y

Ok, so for past 1 whole day I am trying to make vhost work on my brand new laptop, running Ubuntu 16.04 LTS... When I installed OS, I've set hard disk encryption, and on top of it - user home folder encryption. Don't ask me why I did both.

Setting up vhost is simple and straight forward - I did it hundreds, maybe thousands of times, on various Linux distros, server and desktop releases alike.

And of course, as it usually happens, opposed to all logic and reason - setting up virtual host on this machine did't work. No matter what I do - I get 403 (access not allowed).

All is correctly set - directory params in apache config, vhost paths, directory params within vhost, all the usual stuff.

I thought I was going crazy. I go back to several live servers I'm maintaining - exactly the same setup that doesn't work on my machine. Google it, SO-it, all I can see is exactly what I have been doing... I ended up checking char by char every single line, in disbelief that I cannot find what is the problem.

And then - I finally figured it out after loosing one whole day of my life on it:

I was trying to setup vhost to point to a folder inside my user's home folder - which is set to be encrypted.

Aaaaaand of course - even with all right permissions - Apache cannot read anything from it.

As soon as I tried any other folder outside my home folder - it worked.

I cannot believe that nobody encountered this issue before on Stackoverflow or wherever else.

Comments
  • 0
    May I ask why you did both?
  • 1
    @tracktraps I have no idea.
  • 0
    Hey double encryption is good! 👌
  • 0
    @linuxxx do u know how to setup vhost to work with encrypted home folder?
  • 0
    @sinisas As in apache/nginx vhosts and then setting the home dir as www folder or?
  • 1
    @linuxxx correct. Vhost that points to eg. /Home/username/some/path
  • 0
    @sinisas If you set the correct permissions etc it should work. That's complete independent of the encryption!
  • 1
    @linuxxx I did everything by the book. Works with any other folder with exactly the same permission setup.

    P.s for example /home/something/else with exactly the same chmod, chown, vhost dir permission setting works as expected.
  • 0
    @linuxxx It makes sense if several users access the computer and you have several users. If you're the only user, FDE + home folder encryption is actually just a waste of resources.
Add Comment