Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

i am developing a website and need to share progress with other stakeholders.

Is it Possible to view my apache server (local host) from home or remote computer that is outside my LAN?

share|improve this question
    
You can do that with Burrow.io. Burrow lets you host websites at home by just running a command. It accepts HTTP and HTTPS. The free account lets you create 1 tunnel using HTTP. Try it out! –  Paulo Arruda 2 days ago

4 Answers 4

localhost is an internal interface that is not available to the rest of the world.

You have two options. One is to reconfigure your webserver to listen on port 80 of your external interface. The other option is to forward TCP traffic from external port 80 to localhost.

You're going to want some kind of access restriction, regardless of which method you pick.

share|improve this answer

Where is this LAN that the web server resides on? If it is at your home then you can configure your personal soho router to forward all requests for incoming http(80) to a specific IP address on the local LAN. This is achieved via the administrative web interface of the router in most instances accessible via the gateway IP of the device. You will want to make sure apache is configured to listen on the computers LAN IP and not just the loopback interface:

netstat -ntlp

That will list which services are listening on which IP:port. You may need to modify apache's listen directive like so:

Listen 0.0.0.0:80

And verify iptables is configured to accept traffic destined to port 80.

If the server is setting on an internal network where you do not have access or permission to modify the router...then you should not attempt to make that server available publicly. It would most likely be against company policy if you could get it to work.

Also, instead of giving out your home IP address to everyone (since it's going to change/expire at some point) you can instead give out a dyndns address. See dyndns.org

If this wasn't what your looking for then please give additional detail in your question.

share|improve this answer

After setting up apache server and allowing your router to allow port forwarding to your http port on your machine (assuming home) . I would suggest you setup static ip for your home machine and dyndns account on your router which help your clients look that you have web hosting in place.

The best option would be after the above setup or in case you have a remote server is to use "Basic HTTP Authentication" so that only specific users who have logins can see your page.

# cat .htaccess # the directory which you want to protect.  
AuthType Basic
AuthName "Beta users only"
AuthUserFile /abs/path/to/passwd/file
Require valid-user 

Check out htpasswd command to populate the usernames and passwords to /abs/path/to/passwd/file

share|improve this answer

To encourage upgrading to higher-end packages and to discourage heavy use of upstream traffic on lower-end packages, ISPs generally filter the most common Internet server ports. So the first thing you will want to do is to change the port that Apache is listening on. Anything above port 1024 is generally a safe bet. Alternatively, you can contact your ISP to find out how much money they want to unblock the traffic.

Listen 8080
<VirtualHost *:8080>
  # ...
</VirtualHost>

Second, assuming that you are using a Masquerading NAT router (if you have a router, just assume that it is), you will need to forward the same port to your server.

Third, if your Internet connection has a dynamic IP address, you'll want a domain name that updates to go along with it. DynDNS (dyndns.com) is probably the best known and trusted provider for this kind of solution.

At the end of your setup, somebody should be able to visit your website by specifying the full URL. The "http" will likely be necessary to force browsers to not try to use other protocols and the port must be specified, even with use of a domain name.

Examples:

  • http://<domain or ip>:<port»/
  • http://256.256.256.256:8080/
  • http://example.com:8080/
share|improve this answer

Your Answer

 
discard

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