Im pulling my hair out with Apache2 on Ubuntu 18.04.
I have a couple of domains that point to Vhosts, they seem to work but for some reasons when browsing to the IP directly, if just forwards to one of the vhosts and not the root of the /var/www/html directory.. What is going on? This works on Centos but not on Ubuntu.
<VirtualHost *:80>
ServerAdmin webmaster@localhost
DocumentRoot /var/www/html
<Directory /var/www/html/>
Options Indexes FollowSymLinks
AllowOverride All
Require all granted
</Directory>
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
<IfModule mod_dir.c>
DirectoryIndex index.php index.pl index.cgi index.html index.xhtml index.htm
</IfModule>
</VirtualHost>
<VirtualHost *:80>
ServerAdmin webmaster@localhost
ServerName domain.com
ServerAlias domain.com
DocumentRoot /var/www/html/domain.com/
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>