由于我使用cPanel,WHM开发人员试图将我的子域创建限制在/home/username用户帐户中的任何文件夹中。
为了提高处理速度,我在/ram上创建了一个ram驱动器,我想在那里托管所有的文件。我在/home/username中创建了一个名为内存的符号链接。
当前,我的apache配置文件包含:
DocumentRoot /home/username/memory/public_html
include /home/username/configuration.conf然后在/home/username/configuration.conf中我有:
<Directory "/home/username/memory/public_html">
# insert rewrite rules here as it applies to site
</Directory>此设置工作正常,但根据程序跟踪,大量stat调用用于检查符号链接的有效性,并遍历父目录,如果我能够消除每个请求,那么我将有一个更快的web服务器。
因为将文档根设置为多个子域的/home文件夹外的路径的方法是编辑cpanel文件夹中的多个文件,所以这个过程很繁琐。
由于根apache配置最终将被WHM/cpanel覆盖,因此我考虑将/home/username/configuration.conf修改为:
DocumentRoot /ram/public_html
<Directory "/ram/public_html">
# insert rewrite rules here as it applies to site
</Directory>如果这样做,实际的文档根是否会被覆盖以指向(/ram/public_html)的实际内存文件夹,并且输出是否相同?或者,我是否需要采取额外的步骤来确保我的站点直接从RAM文件夹(而不是从符号链接)服务?
发布于 2016-05-23 23:38:46
我尝试在DocumentRoot "/path/to/new"之外的包含的conf文件中重写httpd.conf,它似乎很好用。这是针对Apache 2.4的。
https://webmasters.stackexchange.com/questions/88925
复制相似问题