I've changed 00_master.conf and 00_master_ssl.conf, created an non existing vhost at the beginning of the file. If you access the server with an non existing domain, it will show an domain parking page. For an non existing ssl domain i've created an .htaccess file which redirects to the same non-ssl domain. I've also added an subdomain for webmail, ftp and pma which is accessible from all domains.
My 00_master.conf looks like:
QuoteDisplay More<VirtualHost SERVER_IP:80>
ServerName not_available
ServerAdmin ADMIN_EMAIL
DocumentRoot /var/www/virtual/not_available/htdocs
LogLevel error
ErrorLog /var/log/apache2/not_available/error.log
Alias /errors /var/www/virtual/not_available/errors
# SECTION suexec BEGIN.
SuexecUserGroup vu2000 vu2000
# SECTION suexec END.
<Directory /var/www/virtual/not_available/htdocs>
Options +FollowSymlinks
AllowOverride All
# SECTION fcgid BEGIN.
Options +ExecCGI
FCGIWrapper /var/www/fcgi/master/php5-fcgid-starter
# SECTION fcgid END.
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} -s [OR]
RewriteCond %{REQUEST_FILENAME} -l [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^.*$ - [NC,L]
RewriteRule ^.*$ plugins.php [NC,L]
Allow from all
</Directory>
</VirtualHost>
<VirtualHost SERVER_IP:80>
ServerName admin.ADMIN_DOMAIN
ServerAdmin ADMIN_EMAIL
DocumentRoot /var/www/imscp/gui/public
LogLevel error
ErrorLog /var/log/apache2/ADMIN_DOMAIN/error.log
RedirectMatch permanent ^/webmail[\/]?$ https://webmail.ADMIN_DOMAIN
RedirectMatch permanent ^/ftp[\/]?$ https://ftp.ADMIN_DOMAIN
RedirectMatch permanent ^/pma[\/]?$ https://pma.ADMIN_DOMAIN
Alias /errors /var/www/imscp/gui/public/errordocs
Alias /ispLogos /var/www/imscp/gui/data/persistent/ispLogos
AliasMatch ^/themes/(.*)/assets/(.*)$ /var/www/imscp/gui/themes/$1/assets/$2
AliasMatch ^/(.*)/themes/(.*)/assets/(.*)$ /var/www/imscp/gui/plugins/$1/themes/$2/assets/$3
# SECTION suexec BEGIN.
SuexecUserGroup vu2000 vu2000
# SECTION suexec END.
<Directory /var/www/imscp/gui/public>
Options +FollowSymlinks
AllowOverride All
# SECTION fcgid BEGIN.
Options +ExecCGI
FCGIWrapper /var/www/fcgi/master/php5-fcgid-starter
# SECTION fcgid END.
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} -s [OR]
RewriteCond %{REQUEST_FILENAME} -l [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^.*$ - [NC,L]
RewriteRule ^.*$ plugins.php [NC,L]
Allow from all
</Directory>
<Location /ispLogos>
Allow from all
</Location>
<LocationMatch ^/themes/.*/assets/.*$>
Allow from all
</LocationMatch>
<LocationMatch ^/.*/themes/.*/assets/.*$>
Allow from all
</LocationMatch>
# SECTION custom BEGIN.
RewriteEngine On
RewriteRule .* https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L]
# SECTION custom END.
</VirtualHost>
<VirtualHost SERVER_IP:80>
ServerName webmail.ADMIN_DOMAIN
ServerAlias webmail.*
ServerAdmin ADMIN_EMAIL
DocumentRoot /var/www/imscp/gui/public/tools/webmail
LogLevel error
ErrorLog /var/log/apache2/ADMIN_DOMAIN/error.log
Alias /errors /var/www/imscp/gui/public/errordocs
Alias /ispLogos /var/www/imscp/gui/data/persistent/ispLogos
AliasMatch ^/themes/(.*)/assets/(.*)$ /var/www/imscp/gui/themes/$1/assets/$2
AliasMatch ^/(.*)/themes/(.*)/assets/(.*)$ /var/www/imscp/gui/plugins/$1/themes/$2/assets/$3
# SECTION suexec BEGIN.
SuexecUserGroup vu2000 vu2000
# SECTION suexec END.
<Directory /var/www/imscp/gui/public/tools/webmail>
Options +FollowSymlinks
AllowOverride All
# SECTION fcgid BEGIN.
Options +ExecCGI
FCGIWrapper /var/www/fcgi/master/php5-fcgid-starter
# SECTION fcgid END.
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} -s [OR]
RewriteCond %{REQUEST_FILENAME} -l [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^.*$ - [NC,L]
RewriteRule ^.*$ plugins.php [NC,L]
Allow from all
</Directory>
<Location /ispLogos>
Allow from all
</Location>
<LocationMatch ^/themes/.*/assets/.*$>
Allow from all
</LocationMatch>
<LocationMatch ^/.*/themes/.*/assets/.*$>
Allow from all
</LocationMatch>
RewriteEngine On
RewriteRule .* https://webmail.ADMIN_DOMAIN%{REQUEST_URI} [R=301,L]
</VirtualHost>
<VirtualHost SERVER_IP:80>
ServerName ftp.ADMIN_DOMAIN
ServerAlias ftp.*
ServerAdmin ADMIN_EMAIL
DocumentRoot /var/www/imscp/gui/public/tools/filemanager
LogLevel error
ErrorLog /var/log/apache2/ADMIN_DOMAIN/error.log
Alias /errors /var/www/imscp/gui/public/errordocs
Alias /ispLogos /var/www/imscp/gui/data/persistent/ispLogos
AliasMatch ^/themes/(.*)/assets/(.*)$ /var/www/imscp/gui/themes/$1/assets/$2
AliasMatch ^/(.*)/themes/(.*)/assets/(.*)$ /var/www/imscp/gui/plugins/$1/themes/$2/assets/$3
# SECTION suexec BEGIN.
SuexecUserGroup vu2000 vu2000
# SECTION suexec END.
<Directory /var/www/imscp/gui/public/tools/filemanager>
Options +FollowSymlinks
AllowOverride All
# SECTION fcgid BEGIN.
Options +ExecCGI
FCGIWrapper /var/www/fcgi/master/php5-fcgid-starter
# SECTION fcgid END.
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} -s [OR]
RewriteCond %{REQUEST_FILENAME} -l [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^.*$ - [NC,L]
RewriteRule ^.*$ plugins.php [NC,L]
Allow from all
</Directory>
<Location /ispLogos>
Allow from all
</Location>
<LocationMatch ^/themes/.*/assets/.*$>
Allow from all
</LocationMatch>
<LocationMatch ^/.*/themes/.*/assets/.*$>
Allow from all
</LocationMatch>
RewriteEngine On
RewriteRule .* https://ftp.ADMIN_DOMAIN%{REQUEST_URI} [R=301,L]
</VirtualHost>
<VirtualHost SERVER_IP:80>
ServerName pma.ADMIN_DOMAIN
ServerAlias pma.*
ServerAdmin ADMIN_EMAIL
DocumentRoot /var/www/imscp/gui/public/tools/pma
LogLevel error
ErrorLog /var/log/apache2/ADMIN_DOMAIN/error.log
Alias /errors /var/www/imscp/gui/public/errordocs
Alias /ispLogos /var/www/imscp/gui/data/persistent/ispLogos
AliasMatch ^/themes/(.*)/assets/(.*)$ /var/www/imscp/gui/themes/$1/assets/$2
AliasMatch ^/(.*)/themes/(.*)/assets/(.*)$ /var/www/imscp/gui/plugins/$1/themes/$2/assets/$3
# SECTION suexec BEGIN.
SuexecUserGroup vu2000 vu2000
# SECTION suexec END.
<Directory /var/www/imscp/gui/public/tools/pma>
Options +FollowSymlinks
AllowOverride All
# SECTION fcgid BEGIN.
Options +ExecCGI
FCGIWrapper /var/www/fcgi/master/php5-fcgid-starter
# SECTION fcgid END.
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} -s [OR]
RewriteCond %{REQUEST_FILENAME} -l [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^.*$ - [NC,L]
RewriteRule ^.*$ plugins.php [NC,L]
Allow from all
</Directory>
<Location /ispLogos>
Allow from all
</Location>
<LocationMatch ^/themes/.*/assets/.*$>
Allow from all
</LocationMatch>
<LocationMatch ^/.*/themes/.*/assets/.*$>
Allow from all
</LocationMatch>
RewriteEngine On
RewriteRule .* https://pma.ADMIN_DOMAIN%{REQUEST_URI} [R=301,L]
</VirtualHost>