Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I have successfully installed "LAMP" and can get to my web server by typing 10.0.2.15. How can I make it so that when I type in my domain name it brings up my web server?

share|improve this question
add comment

2 Answers 2

up vote 2 down vote accepted

Associate your domain name with your router's external address, and forward port 80 on your router to the server.

share|improve this answer
    
I'll give it a try!! Thanks!! –  msindle Jul 4 '10 at 7:27
2  
Note that you probably won't be able to see it from inside. Most routers don't forward internal connections. –  Ignacio Vazquez-Abrams Jul 4 '10 at 7:29
2  
Also note that after you do this, if you set your web server to use its domain name in redirects, or if you have any links that use an absolute URL with domain name, your internal clients will sometimes try to access your web server via your router's (that is, your NA[P]T gateway's) public IP address instead of 10.0.2.15. Good routers handle this well. It's called "NAT hairpinning". Bad routers don't handle it at all. There are lots of bad routers on the market. –  Spiff Jul 4 '10 at 7:32
add comment

You can buy a DNS, or follow this solution:

It's likely that your router is engaging in Network Address Translation.
In order to see the web page inside your LAN from outside of it:

You'll have to turn on port forwarding on the HTTP port that you're serving 
(80 is the default) to direct any traffic to the internal address. This
process varies from router to router, so you'll have to look at the manual 
that came with that device.

It's best to also set up a static IP address for the computer serving the 
website so that if it reboots, the port forwarding still works. This is unnecessary 
if you can port forward using the hostname (not typically supported). This also 
varies from router to router.

Direct your clients to your externally-facing IP address. If you don't have a 
reserved IP through your ISP, this might change from time-to-time, especially
 if you restart your modem, so I recommend...

(optional) Get an account at a dynamic dns host such as DynDNS to allow 
external users to see a persistent address. You'll have to install some software on
the server to periodically make sure that the IP address is correct.

Source

share|improve this answer
add comment

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.