I had this sorted out before, but now I had to wipe my VPS and apparently I can't configure stuff properly anymore, so..
I've set up a Debian VPS and installed Virtualmin on it I bought a test domain to use with that VPS and pointed its main A DNS to my VPS IP I used Virtualmin to create a virtual server for the root domain, let's say example.org, but whenever I opened the URL I'd get the default virtualhost page I proceeded to delete the default VH (not the ACTUAL default, just one that Virtualmin created) and I still get pointed to /var/www instead of /home/example/public_html Ignoring this, I tried creating a subdomain hoping that at least this one would've pointed to the correct directoy, but nothing worked (I created the *.example.org CNAME DNS as well, all pointing to example.org, is that correct?)
Here's the VH file that Virtualmin created:
<VirtualHost 127.0.0.2:80>
SuexecUserGroup "#1001" "#1001"
ServerName example.org
ServerAlias www.example.org
ServerAlias webmail.example.org
ServerAlias admin.example.org
DocumentRoot /home/example/public_html
ErrorLog /var/log/virtualmin/example.org_error_log
CustomLog /var/log/virtualmin/example.org_access_log combined
ScriptAlias /cgi-bin/ /home/example/cgi-bin/
DirectoryIndex index.html index.htm index.php index.php4 index.php5
<Directory /home/example/public_html>
Options -Indexes +IncludesNOEXEC +SymLinksIfOwnerMatch +ExecCGI
allow from all
AllowOverride All Options=ExecCGI,Includes,IncludesNOEXEC,Indexes,MultiViews,SymLinksIfOwnerMatch
AddType application/x-httpd-php .php
AddHandler fcgid-script .php
AddHandler fcgid-script .php5
FCGIWrapper /home/example/fcgi-bin/php5.fcgi .php
FCGIWrapper /home/example/fcgi-bin/php5.fcgi .php5
</Directory>
<Directory /home/example/cgi-bin>
allow from all
AllowOverride All Options=ExecCGI,Includes,IncludesNOEXEC,Indexes,MultiViews,SymLinksIfOwnerMatch
</Directory>
RewriteEngine on
RewriteCond %{HTTP_HOST} =webmail.example.org
RewriteRule ^(.*) https://example.org:20000/ [R]
RewriteCond %{HTTP_HOST} =admin.example.org
RewriteRule ^(.*) https://example.org:10000/ [R]
RemoveHandler .php
RemoveHandler .php5
php_admin_value engine Off
IPCCommTimeout 31
FcgidMaxRequestLen 1073741824
Alias /pipermail /var/lib/mailman/archives/public
RedirectMatch /cgi-bin/mailman/([^/\.]*)(.cgi)?(.*) https://example.org:10000/virtualmin-mailman/unauthenticated/$1.cgi$3
RedirectMatch /mailman/([^/\.]*)(.cgi)?(.*) https://example.org:10000/virtualmin-mailman/unauthenticated/$1.cgi$3
</VirtualHost>
Apprently, the default-ss.conf configuration is used for any sort of request, but I can't figure out why, since it begins with "VirtualHost default:443" and I'm requesting on the default 80 port
#include
statements look like?