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 want to make my apache 2 development server public to the internet, it is a Django based website.

Here is my apache2 config:

<VirtualHost *:80>
Alias /media /home/user/myproject/statics
Alias /admin_media  /home/myuser/django/Django-1.1.1/django/contrib/admin/media

WSGIScriptAlias / /home/myuser/myproject/myproject_wsgi.py
WSGIDaemonProcess myproject user=myuser group=myuser threads=25
WSGIProcessGroup myproject
</VirtualHost>

When I do netstat -lntup

I get:

Proto Recv-Q Send-Q Local Address           Foreign Address         State       PID/Program name
tcp        0      0 127.0.0.1:3306          0.0.0.0:*               LISTEN      -               
tcp        0      0 0.0.0.0:22              0.0.0.0:*               LISTEN      -               
tcp        0      0 127.0.0.1:631           0.0.0.0:*               LISTEN      -               
tcp6       0      0 :::80                   :::*                    LISTEN      -               
tcp6       0      0 :::22                   :::*                    LISTEN      -               
tcp6       0      0 ::1:631                 :::*                    LISTEN      -               
udp        0      0 0.0.0.0:5353            0.0.0.0:*                           -               
udp        0      0 0.0.0.0:38582           0.0.0.0:*    

I connect with ADSL thus I am behind a router. For this I have made my computer DMZ enabled to my machine.

What can be the problem? When I try to login with my ip, I get my routers config page, when a friend tries to connect to me from internet, he gets "not authorized".

share|improve this question
    
As your behind the router, you'll need to use localhost Your friend will need to use your-public-ip-address Your Router or ISP may be preventing access from the outside. –  GruffTech Mar 18 '10 at 21:08

1 Answer 1

You need to use your router config to do port forwarding of port 80. Not all routers support port forwarding though.

Also, one IP (your public IP) can't share a single port. Port 80 is in use by the router's own web server (which is handling the router config interface). You may need to forward a non-standard port like 8080 from your router to your Apache server's port 80. In that case, your friend would use http://your-public-ip:8080/

Third, ensure Apache is configured to work on port 80 over IPv4. According to your netstat output, it's only binding to IPv6 on port 80 right now.

To test things, first you should test locally on the Apache server that http://127.0.0.1/ works. Once that is working, you can add the port forwarding for external access.

share|improve this answer

Your Answer

 
discard

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