Hi,

Like everyone, I access my apache server by typing http://localhost or http://127.0.0.1 but what I want is that I want to access it from outside by typing a domain name like http://my.domain.com

I've added my current IP information for you.

This is what I need. I'll be much appreciated your help. Thanks in advance

ubuntu@ubuntu:~$ ifconfig | grep inet
          inet addr:192.168.100.158  Bcast:192.168.100.255  Mask:255.255.255.0
          inet6 addr: fe80::230:5ff:feec:bbb2/64 Scope:Link
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host

Recommended Answers

All 8 Replies

Hi,

Like everyone, I access my apache server by typing http://localhost or http://127.0.0.1 but what I want is that I want to access it from outside by typing a domain name like http://my.domain.com

I've added my current IP information for you.

This is what I need. I'll be much appreciated your help. Thanks in advance

ubuntu@ubuntu:~$ ifconfig | grep inet
          inet addr:192.168.100.158  Bcast:192.168.100.255  Mask:255.255.255.0
          inet6 addr: fe80::230:5ff:feec:bbb2/64 Scope:Link
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host

Check out https://www.dyndns.com. this enables you to point a web address like http://yourname.domainname.com to your computer. hold on... you will not be able to access the webpage hosted at your localhost yet. if you have a dynamic ip address which will be assigned to you by the ISP then the modem/router has to configured to work with dyndns.com so that each time your IP address is changed it will reflect in the dynDNS. next is to port forward the requests to the port 80 of your computer. inbound requests form the internet will reach the modem/router at 192.168.1.1:80 these requests should be forwarded to inet addr:192.168.100.158 port:80. follow the router manufacturers guide to open the ports. sometimes you may have to open the ports in the firewall too.

Can I not do this without using websites like you've pointed out?

i'm afraid you cannot.

I guess you could put your my.domain.com in your /etc/hosts file, but that would only work on the computers where you put this. Not from anywhere else.

I am just mentioning this in case you have not done so but you would also need to register your domain name with a registrar like godaddy or networksolutions or one of the many other registrars so your domainname belongs to you and cannot be redirected somewhere else.

Ok, you got my mind opened now.

I've just bought a domain name and have set up my Ubuntu Desktop 10.10 with LAMP runing on it. What do I do in order to use my localy hosted project stored in /var/www/myproject when I type my domain anywhere in the world?

Guys thanks in advance

Hello,

First you have to figure out what the IP address of your router is and/or what the internet sees your address as. Go to one of the reporting pages like http://whatismyipaddress.com to find out. Once you have that address (which may change if your router is using DHCP on the WAN) go to your registrar and point your domain to that IP address. OR use the site that rje7 listed (which is really the way to go) and follow the instructions on setting up the registrar information.

Check on your router and make sure that you either allow port 80 through to the internal IP address of your Ubuntu server or many routers have an option for setting up a DMZ host IP which again would be the server IP (192.168.100.158).

Then call a friend and have them ping (or use nslookup ) your domain name

ping <yourdomainname.com>     pings your domain
nslookup <yourdomainname.com>     asks your local DNS for the info
nslookup <yourdomainname.com> <specificnameserver.com>     asks the specific nameserver for the info

and see what they get. Remember it can take 24 hours for DNS information to update accross the net. ping or nslookup will work from either Windows command prompt or Linux shell.

Thanks rch. I'll do that when I get back from hoiday.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.