Jump to content

How to connect to apache using server names from local computers?


Recommended Posts

Hi, I have Apache 2 setup on one of my computer and it has a whole bunch of virtual sites configured for it. I can connect to those from the machine Apache is installed on with both IP address and server names. I tried using a laptop to connect to one of my sites using an IP address and it served up the first one listed in the virtual host. My question is how can I select  which site to load up from the laptop like I do on my apache computer. I tried using the servername (testserver.local, etc...), but it can't connect to them, it only allows my to use my machines IP address and then server the first site. Any help is appreciated, thanks.

You need to edit your hosts file unless you want to setup a local dns server. On linux you'll find it within /etc/hosts, windows, I'm not sure. Just search for it. It should be commented with some examples but something like....

 

# ip of apache server                     domain name
192.168.10.3                                   foo.com
192.168.10.3                                   bar.com

 

should suffice. You need to do this on the client machines.

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.