Glam Prestige Journal

Bright entertainment trends with youth appeal.

I am new to apache2. I have an ubuntu 12.04.4 LTS machine in my home, and just installed apache2 on it. I wanted to set up a webserver running on a port other than port 80 (my router uses port 80). Here's what I did:

  1. Changed some lines at the beginning of /etc/apache2/ports.conf from

    NameVirtualHost *:80
    Listen 80

    to

    NameVirtualHost *:8041
    Listen 8041
  2. Changed the first line of /etc/apache2/sites-available/default from

    <VirtualHost *:80>

    to

    <VirtualHost *:8041>
  3. Restarted apache2

My ubuntu machine has local IP address 192.168.1.133, and from any computer on my home intranet if I point a web browser to then I get the standard apache2 "It works!" web page. I also set up my router to port forward any incoming TCP packets on port 8041 to the ubuntu machine (still on port 8041).

Let's say my ISP has given me the IP address 123.456.78.90. If I am outside my intranet and I point a web browser to then again it works.

However, within my intranet (on the ubuntu machine itself or on other machines on the intranet), when I point a web browser to I get an "unable to connect" error.

Where do I go from here? I am now unclear about whether this is an issue with my apache set-up or my router. I have now unfortunately realised though that it is probably not a question about Ubuntu :-/

4

1 Answer

The issue above is actually expected behaviour. I need to upgrade my router to one that supports "loopback NAT" a.k.a. "hairpin nat". See here for example.

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy