Route server IP to a specific folder.

3 posts / 0 new
Last post
#1 Sun, 06/01/2014 - 10:10
IgnisDraconis

Route server IP to a specific folder.

Hello!

I am currently running two websites on a vserver. As an example:

www.alpha.com (/home/alpha/htdir) & www.beta.com (/home/beta/htdir)

My server IP is 1.2.3.4

Now, when someones accesses my IP he is redirected to /home/alpha/htdir which belongs to www.alpha.com

But I'd like the server ip to redirect to /home/alpha/htdir/index.html which will be a blank page. In short I don't want the IP to route to any specific site.

Is there a way to do this via virtualmin? Or would I have to edit the apache web config?

Best regards,

Ignis

Mon, 06/02/2014 - 13:09
andreychek

Howdy,

Whenever Apache receives a request a for a domain or IP address that it isn't configured to handle, it will deliver he "Default" website.

That's what you're running into now -- it sounds like the "alpha" website is the default, and Apache is sending it when someone connects to your server via the IP address.

What you may want to do is setup a new Virtual Server to act as the "Default".

And then, you can configure which Virtual Server is the default by going into Server Configuration -> Website Options, and setting "Default website for IP address" to "Yes" for that particular domain.

Then, when connecting to your server by IP address, that website is what folks will see.

-Eric

Tue, 06/03/2014 - 06:49 (Reply to #2)
IgnisDraconis

Thanks a bunch mate! That helped!

Topic locked