Port 80 Redirect

Problems with the Windows version of XAMPP, questions, comments, and anything related.

Port 80 Redirect

Postby J00g3 » 26. October 2010 13:34

Hi,
I am trying to access my XAMMP from outside my network, but are not able. I think my ISP is blocking port 80, so I created an Host at no-ip, and sat it to "Port 80 Redirect". I added my IP(same as used for my other host: <name1>.zapto.org) and added port 6798.

On my local Host(Windows7), my apache is listening on port 80, I have also forwarded both port 80 and port 6798 using PFConfig.

I have also tried to dit the apache, httpd file and changed Listen to "Listen 6798" and ServerName to "ServerName <name2>.zapyo.org:6798" before restarting the server.

Any suggestions on what to do?
J00g3
 
Posts: 7
Joined: 26. October 2010 13:32

Re: Port 80 Redirect

Postby Nobbie » 26. October 2010 14:07

J00g3 wrote:I have also forwarded both port 80 and port 6798 using PFConfig.


Why that? And what is the target you forwarded the ports?
Nobbie
 
Posts: 13170
Joined: 09. March 2008 13:04

Re: Port 80 Redirect

Postby J00g3 » 26. October 2010 14:20

I have also forwarded both port 80 and port 6798 using PFConfig.

Was this a bad idea? Should I reset it?

I forwarded the ports to the private IP address, whitch is supposed to run the XAMPP/Apache...
J00g3
 
Posts: 7
Joined: 26. October 2010 13:32

Re: Port 80 Redirect

Postby Nobbie » 26. October 2010 14:31

J00g3 wrote: whitch is supposed to run the XAMPP/Apache...


Why do you think so? Do you have a LISTEN directive in your httpd.conf, which points to your private IP? You only showed us LISTEN directives which point to ports, not to IPs.

Is your PC directly connected to the Internet, so that the Public IP is assigned to that PC? Or is it running behind a router?
Nobbie
 
Posts: 13170
Joined: 09. March 2008 13:04

Re: Port 80 Redirect

Postby J00g3 » 26. October 2010 14:58

At this point my httpd.conf file looks like this:
(as you can see I have tried some other stuff as well, this is because I am not an expert and that is why I am asking for help(!))

.
.
.
# Change this to Listen on specific IP addresses as shown below to
# prevent Apache from glomming onto all bound IP addresses.
#
#Listen 0.0.0.0:80
#Listen [::]:80
#Listen *.80
Listen 80
.
.
.
# ServerName gives the name and port that the server uses to identify itself.
# This can often be determined automatically, but we recommend you specify
# it explicitly to prevent problems during startup.
#
# If your host doesn't have a registered DNS name, enter its IP address here.
#
#ServerName localhost:6798
ServerName localhost:80
#ServerName <name>.zapto.org:80
#ServerName <name>.zapto.org:6798
.
.
.



Is your PC directly connected to the Internet, so that the Public IP is assigned to that PC? Or is it running behind a router?


I am not sure about this question, but when looking at my Router interface(192.168.0.1) at the dhcp client list, I can se that my hostname is provided with a private IP. So I think it is correct to say that my PC is runing behind a router.
J00g3
 
Posts: 7
Joined: 26. October 2010 13:32

Re: Port 80 Redirect

Postby Nobbie » 26. October 2010 15:20

J00g3 wrote:Listen 80


This means, that Apache listens on ALL(!) IPs which are assigned to your PC, and it listens on Port 80 of these IPs.

J00g3 wrote:So I think it is correct to say that my PC is runing behind a router.


Probably. Even the fact you have a Router already means, that your PC is running behind that router.

That means:

Forget everything you mentioned above concerning the blocked Port 80. Forget the Port Redirects, as well the one you created on no-ip.com (redirect 80 to 6798) as the local redirect you created with the help of PFConfig. Remove them all. Also forget about Port 6798 anyway. You dont need it anymore.

Instead simply create a "normal" no-ip Domain which points to your public IP. This public IP is assigned to your Router, NOT(!) to your local Xampp PC. Therefore you have to establish a Port Forwarding on your Router, forward Port 80 to the private IP of your Xampp PC. Look into the setup menu of your Router to find the appropriate options to establish this port forwarding.

Later on (when it works basically), you should create VirtualHosts (one for localhost, the other for the no-ip Domain) to control the behaviour of Apache more sophisticated.
Nobbie
 
Posts: 13170
Joined: 09. March 2008 13:04

Re: Port 80 Redirect

Postby J00g3 » 26. October 2010 15:32

I have already tried out the setup you are describing, without success.. that is why I tried out all this other stuff, because I thought that my ISP was blocking port 80!
J00g3
 
Posts: 7
Joined: 26. October 2010 13:32

Re: Port 80 Redirect

Postby Nobbie » 26. October 2010 16:12

If your router does not offer a port forwarding, you cannot fix your problem!

What kind of router do you have? What kind of internet connection do you have (DSL or what)? What is your Public IP?
Nobbie
 
Posts: 13170
Joined: 09. March 2008 13:04

Re: Port 80 Redirect

Postby J00g3 » 26. October 2010 16:25

The router is a belkin54g, F5D7231-4. It has the option "Firewall > Virtual Servers", who seams to perform port forwaring.

The internet conection is DSL, while the public IP is:
Last edited by J00g3 on 27. October 2010 17:12, edited 1 time in total.
J00g3
 
Posts: 7
Joined: 26. October 2010 13:32

Re: Port 80 Redirect

Postby J00g3 » 27. October 2010 12:19

Ok, now my router looks like this:
apache 80 80 TCP 192.168.2.3 7896 7896
apache 7896 7896 TCP 192.168.2.3 7896 7896
(I have also used PFConfig to forward these ports, I also tried with a new port)

My apache httpd file looks like this:
.
.
.
Listen 7896
.
.
.
ServerName localhost:7896
.
.
.

When typing the command, netstat -ano
I get:
TCP 0.0.0.0.0:7896 LISTENING PID xxx

and when comparing the PID with proc in task manager, I get that apache is the proc running and listening at this port.

What else could I do to get this to work?
J00g3
 
Posts: 7
Joined: 26. October 2010 13:32

Re: Port 80 Redirect

Postby Nobbie » 27. October 2010 13:29

J00g3 wrote:Ok, now my router looks like this:
apache 80 80 TCP 192.168.2.3 7896 7896
apache 7896 7896 TCP 192.168.2.3 7896 7896


As I dont know your router, I dont know what this table means.

You should not handle with port 7896, only Port 80 is affected by Apache. Change the Listen directive to Port 80 as well. And dont use PFConfig any more!

J00g3 wrote:What else could I do to get this to work?


a) Ask your provider if incoming Port 80 is blocked, or if you may run a webserver locally.

b) Make sure that no firewall blocks Port 80.
Nobbie
 
Posts: 13170
Joined: 09. March 2008 13:04

Re: Port 80 Redirect

Postby J00g3 » 27. October 2010 17:15

Acutally, by only changing the no-ip host, I have now made it work with these settings.. I had to use PFConfig, and yes I had to make apache listen on port 7896. Sometimes it is best to just try out different stuff and trust your self :wink:
J00g3
 
Posts: 7
Joined: 26. October 2010 13:32


Return to XAMPP for Windows

Who is online

Users browsing this forum: No registered users and 126 guests