首页 > 解决方案 > 从多个域访问同一个目录

问题描述

您好我有几个域想要访问同一个图像存储库。有没有一种简单的方法可以做到这一点?我在linux上运行plesk。

我找到了这个页面https://httpd.apache.org/docs/2.4/mod/core.html#directory。将此语法放入服务器设置中 http 和 https 部分的附加指令中。

这会

<Directory "/usr/local/httpd/htdocs">
  Options Indexes FollowSymLinks
</Directory>

允许我读写这些目录吗?

标签: apachehostingplesk

解决方案


FollowSymLinks option will allow exactly it - Apache will be able to process data which is not physically located inside domain directory, but is referred to by a symlink located inside domain directory. There are two major points that you should be aware of:

1. You should have sufficient permission for system users of the domain which will be accessing shared files on the directory which contain these files. Basically, chmod 666 will do the job, but it is up to you how exactly set up rights to maintain desirable security level.

2. If websites are using PHP code, you should ensure that shared directory is included in open_basedir value.

This link can be useful - How to change open_basedir parameter for all domains?


推荐阅读