0

While the title of this question matches an already asked question, in my case I already set Options +FollowSymLinks.

The setup is the following: my hosting setup includes htdocs/ directory that is the default document root for HTTP websites and htdocs-secure that is for HTTPS. They are meant for sites that need a different HTTPS version.

In case both share the same files I create a link from htdocs-secure to htdocs by ln -s htdocs htdocs-secure but here comes the problem! Log still says Symbolic link not allowed or link target not accessible: /path/to/htdocs-secure

Vhost fragment

    Header always set Strict-Transport-Security "max-age=500"
    DocumentRoot /path/to/htdocs-secure
    <Directory "/path/to/htdocs-secure">
        allow from all
        Options +FollowSymLinks
    </Directory>

I think it's a correct setup. The HTTP version of the site is accessible, so it doesn't look like a permission problem.

How to fix this?

[Add] other info: I use MPM-itk and I set AssignUserId to the owner/group of both the directories

usr-local-ΕΨΗΕΛΩΝ
  • 2,359
  • 7
  • 34
  • 52

1 Answers1

1

I guess that this problem is due to the fact that your DocumentRoot already is a symlink. Therefore the <Directory> clause won't match, as there is no real directory of that name, only a symlink. Perhaps you can set the FollowSymLinks option for /path/to, but you'll have to try whether that works.

Is there any reason against making the htdocs directory itself the DocumentRoot for both HTTP and HTTPS? After all, when you symlink them, they will always look the same, so you might as well use the same directory in the first place.

MvG
  • 1,813
  • 15
  • 18
  • The reason is that I use a macro to create virtual hosts. Nothing more. So I want the hosting platform to grant the possibility of hosting different files for HTTP/HTTPS and allow to merge the two sites into a single one. Creating a new macro "HostingSSLWithSameSite" is supposed to work – usr-local-ΕΨΗΕΛΩΝ Oct 01 '12 at 11:04