Welcome to the MacNN Forums.

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

You are here: MacNN Forums > Enthusiast Zone > Networking > Port Forwarding

Port Forwarding
Thread Tools
cbk1994
Forum Regular
Join Date: Dec 2005
Status: Offline
Reply With Quote
Jan 1, 2008, 10:27 PM
 
I'm having some port forwarding problems.

Basically, my setup is a SpeedStream router (4200), and a Linksys WRT54G wireless router. The speedstream is a modem, and that's all I want it to be. I recently got a new ISP, and they gave me a fancy modem with a router built in. Well, I don't want that. I want a modem. I can't figure out any way to port forward at all. From the speedstream, I tried port forwarding to the linksys router's IP address, the IP address of my computer, but none of it works.

Can you please give suggestions? Thanks!
15" MacBook Pro (unibody), 4 GB RAM, 2.53 GHz Intel Core 2 Duo, Mac OS X 10.6.2
     
besson3c
Clinically Insane
Join Date: Mar 2001
Location: yes
Status: Offline
Reply With Quote
Jan 1, 2008, 10:38 PM
 
Unless you can disable DHCP on the Speedstream, you don't want to have two routers competing with each other to assign IP addresses. Port forwarding is for specific network services, not for allowing two routers to co-exist with the same uplink.
     
cbk1994  (op)
Forum Regular
Join Date: Dec 2005
Status: Offline
Reply With Quote
Jan 1, 2008, 11:22 PM
 
Well, I disabled DHCP on the Speedstream router, but it didn't fix it.

It appears my ISP is blocking port 80.

I'm trying to get Apache to listen on port 8080 to no avail. This is what I have in the config file.

# Listen: Allows you to bind Apache to specific IP addresses and/or
# ports, instead of the default. See also the <VirtualHost>
# directive.
#
#Listen 3000
#Listen 12.34.56.78:80
#Listen 80
Listen 8080


Help please? going to localhost works, but not localhost:8080 (for some reason it replaced the links with a link to the web site here, so they are no longer links ... )
15" MacBook Pro (unibody), 4 GB RAM, 2.53 GHz Intel Core 2 Duo, Mac OS X 10.6.2
     
besson3c
Clinically Insane
Join Date: Mar 2001
Location: yes
Status: Offline
Reply With Quote
Jan 1, 2008, 11:31 PM
 
I'm completely confused as to how getting two routers to coexist has become getting Apache to listen on port 8080 on your local Mac. Is this a separate issue? If not, why would you expect that going to localhost would take you to your router's web admin pages?
     
cbk1994  (op)
Forum Regular
Join Date: Dec 2005
Status: Offline
Reply With Quote
Jan 1, 2008, 11:56 PM
 
Sorry, I confused you ... hehe.

Separate issue, the problem was that my ISP is blocking port 80, so I need to use port 8080 to host my web server.

I don't expect localhost to take me to my router's web admin page, that would be 192.168.1.1 or 192.168.254.254. If I type in localhost in my browser I get the "Apache is correctly set up ..." page, and if I go to localhost:8080 in my browser, I get an error (cannot find server).

I want to make Apache listen on port 8080, yet for some reason I cannot.
15" MacBook Pro (unibody), 4 GB RAM, 2.53 GHz Intel Core 2 Duo, Mac OS X 10.6.2
     
besson3c
Clinically Insane
Join Date: Mar 2001
Location: yes
Status: Offline
Reply With Quote
Jan 2, 2008, 12:34 AM
 
Do you have port 8080 open in your system firewall? What happens when you type in:

telnet localhost 8080

What is your Apache ServerName set to?
     
cbk1994  (op)
Forum Regular
Join Date: Dec 2005
Status: Offline
Reply With Quote
Jan 2, 2008, 12:38 AM
 
Originally Posted by besson3c View Post
Do you have port 8080 open in your system firewall? What happens when you type in:

telnet localhost 8080

What is your Apache ServerName set to?
When I type in telnet localhost 8080, this is what I get.

chrishamma:~ Home$ telnet localhost 8080
Trying ::1...
telnet: connect to address ::1: Connection refused
Trying ::1...
telnet: connect to address ::1: Connection refused
Trying 127.0.0.1...
telnet: connect to address 127.0.0.1: Connection refused
telnet: Unable to connect to remote host
I actually turned my firewall off for now.

What do you mean by my Apache ServerName? If you mean the version, it's the one that came preinstalled on Leopard. If you mean something else, you'll have to tell me how to find it.
15" MacBook Pro (unibody), 4 GB RAM, 2.53 GHz Intel Core 2 Duo, Mac OS X 10.6.2
     
besson3c
Clinically Insane
Join Date: Mar 2001
Location: yes
Status: Offline
Reply With Quote
Jan 2, 2008, 12:42 AM
 
I meant the ServerName variable as defined in your Apache httpd.conf file - the same place you changed the Listen port.

Do you have more than one version of Apache installed? If so, did you change the Listen port for the copy actually running? Some people have multiple copies installed on the Mac - the outdated versions that are shipped by Apple, and newer versions provided by Fink/MacPorts/some guy's binary installer...
     
cbk1994  (op)
Forum Regular
Join Date: Dec 2005
Status: Offline
Reply With Quote
Jan 2, 2008, 12:49 AM
 
This is all I can find.

# ServerName allows you to set a host name which is sent back to clients for
# your server if it's different than the one the program would get (i.e., use
# "www" instead of the host's real name).
#
# Note: You cannot just invent host names and hope they work. The name you
# define here must be a valid DNS name for your host. If you don't understand
# this, ask your network administrator.
# If your host doesn't have a registered DNS name, enter its IP address here.
# You will have to access it by its address (e.g., http://123.45.67.89/)
# anyway, and this will make redirections work in a sensible way.
#
# 127.0.0.1 is the TCP/IP local loop-back address, often named localhost. Your
# machine always knows itself by this address. If you use Apache strictly for
# local testing and development, you may use 127.0.0.1 as the server name.
#
#ServerName new.host.name
The ServerName seems to be commented out ... I can't find anywhere else where it is defined. Should I define one? I can get to my site by going to http://chrishamma.local/ if that works?

I believe I only have one version of Apache, I don't remember installing a new one. Is there a way to check?

Thanks.
15" MacBook Pro (unibody), 4 GB RAM, 2.53 GHz Intel Core 2 Duo, Mac OS X 10.6.2
     
besson3c
Clinically Insane
Join Date: Mar 2001
Location: yes
Status: Offline
Reply With Quote
Jan 2, 2008, 12:57 AM
 
If you provide the output of:

ps aux | grep http

And then let me know where you found the httpd.conf you edited, I can help you check on that.

Without ServerName defined, I believe Apache binds to the loopback address (127.0.0.1). When you connect to your yourmachine.local it should resolve to your loopback address as well, but to double check do this:

ping yourmachine.local

If this responds as anything but 127.0.0.1, you should probably uncomment your ServerName and set it to this IP (you could also try yourmachine.local). You'll need to restart Apache before doing this.

Before you try this though, you might want to output the results of:

sudo tcpdump -i lo0

(and then try to access "localhost:8080" in your web browser) here. This will provide an output of all traffic being sent to your local network interface.
     
cbk1994  (op)
Forum Regular
Join Date: Dec 2005
Status: Offline
Reply With Quote
Jan 2, 2008, 11:26 AM
 
Originally Posted by besson3c View Post
If you provide the output of:

ps aux | grep http

And then let me know where you found the httpd.conf you edited, I can help you check on that.

Without ServerName defined, I believe Apache binds to the loopback address (127.0.0.1). When you connect to your yourmachine.local it should resolve to your loopback address as well, but to double check do this:

ping yourmachine.local

If this responds as anything but 127.0.0.1, you should probably uncomment your ServerName and set it to this IP (you could also try yourmachine.local). You'll need to restart Apache before doing this.

Before you try this though, you might want to output the results of:

sudo tcpdump -i lo0

(and then try to access "localhost:8080" in your web browser) here. This will provide an output of all traffic being sent to your local network interface.
This is what I get from ps aux | grep http
chrishamma:~ Home$ ps aux | grep http
Home 519 0.1 0.0 75964 268 s000 R+ 10:17AM 0:00.00 grep http
_www 137 0.0 0.0 2701012 660 ?? S 8:57AM 0:00.00 /usr/sbin/httpd -D FOREGROUND
root 25 0.0 0.2 2701012 3788 ?? Ss 8:57AM 0:00.54 /usr/sbin/httpd -D FOREGROUND
I edited the httpd.conf file in /etc/httpd/httpd.conf

When I ping chrishamma.local, I get this (this continues):
chrishamma:~ Home$ ping chrishamma.local
PING chrishamma.local (192.168.1.200): 56 data bytes
64 bytes from 192.168.1.200: icmp_seq=0 ttl=64 time=0.044 ms
64 bytes from 192.168.1.200: icmp_seq=1 ttl=64 time=0.100 ms
64 bytes from 192.168.1.200: icmp_seq=2 ttl=64 time=0.103 ms
I got this from sudo tcpduml -i lo0

chrishamma:~ Home$ sudo tcpdump -i lo0
Password:
tcpdump: verbose output suppressed, use -v or -vv for full protocol decode
listening on lo0, link-type NULL (BSD loopback), capture size 96 bytes
10:34:26.005714 IP6 localhost.49973 > localhost.http-alt: S 1261445022:1261445022(0) win 65535 <mss 16324,nop,wscale 1,nop,nop,timestamp 903595583 0,sackOK,eol>
10:34:26.005737 IP6 localhost.http-alt > localhost.49973: R 0:0(0) ack 1261445023 win 0
10:34:26.006257 IP6 localhost.49974 > localhost.http-alt: S 4259637377:4259637377(0) win 65535 <mss 16324,nop,wscale 1,nop,nop,timestamp 903595583 0,sackOK,eol>
10:34:26.006267 IP6 localhost.http-alt > localhost.49974: R 0:0(0) ack 4259637378 win 0
10:34:26.006452 IP localhost.49975 > localhost.http-alt: S 511115587:511115587(0) win 65535 <mss 16344,nop,wscale 1,nop,nop,timestamp 903595583 0,sackOK,eol>
10:34:26.006469 IP localhost.http-alt > localhost.49975: R 0:0(0) ack 511115588 win 0
localhost:8080 still does nothing (server not found, so I'll change the server name.

Changing the ServerName to chrishamma.local doesn't change anything.
( Last edited by cbk1994; Jan 2, 2008 at 11:35 AM. )
15" MacBook Pro (unibody), 4 GB RAM, 2.53 GHz Intel Core 2 Duo, Mac OS X 10.6.2
     
cbk1994  (op)
Forum Regular
Join Date: Dec 2005
Status: Offline
Reply With Quote
Jan 2, 2008, 11:41 AM
 
Okay, I found my problem. Thanks for your help!

The config file is at /etc/apache2/httpd.conf

Once I changed that, it immediatley worked.
15" MacBook Pro (unibody), 4 GB RAM, 2.53 GHz Intel Core 2 Duo, Mac OS X 10.6.2
     
besson3c
Clinically Insane
Join Date: Mar 2001
Location: yes
Status: Offline
Reply With Quote
Jan 2, 2008, 11:55 AM
 
Yeah, I think the old path you were editing was for Apache 1.x, which I think is what was included in Tiger.
     
apache2help
Fresh-Faced Recruit
Join Date: Jan 2008
Status: Offline
Reply With Quote
Jan 10, 2008, 06:34 PM
 
besson3c, I unfortunately have been unable to bypass port 80 by changing the "listen" number in the /etc/apache2/httpd.conf
would you now how I can set the apache that came with leopard to listen on port 8080 as the default?
My isp blocks port 80, previously on tiger a had the old apache set up great by setting up port forwarding in the airport extreme
and entering these lines at the end of the old httpd.conf file.

<Directory "/Library/WebServer/Documents/websites">
Options -Indexes
</Directory>

Listen 81
<VirtualHost _default_:81>
DocumentRoot /Library/WebServer/Documents/websites/mysite
<Directory "/Library/WebServer/Documents/websites/mysite">
allow from all
Options +Indexes
</Directory>
</VirtualHost>


<Directory "/Library/WebServer/Documents/websites">
Options -Indexes
</Directory>

Listen 83
<VirtualHost _default_:83>
DocumentRoot /Library/WebServer/Documents/websites/earamerica
<Directory "/Library/WebServer/Documents/websites/earamerica">
allow from all
Options +Indexes
</Directory>
</VirtualHost>

<Directory "/Library/WebServer/Documents/websites">
Options -Indexes
</Directory>

Listen 85
<VirtualHost _default_:85>
DocumentRoot /Library/WebServer/Documents/websites/theirsite
<Directory "/Library/WebServer/Documents/websites/theirsite">
allow from all
Options +Indexes
</Directory>
</VirtualHost>

<Directory "/Library/WebServer/Documents/websites">
Options -Indexes
</Directory>

Listen 8080
<VirtualHost _default_:8080>
DocumentRoot /Library/WebServer/Documents/websites/default8080
<Directory "/Library/WebServer/Documents/websites/default8080">
allow from all
Options +Indexes
</Directory>
</VirtualHost>

<Directory "/Library/WebServer/Documents/websites">
Options -Indexes
</Directory>

Listen 443
<VirtualHost _default_:443>
DocumentRoot /Library/WebServer/Documents/websites/default443
<Directory "/Library/WebServer/Documents/websites/default443">
allow from all
Options +Indexes
</Directory>
</VirtualHost>

I would serve my sites in the nested folder as depicted in the above path, this set up is no longer
working with the new apache, please help. Thank you in advance
     
apache2help
Fresh-Faced Recruit
Join Date: Jan 2008
Status: Offline
Reply With Quote
Jan 10, 2008, 06:37 PM
 
cbk1994 would you let me know if you were able to change the default port, and exactly how you did it, thanks
     
besson3c
Clinically Insane
Join Date: Mar 2001
Location: yes
Status: Offline
Reply With Quote
Jan 12, 2008, 02:34 AM
 
apache2help: what do you see when you do a:

netstat -a | grep -i "listen"

This will show you all network services currently listening for incoming traffic... If port 8080 is open, you will probably see a "http-alt" in that listing.

If you are seeing listings there, is your firewall open and set to accept inbound connects on those ports?

what do you get when you do a:

/usr/sbin/apachectl configtest

Finally, what are you trying to do here anyway? If you are trying to test various sites and separate them by port number, it would be *far* easier to simply create an entry in your /etc/hosts file for local testing, or create a dyndns entry for these domains.
     
   
Thread Tools
 
Forum Links
Forum Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Top
Privacy Policy
All times are GMT -4. The time now is 08:50 AM.
All contents of these forums © 1995-2017 MacNN. All rights reserved.
Branding + Design: www.gesamtbild.com
vBulletin v.3.8.8 © 2000-2017, Jelsoft Enterprises Ltd.,