0

I have a server which runs Ubuntu 18.04.4 LTS. I wanted to add a simple vhost, but I realize I have problem with the "default" vhost. The server has a public name, like (this is a fake number):

http://vps5555555.ovh.net/

Which is accessible by anyone. The problem is when accessing this URL, one of the website hosted by this server is displayed. It's not the "default" Apache page that is displayed:

I added :

<VirtualHost *:8080>
    # The ServerName directive sets the request scheme, hostname and port that
    # ...
    #ServerName www.example.com
    ServerName vps5555555.ovh.net
    # ...
 </VirtualHost>

But same result. I checked the Apache syntax and all seems fine:

[15:14:28] root@vps5555555:/etc/apache2/sites-enabled# apachectl configtest
Syntax OK

So I don't understand, why this default vhost doesn't work.

COil
  • 900
  • OK, I just found the bug while writing this question. Sometimes you just have to write your problem to find the solution. – COil Apr 05 '20 at 13:23

1 Answers1

0

So answering to myself as I have found the bug. It turns out that the <VirtualHost *:8080> was incorrect. It must be:

<VirtualHost *:80>

Now everything works as excepted. I've got the default home page "It Works!" for the default server URL http://vps5555555.ovh.net/ but also for other domains pointing to the server but without declared vhost yet.

COil
  • 900