point hostname to a virtual server

Hi

people,
just wondering how i get my hostname/ip to point to one of my virtual servers?
so for example i go to: http://my.id.add.ress or http://my.host.name.tld and the browser shows a website on one of my virtual servers.

also, when i visit mydomain.tld:10000 or :20000 it says that my certificate is invalid or something. how can i make it valid?

thanks

Ash

Howdy,

For your second question – you’ll get an SSL warning for all “self-signed” SSL certificates.

The solution is, unfortunately, to buy a commercial SSL certificate for a given domain (or domains). Places like GoDaddy offer them for $25 or so a year.

For your first question – are you saying that when you browse to your.hostname.com, it shows a website, but not the one you want?

If that’s what you mean – you may want to make sure you add your hostname as an Alias Server (in Create Virtual Server -> Alias of …).

You would make it an alias of the actual Virtual Server you wish to display.

-Eric

Hi Eric
Thanks for the advice.

I never noticed the ‘alias of…’ link on the create server section! :slight_smile:

would i be able to run the control panels and webmail interfaces through non-https urls?

thanks

Ash

“would i be able to run the control panels and webmail interfaces through non-https urls?”

Sure!

You can also keep your doors unlocked at night :wink:

No, I mean, it all comes down to how concerned you are about someone sniffing your password, and what you stand to loose if someone does.

Not using SSL means it’s now possible to sniff your password – how likely is it that someone would? I dunno :slight_smile:

But, it is certainly possible to not use any SSL for webmail and the control panel.

-Eric

hey that’s the first time I heard this solution If that’s what you mean – you may want to make sure you add your hostname as an Alias Server (in Create Virtual Server -> Alias of …).

Isn’t it preferred to move up your favourite default website in the httpd.conf, so that < virtualhost > container is the first to be read by Apache?

Hey Ronald,

Well, a couple of things here:

  1. Sometimes, I just haven’t had enough coffee to be making suggestions. I don’t always make sense, and it’s good to call me on it if I don’t :slight_smile:

  2. In this case, Ashley is running Ubuntu with Virtualmin GPL. Ubuntu keeps it’s VirtualHost sections in separate files, rather than in one big one like CentOS. So it’s harder to move them around. Virtualmin Pro offers the ability to set a default (and does some hackery with the file names to make this work) – but that’s not available in the GPL version.

With that in mind, if what Ashley was concerned about was just this one domain, I was thinking it might be simplest to set it up as an alias.

Another way to accomplish it would be to edit the 000-default VirtualHost Ubuntu sets up, and have that redirect to the preferred site.

There may be others ways as well – some of those are better than the above! Any suggestions?

Thanks!

-Eric

hehe that just about sums it up. The only thought I had with the legitimate alternative (the alias makes absolutely sense) was that it wouldn’t work if you want to reach that particular site by the IP. :wink:

Thanks for the advice on this!

I just wanted it so that if any managed to visit my IP or hostname, it would show them a default site instead of the default apache “It works!” page.

Thanks again

Ashley

There may be others ways as well – some of those are better than the above! Any suggestions?
I have 1 alternative and that is to place a index.php in the /var/www/html and that php file should have

<?php
header(“Location: http://www.websiteofmychoice.com/”);
exit;
?>