apache - 从多个域访问同一个目录
问题描述
您好我有几个域想要访问同一个图像存储库。有没有一种简单的方法可以做到这一点?我在linux上运行plesk。
我找到了这个页面https://httpd.apache.org/docs/2.4/mod/core.html#directory。将此语法放入服务器设置中 http 和 https 部分的附加指令中。
这会
<Directory "/usr/local/httpd/htdocs">
Options Indexes FollowSymLinks
</Directory>
允许我读写这些目录吗?
解决方案
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?
推荐阅读
- javascript - 使用jquery在一定量的滚动后向元素添加一个类
- sql - 使用 SQL 在一列中显示计算数据和非计算数据
- python - 为什么我的烧瓶路线不返回“成功!”?
- swift - 有没有办法指定运行循环和模式以从发布者接收元素
- ios - 堆栈视图未显示
- c# - 为什么 Auth0 登录屏幕不返回 UWP 应用
- sql - 如何减小 SQL 日志文件大小
- amazon-web-services - 无法使用 PuTTY 连接到 Amazon EC2 实例
- hbase - 为什么 HBase 删除恢复到以前的值而不是完全删除它
- forms - 尝试创建颜色以更改 Windows::Form 的背景时出现 C2228 错误