SYSTEM INFORMATION | |
---|---|
OS type and version: | ubuntu 20.04 server |
Webmin version: | 1.981 |
Virtualmin version: | 6.16 |
Related products version: | apache 2.4.41 |
http and https requests to domain1.tld work as intended.
https requests to domain2.tld work as intended. http requests return domain1.tld’s site.
/etc/apache2/sites-available/domain1.tld.conf:
<VirtualHost 1.2.3.4:80>
SuexecUserGroup "#1010" "#1005"
ServerName domain1.tld
ServerAlias www.domain1.tld
ServerAlias autoconfig.domain1.tld
ServerAlias autodiscover.domain1.tld
DocumentRoot /home/domain1.tld/public_html
ErrorLog /var/log/virtualmin/domain1.tld_error_log
CustomLog /var/log/virtualmin/domain1.tld_access_log combined
ScriptAlias /cgi-bin/ /home/domain1.tld/cgi-bin/
ScriptAlias /awstats/ /home/domain1.tld/cgi-bin/
ScriptAlias /AutoDiscover/AutoDiscover.xml /home/domain1.tld/cgi-bin/autoconfig.cgi
ScriptAlias /Autodiscover/Autodiscover.xml /home/domain1.tld/cgi-bin/autoconfig.cgi
ScriptAlias /autodiscover/autodiscover.xml /home/domain1.tld/cgi-bin/autoconfig.cgi
DirectoryIndex index.html index.htm index.php index.php4 index.php5
<Directory /home/domain1.tld/public_html>
Options -Indexes +IncludesNOEXEC +SymLinksIfOwnerMatch +ExecCGI
allow from all
AllowOverride All Options=ExecCGI,Includes,IncludesNOEXEC,Indexes,MultiViews,SymLinksIfOwnerMatch
Require all granted
AddType application/x-httpd-php .php
AddHandler fcgid-script .php
AddHandler fcgid-script .php7.3
AddHandler fcgid-script .php7.4
AddHandler fcgid-script .php8.0
FCGIWrapper /home/domain1.tld/fcgi-bin/php7.4.fcgi .php
FCGIWrapper /home/domain1.tld/fcgi-bin/php7.3.fcgi .php7.3
FCGIWrapper /home/domain1.tld/fcgi-bin/php7.4.fcgi .php7.4
FCGIWrapper /home/domain1.tld/fcgi-bin/php8.0.fcgi .php8.0
</Directory>
<Directory /home/domain1.tld/cgi-bin>
allow from all
AllowOverride All Options=ExecCGI,Includes,IncludesNOEXEC,Indexes,MultiViews,SymLinksIfOwnerMatch
Require all granted
</Directory>
RemoveHandler .php
RemoveHandler .php7.3
RemoveHandler .php7.4
RemoveHandler .php8.0
<Files awstats.pl>
AuthName "domain1.tld statistics"
AuthType Basic
AuthUserFile /home/domain1.tld/.awstats-htpasswd
require valid-user
</Files>
Redirect /mail/config-v1.1.xml /cgi-bin/autoconfig.cgi
Redirect /.well-known/autoconfig/mail/config-v1.1.xml /cgi-bin/autoconfig.cgi
IPCCommTimeout 31
FcgidMaxRequestLen 1073741824
</VirtualHost>
<VirtualHost 1.2.3.4:443>
SuexecUserGroup "#1010" "#1005"
ServerName domain1.tld
ServerAlias www.domain1.tld
ServerAlias autoconfig.domain1.tld
ServerAlias autodiscover.domain1.tld
DocumentRoot /home/domain1.tld/public_html
ErrorLog /var/log/virtualmin/domain1.tld_error_log
CustomLog /var/log/virtualmin/domain1.tld_access_log combined
ScriptAlias /cgi-bin/ /home/domain1.tld/cgi-bin/
ScriptAlias /awstats/ /home/domain1.tld/cgi-bin/
ScriptAlias /AutoDiscover/AutoDiscover.xml /home/domain1.tld/cgi-bin/autoconfig.cgi
ScriptAlias /Autodiscover/Autodiscover.xml /home/domain1.tld/cgi-bin/autoconfig.cgi
ScriptAlias /autodiscover/autodiscover.xml /home/domain1.tld/cgi-bin/autoconfig.cgi
DirectoryIndex index.html index.htm index.php index.php4 index.php5
<Directory /home/domain1.tld/public_html>
Options -Indexes +IncludesNOEXEC +SymLinksIfOwnerMatch +ExecCGI
allow from all
AllowOverride All Options=ExecCGI,Includes,IncludesNOEXEC,Indexes,MultiViews,SymLinksIfOwnerMatch
Require all granted
AddType application/x-httpd-php .php
AddHandler fcgid-script .php
AddHandler fcgid-script .php7.3
AddHandler fcgid-script .php7.4
AddHandler fcgid-script .php8.0
FCGIWrapper /home/domain1.tld/fcgi-bin/php7.4.fcgi .php
FCGIWrapper /home/domain1.tld/fcgi-bin/php7.3.fcgi .php7.3
FCGIWrapper /home/domain1.tld/fcgi-bin/php7.4.fcgi .php7.4
FCGIWrapper /home/domain1.tld/fcgi-bin/php8.0.fcgi .php8.0
</Directory>
<Directory /home/domain1.tld/cgi-bin>
allow from all
AllowOverride All Options=ExecCGI,Includes,IncludesNOEXEC,Indexes,MultiViews,SymLinksIfOwnerMatch
Require all granted
</Directory>
RemoveHandler .php
RemoveHandler .php7.3
RemoveHandler .php7.4
RemoveHandler .php8.0
SSLEngine on
SSLCertificateFile /home/domain1.tld/ssl.cert
SSLCertificateKeyFile /home/domain1.tld/ssl.key
SSLProtocol all -SSLv2 -SSLv3 -TLSv1 -TLSv1.1
<Files awstats.pl>
AuthName "domain1.tld statistics"
AuthType Basic
AuthUserFile /home/domain1.tld/.awstats-htpasswd
require valid-user
</Files>
Redirect /mail/config-v1.1.xml /cgi-bin/autoconfig.cgi
Redirect /.well-known/autoconfig/mail/config-v1.1.xml /cgi-bin/autoconfig.cgi
IPCCommTimeout 31
FcgidMaxRequestLen 1073741824
SSLCACertificateFile /home/domain1.tld/ssl.ca
</VirtualHost>
/etc/apache2/sites-available/domain2.tld.conf:
<VirtualHost 1.2.3.4:80>
DocumentRoot /var/www/html
ServerName domain2.tld
<Directory "/var/www/html">
allow from all
Options None
Require all granted
</Directory>
ServerAlias *.domain2.tld
ServerAdmin webmaster@localhost
ErrorLog /var/log/apache2/error.log
CustomLog /var/log/apache2/access.log combined
</VirtualHost>
<VirtualHost 1.2.3.4:443>
DocumentRoot /var/www/html
ServerName domain2.tld
<Directory "/var/www/html">
allow from all
Options None
Require all granted
</Directory>
ServerAlias *.domain2.tld
ServerAdmin webmaster@localhost
ErrorLog /var/log/apache2/error.log
CustomLog /var/log/apache2/access.log combined
SSLEngine on
SSLProtocol +TLSv1.2
SSLCertificateFile /etc/webmin/letsencrypt-cert.pem
SSLCertificateKeyFile /etc/webmin/letsencrypt-key.pem
SSLCACertificateFile /etc/webmin/letsencrypt-ca.pem
</VirtualHost>