Because I use cPanel, the WHM developers are trying to restrict my subdomain creation to any folder within my user account of /home/username
.
In order to improve processing speed, I created a ram drive at /ram
and I want to host all my files there. I created a symbolic link named memory in /home/username
.
Currently my apache configuration file contains:
DocumentRoot /home/username/memory/public_html
include /home/username/configuration.conf
then in /home/username/configuration.conf
I have:
<Directory "/home/username/memory/public_html">
# insert rewrite rules here as it applies to site
</Directory>
This setup works OK but according to program tracing, numerous stat calls are made to check the validity of the symbolic link and to walk up the parent directories and if I can eliminate those per request then I'd have a faster web server.
Because the method to set document root to a path outside of the /home
folder for multiple sub-domains is to edit multiple files in the cpanel folder, the process is tedious.
Because the root apache configuration will eventually be overwritten by WHM/cpanel, I'm thinking of modifying /home/username/configuration.conf
to this:
DocumentRoot /ram/public_html
<Directory "/ram/public_html">
# insert rewrite rules here as it applies to site
</Directory>
If I do it, would the actual document root be overwritten to point to the actual memory folder of (/ram/public_html) and will the output be the same? or do I have to take extra steps to ensure my site is being served directly from a RAM folder (not from a symbolic link)?
DocumentRoot
directive will override an earlier directive.