Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

Installed apache 2 in my Ubuntu server and I use many web application like osc, glpi.

To browse these applications I have to write @ip/glpi in browser. my purpose is to use servername instead of ip address.

What is the way to do this action

System info:

Ubuntu 11.10

PHP 5.3.6

Apache 2.2.20

MySQL 5.1.67

share|improve this question
    
If you're using this in a local environment, the 2. way of Dave's answer is the simplest to go. –  Alan Mar 15 '13 at 14:51

1 Answer 1

You need to provide a hostname for the server host.

Typically you can do this one of three ways:

1 Through a DNS Zone

If you have control of the DNS server for your LAN (assuming you only want external access; or control of a domain/zone DNS server for wider Internet access) you can add a host (A) record pointing a given name to the IP address.

2 Through Locally-Defined Hosts

On any machine you wish to access you can add a line to the HOSTS file (this is usually /etc/hosts under Linux, somewhere else under Windows and other OS) which itself has a mapping from a name to the IP.

The downside of the second method is you need to do it on every machine you want to access from and also, should the IP change, you need to change it in every hosts file.

3 Use a Dynamic DNS / No IP Service

There are a number of services (free and paid) that allow you to create and manage DNS records. You can use an account on these to set a hostname to resolve to the IP address of your server.

Anywhere online you would then connect to myhostname.myservice and it would resolve to the IP, which could be an external IP or a local IP as you choose.

share|improve this answer
    
I think OpenDNS reports a hijack attempt if a domain name points towards a local IP... -.- –  JamesTheAwesomeDude Mar 15 '13 at 15:07
    
I think dyndns is ok with it though - user will just have to try different services. –  Dave C Mar 15 '13 at 15:08
    
Lol, OpenDNS is a DNS server, not a domain registrar! For domains, I actually prefer .tk, they're top-level, but also free. :) Good for small personal servers and stuff. –  JamesTheAwesomeDude Mar 15 '13 at 15:16
    
Whoops! Just have to hope you're not using OpenDNS if you point to an internal then. –  Dave C Mar 15 '13 at 15:18

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.