I am currently using the latest version of Virtualmin on an Ubuntu server. I need to migrate several websites from an old server to this new server. In the old server, all the websites are located in the /var/www/ directory, but in the new server, virtualmin saves them in /home/user/public_html.
I have found the option to change the default Apache virtual host configuration in Virtualmin. The current configuration looks like this:
ServerName ${DOM}
ServerAlias www.${DOM}
ServerAlias mail.${DOM}
DocumentRoot ${HOME}/public_html
ErrorLog /var/log/virtualmin/${DOM}_error_log
CustomLog /var/log/virtualmin/${DOM}_access_log combined
ScriptAlias /cgi-bin/ ${HOME}/cgi-bin/
DirectoryIndex index.php index.php4 index.php5 index.htm index.html
<Directory ${HOME}/public_html>
Options -Indexes +IncludesNOEXEC +SymLinksIfOwnerMatch
Require all granted
AllowOverride All
</Directory>
<Directory ${HOME}/cgi-bin>
Require all granted
AllowOverride All
</Directory>
My question is, can I simply change the
DocumentRoot ${HOME}/public_html
line to DocumentRoot /var/www/${DOM}/public_html
in order to achieve the desired configuration? I want to make sure that the websites are served from the correct directory while keeping other files, by default, saved in the /home/user directory.