Apache2 Default Virtual Host for IP

2 posts / 0 new
Last post
#1 Fri, 11/24/2017 - 17:35
Baterka

Apache2 Default Virtual Host for IP

I am raging here more than 3 hours how to make Apache2 work for me how I want. I want when I access IP address directly, Apache2 serve me content from /var/www/html and not from virtualhost.

I tested everything including 000-default.conf file:

    <VirtualHost *>
    DocumentRoot /var/www/html\n
    </VirtualHost>

Nothing works. Apache2 (or Virtualmin) everytime use first VirtualHost in list but not my default file. Command apache2ctl -S not showing 000-default config at all, too.

How to make it works!

Tue, 12/19/2017 - 05:14
tpnsolutions
tpnsolutions's picture

Hi,

When you setup VirtualHost's to Apache, it will use the first Apache VirtualHost by design. If you want to setup an alternate "default", then create a VirtualHost for this purpose, and assign it as the default.

Best Regards,
Peter Knowles | TPN Solutions
Email: pknowles@tpnsolutions.com | Skype: tpnassist
Topic locked