Page 1 of 2 12 LastLast
Results 1 to 10 of 11

Thread: Create a website name for my IP address

  1. #1
    Join Date
    Mar 2010
    Beans
    5

    Exclamation Create a website name for my IP address

    Hi,
    I have 10 systems working on LAN with fixed IP given to all the 10. I have ubuntu installed. "ifconfig" shows my IP on eth0 interface.

    Query : I've my blog at /var/www with Apache installed and it works fine when i give the IP address of eth0 (Not 127.0.0.1). And it works from any system when i give the IP address.
    * How can i change the IP address to a simple URL. Eg: Instead of http://173.xxx.xxx.xxx to http://mysite

    I've tried:

    1) Adding entry to hosts & configuring httpd.conf in apache. Did not work.
    2) I don't want any bind, as it should be accesible only within the LAN.

    Experts of Ubuntu Forums, here goes your question..

  2. #2
    Join Date
    Mar 2008
    Location
    Las Vegas
    Beans
    1,148

    Re: Create a website name for my IP address

    Quote Originally Posted by venkatraghavang View Post
    Hi,
    I have 10 systems working on LAN with fixed IP given to all the 10. I have ubuntu installed. "ifconfig" shows my IP on eth0 interface.

    Query : I've my blog at /var/www with Apache installed and it works fine when i give the IP address of eth0 (Not 127.0.0.1). And it works from any system when i give the IP address.
    * How can i change the IP address to a simple URL. Eg: Instead of http://173.xxx.xxx.xxx to http://mysite

    I've tried:

    1) Adding entry to hosts & configuring httpd.conf in apache. Did not work.
    2) I don't want any bind, as it should be accesible only within the LAN.

    Experts of Ubuntu Forums, here goes your question..
    /etc/hosts
    Code:
    # IPaddress    HostName    Alias
    127.0.1.1    www.mysite.whatever
    /etc/resolv.conf
    Code:
    search localhost
    You'll also need to have apache setup for www.mysite.whatever

    In /etc/apache2 you've got two sub dir.'s, sites-available and sites-enabled. For my page I've got the following file for my no-ip.com site in /etc/apache2/sites-available/www.mysite.whatever
    Code:
    <VirtualHost *:45826>  # 45826 is my port that no-ip will redirect to, you'll use port 80 for http.
        ServerName www.mysite.whatever
        ServerAdmin barrie@localhost
        DocumentRoot /var/www
        <Directory />
            Options FollowSymLinks
            AllowOverride None
        </Directory>
        <Directory /var/www/>
            Options Indexes FollowSymLinks MultiViews
            AllowOverride None
            Order allow,deny
            allow from all
        </Directory>
    
        ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
        <Directory "/usr/lib/cgi-bin">
            AllowOverride None
            Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
            Order allow,deny
            Allow from all
        </Directory>
    
        ErrorLog /var/log/apache2/error.log
    
        # Possible values include: debug, info, notice, warn, error, crit,
        # alert, emerg.
        LogLevel warn
    
        CustomLog /var/log/apache2/access.log combined
        ServerSignature On
    
        Alias /doc/ "/usr/share/doc/"
        <Directory "/usr/share/doc/">
            Options Indexes MultiViews FollowSymLinks
            AllowOverride None
            Order deny,allow
            Deny from all
            Allow from 127.0.0.0/255.0.0.0 ::1/128
        </Directory>
    
    </VirtualHost>
    In /etc/apache2/sites-enabled you then have a symlink of the above file except ending with .conf You can use a2ensite to enable a site in /etc/apache2/sites-available and a2dissite to disable sites. Once I get going on the keyboard I create the links myself.
    Last edited by Barriehie; March 13th, 2010 at 03:33 AM. Reason: More Info...
    Debian Stable
    FluxBox
    Mark Your Thread Solved

  3. #3
    Join Date
    Mar 2010
    Beans
    5

    Re: Create a website name for my IP address

    Barriehe,
    Thanks for your post. I've tried this. The point which i notes is even if i remove all the hosts(and even the file), my apache2 works. I've my company site redirection when i type the IP 127.0.1.1. And it works even after hosts removal.

    It still returns "DnsServer returned : Domain name does not exist". What could be the reason?? Could you please help me ??

  4. #4
    Join Date
    Apr 2008
    Location
    Columbia, SC
    Beans
    282

    Re: Create a website name for my IP address

    You would have to create the fake domain in the hosts file of EVERY machine within the LAN, in order to have it work by editing host files. There is no one file that you can edit on the Apache server to make all hosts on the LAN resolve an URL.

  5. #5
    Join Date
    Mar 2010
    Beans
    5

    Re: Create a website name for my IP address

    Hi,
    Thanks for your response. I've seen it working up in my previous office. I'll reiterate my query again..

    My Ethernet IP : 172.34.12.22
    I have my default site at var/www/ and it works from all the 10 systems. (If i open the browser and enter as http://172.34.12.22/ )

    However, my point is to just add a domain name to that IP address. Any settings which will make:
    172.24.12.22 = sitename. So that all 10 systems can access like http://mysitename/

    There is no point of accessing Internet or getting new domain. Just giving a domain name to my IP.

    Any other ways?

  6. #6
    Join Date
    Jun 2007
    Location
    Porirua, New Zealand
    Beans
    Hidden!
    Distro
    Ubuntu

    Re: Create a website name for my IP address

    Quote Originally Posted by venkatraghavang View Post
    Hi,
    Thanks for your response. I've seen it working up in my previous office. I'll reiterate my query again..

    My Ethernet IP : 172.34.12.22
    I have my default site at var/www/ and it works from all the 10 systems. (If i open the browser and enter as http://172.34.12.22/ )

    However, my point is to just add a domain name to that IP address. Any settings which will make:
    172.24.12.22 = sitename. So that all 10 systems can access like http://mysitename/

    There is no point of accessing Internet or getting new domain. Just giving a domain name to my IP.

    Any other ways?
    If you don't mind your web site being available for public access, you could set up a name at somewhere like www.noip.com or www.dyndns.com and set up forwarding of port 80 on your router to your main machine where apache is running.
    Forum DOs and DON'Ts
    Never assume that information you find using a search engine is up-to-date.

  7. #7
    Join Date
    Apr 2008
    Location
    Columbia, SC
    Beans
    282

    Re: Create a website name for my IP address

    Quote Originally Posted by venkatraghavang View Post
    Hi,
    Thanks for your response. I've seen it working up in my previous office. I'll reiterate my query again..
    And I'll reiterate the answer again: there is no way to do this by editing a file on the Apache server. In order to get all machines on your LAN to resolve a hostname to that IP address, you either have to edit the host file on each machine separately, or you have to set up a local DNS server (and make sure all machines on the LAN actually use that DNS server). Period. No ifs, ands, or buts.

  8. #8
    Join Date
    Mar 2010
    Beans
    5

    Re: Create a website name for my IP address

    Lisati,
    Isn't there any other way to solve my issue?? I don't want to make public as i plan to make an internal website for just these 10 systems. I hope there'll be someone out here who faced similar issue..

  9. #9
    Join Date
    Mar 2010
    Beans
    5

    Re: Create a website name for my IP address

    Jrssysystem,

    Thanks for that.. I guess i'm finding a way.. Can you point out a URL for setting up a DNS server locally??

  10. #10
    Join Date
    Aug 2006
    Location
    The Zoo
    Beans
    150
    Distro
    Ubuntu 10.04 Lucid Lynx

    Re: Create a website name for my IP address

    It's pretty simple to edit the hosts file for all the computers on your LAN...

Page 1 of 2 12 LastLast

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
  •