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 > Software - Troubleshooting and Discussion > Mac OS X > help needed accessing Apache through ssh tunnel

help needed accessing Apache through ssh tunnel
Thread Tools
Senior User
Join Date: Mar 2002
Location: Chicago, IL
Status: Offline
Reply With Quote
Mar 17, 2004, 12:41 AM
 
I've been using SSH tunnels to connect to mail and MySQL servers for a while now, with very few problems. Today I decided to try to do that same, but with an Apache server on my web host, so I could use some interactive pages securely.

I can't get it to work. Here's the command I'm using:

ssh -C -N -f -L 8890:localhost:80 user@host.com

Everything appears to go fine (authentication and listening are ok, I ran with -v to check), until I try to open http://localhost:8890 in a browser. Then I get a "No data to load at this location" error in the browser, and in the terminal I get "channel 2: open failed: connect failed: Connection refused".

I've tried removing options, replacing localhost with 127.00.1 like some web pages suggested, but nothing seems to work. Anyone have any ideas as to what might be going wrong?

Thanks for the help.
We need less Democrats and Republicans, and more people that think for themselves.

infinite expanse
     
Mac Enthusiast
Join Date: Sep 2000
Location: France
Status: Offline
Reply With Quote
Mar 17, 2004, 08:57 AM
 
Try ssh -L 8890:host.com:80 host.com -l user

The command you typed forwards the local port 8890 to the port 80 on your own machine, not on the remote server.
     
york28  (op)
Senior User
Join Date: Mar 2002
Location: Chicago, IL
Status: Offline
Reply With Quote
Mar 17, 2004, 03:00 PM
 
Hmm, well, I tried that, and I got teh same error, except it was channel 3 this time instead of 2.

I usually just use SSH Tunnel Manager to configure my tunnels, and it always works for email and MySQL, so I figured that I'd try to copy its syntax in to the terminal and see what happened:

/usr/bin/ssh -N -v -p 22 -c 3des user@host.net -L 8890/localhost/80

And once it connected, an attemp to use a browser on localhost:8890 gave this error in the terminal:

debug1: Connection to port 8890 forwarding to localhost port 80 requested.
debug1: channel 2: new [direct-tcpip]
channel 2: open failed: connect failed: Connection refused
debug1: channel_free: channel 2: direct-tcpip: listening port 8890 for localhost port 80, connect from 127.0.0.1 port 55104, nchannels 3

This exact syntax works fine when used for checking email/using MySQL through, so I am starting to think that it is something specific to Apache, or maybe my web host?

The frustrating part is that I did this previously, a few months ago, and didn't have any problems.....
We need less Democrats and Republicans, and more people that think for themselves.

infinite expanse
     
   
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
Trackbacks are On
Pingbacks are On
Refbacks are On
Top
Privacy Policy
All times are GMT -5. The time now is 09:10 PM.
All contents of these forums © 1995-2011 MacNN. All rights reserved.
Branding + Design: www.gesamtbild.com
vBulletin v.3.8.7 © 2000-2011, Jelsoft Enterprises Ltd., Content Relevant URLs by vBSEO 3.3.2