Ubuntu 18.04.3, Virtualmin 6.08, Webmin 1.932
Something strange is happening.
If I have nothing in /etc/apache2/sites-enabled
then I can access the Server's Homepage: ns.server.com (/var/www/html)
and ns.server.com/phpmyadmin works fine
If I add a virtual host, or enable a site with
a2ensite domain.com (+ reload apache)
then I got 403 Forbidden when I try to access ns.server.com
and ns.server.com/phpmyadmin download the php file instead of executing it.
If I a2dissite domain.com (+ reload apache)
everything works normally again.
/etc/apache2/apache2.conf:
DefaultRuntimeDir ${APACHE_RUN_DIR}
PidFile ${APACHE_PID_FILE}
Timeout 300
KeepAlive On
MaxKeepAliveRequests 100
KeepAliveTimeout 5
User ${APACHE_RUN_USER}
Group ${APACHE_RUN_GROUP}
HostnameLookups Off
ErrorLog ${APACHE_LOG_DIR}/error.log
LogLevel warn
IncludeOptional mods-enabled/*.load
IncludeOptional mods-enabled/*.conf
Include ports.conf
<Directory />
Options FollowSymLinks
AllowOverride None
Require all denied
</Directory>
<Directory /usr/share>
AllowOverride None
Require all granted
</Directory>
<Directory /var/www/>
Options Indexes FollowSymLinks
AllowOverride None
Require all granted
</Directory>
AccessFileName .htaccess
<FilesMatch "^\.ht">
Require all denied
</FilesMatch>
LogFormat "%v:%p %h %l %u %t \"%r\" %>s %O \"%{Referer}i\" \"%{User-Agent}i\"" vhost_combined
LogFormat "%h %l %u %t \"%r\" %>s %O \"%{Referer}i\" \"%{User-Agent}i\"" combined
LogFormat "%h %l %u %t \"%r\" %>s %O" common
LogFormat "%{Referer}i -> %U" referer
LogFormat "%{User-agent}i" agent
IncludeOptional conf-enabled/*.conf
IncludeOptional sites-enabled/*.conf
SSLProtocol ALL -SSLv2 -SSLv3
SSLCipherSuite HIGH:!SSLv2:!ADH:!aNULL:!eNULL:!NULL
<IfModule php7_module>
AddType application/x-httpd-php .php
AddType application/x-httpd-php-source .phps
<IfModule dir_module>
DirectoryIndex index.html index.php
</IfModule>
</IfModule>
Can anybody help figuring out what is going on? Thanks,
UPDATE
So it seems that ns.server.com always points to the public_html of the alphabetically first site that is in /etc/apache2/sites-enabled. If I put index.html there I can access ns.server.com.
Also if I run php as Apache user in the first virtual host then ns.server.com/phpmyadmin works as well.
So there is a workaround, but it is sooooooooo strange :-o
Any ideas?