vhosts don't work on localhost

6 posts / 0 new
Last post
#1 Thu, 11/06/2008 - 23:21
prowler666

vhosts don't work on localhost

Hi, I'm using OpenSuse 11.

I was just using Virtualmin to create a vhost named "local-magento". Creation went fine, but I'd like to adress it my browser via localhost.local-magento.de.

It doesn't work of course, but I don't know why. I just want to use the new domain locally only, so it's not a productive server.

Adressing the domain by 192.0.0.2 for example works well.

So how can I adress the domain by name?

Hope you understand what my problem is ...

Sun, 06/07/2009 - 07:31
ronald
ronald's picture

you can try to edit your hosts file on the computer you use for browsing assuming you have the domain on a separate computer/server behind a router
assuming you browse on a winxp computer go to: [code:1]C:\WINDOWS\system32\drivers\etc[/code:1] and edit hosts file to add

192.0.0.2 local-magento.de
192.0.0.2 www.local-magento.de

Fri, 11/07/2008 - 09:19
prowler666

Well, I'm a web-developer who formely developed under Windows XP and XAMPP.

What I'd like to have is the possibility to write "http://localhost.local-magento" into my browser and getting displayed the virtual host which is on my own computer.

There must be an option in Virtualmin. Or if not, where is the host-file located in OpenSuse 11? And do I need reboot?

Fri, 11/07/2008 - 09:34 (Reply to #3)
andreychek

Well, first off, remember that Virtualmin sets up the DNS for any Virtual Server it creates by default.

So whatever domains you've added should be accessible (exactly as you added them), so long as you're using the DNS servers that Virtualmin is modifying.

Now, as Ronald said, if you're trying to access them using a different or shorter name -- such as "localhost.local-magento" -- you can add that into /etc/hosts using the format he specified above.

And no, you wouldn't need to reboot.

Have a good one,
-Eric

Fri, 11/07/2008 - 15:12 (Reply to #4)
sgrayban

_all_ *nix distros use the hosts files located at /etc/hosts the follow what Ronald wrote to add the host(s)

Sun, 11/09/2008 - 23:16
prowler666

Thank you very much, that did the trick!

Topic locked