Results 1 to 6 of 6

Thread: connect to web page on local intranet

  1. #1
    Join Date
    Feb 2007
    Location
    /home/paris
    Beans
    690
    Distro
    Lubuntu 12.10 Quantal Quetzal

    connect to web page on local intranet

    Hi all.

    I feel really silly, but I've recently discovered that I can no longer navigate to web pages on my local intranet.

    I have installed some drupal sites on my local pc.

    I have set up apache with virtual hosts for the names of the drupal sites, and put the site names into a hosts file on the local machine

    everything seems to work with the exception of trying to access the various sites via the use of the ip address.

    for instance I have the following sites.

    www.myhomepages.info
    www.homewiki.info

    and they work fine by putting those names into the browser on the same machine as the web server. so I'm happy at this.

    if however I try to navigate to
    127.0.0.1 : I just get the basic apache response of 'it works' which is fine.
    If use my public IP address, or my local ip addres (192.168.0.11) i just get a of Not Found
    <quote>
    The requested URL / was not found on this server.
    Apache/2.2.22 (Ubuntu) Server at 192.168.0.11 Port 80
    </quote>

    the server must be running as the message for apache 2.2.22 is correct. I get the same response from the public ip, so my port forwarding must be working OK.

    The strange thing is that this was working a few weeks ago. so I must have put in a config with the new sites I've added, and broken everything else?

    My question is how do I get it all back, and how would I navigate the new sites I have created using the ip address.

    Thanks in advance for your support.

    David
    Eee pc via Wubi install.
    evertying works straight out of the box

    My Launchpad page

  2. #2
    Join Date
    Mar 2010
    Location
    Squidbilly-Land
    Beans
    Hidden!
    Distro
    Ubuntu

    Re: connect to web page on local intranet

    Virtualhosts work based on the name, not the IP. Only the default files will be served from the IP address. If you want to visit different websites using only an IP address, then ... er ... create more IPs?

  3. #3
    Join Date
    Feb 2007
    Location
    /home/paris
    Beans
    690
    Distro
    Lubuntu 12.10 Quantal Quetzal

    Re: connect to web page on local intranet

    so what you are saying is that I have to set up a local DNS.

    I was hoping I would be able to avoid that

    Eee pc via Wubi install.
    evertying works straight out of the box

    My Launchpad page

  4. #4
    Join Date
    Nov 2008
    Location
    Boston MetroWest
    Beans
    16,326

    Re: connect to web page on local intranet

    You could still use a hosts file, but you'll need to assign multiple addresses to your server's Ethernet interface. You can do this in /etc/network/interfaces as discussed here.

    Suppose you assign 192.168.1.1 to eth0 and 192.168.1.2 to eth0:0, the first virtual adapter. In Apache you would include separate <VirtualHost> definitions, one for each IP/ServerName combination:
    Code:
    <VirtualHost 192.168.1.1:80>
    ServerName www.domain1.com
    DocumentRoot /path/to/some/location
    [etc.]
    </VirtualHost>
    
    <VirtualHost 192.168.1.2:80>
    ServerName www.domain2.com
    [etc.]
    </VirtualHost>
    Just make sure your /etc/hosts files map www.domain1.com to 192.168.1.1 and www.domain2.com to 192.168.1.2.

    Notice that these declarations use the full "IP:80" specification in the <VirtualHost> directive, not the "*:80" that is used for name-based virtual hosting.
    Last edited by SeijiSensei; June 20th, 2014 at 09:24 PM.
    If you ask for help, do not abandon your request. Please have the courtesy to check for responses and thank the people who helped you.

    Blog · Linode System Administration Guides · Android Apps for Ubuntu Users

  5. #5
    Join Date
    Feb 2007
    Location
    /home/paris
    Beans
    690
    Distro
    Lubuntu 12.10 Quantal Quetzal

    Re: connect to web page on local intranet

    @ SeijiSensei

    I didn't know that was how it was done !

    however I think that setting up a DNS will be a good experience for me anyhow.

    So I'll probably do both.

    Thanks for the links.

    Dave
    Eee pc via Wubi install.
    evertying works straight out of the box

    My Launchpad page

  6. #6
    Join Date
    Mar 2010
    Location
    Squidbilly-Land
    Beans
    Hidden!
    Distro
    Ubuntu

    Re: connect to web page on local intranet

    Please don't make your DNS public. I've been hacked ... thru DNS. Please learn from my mistake.

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •