Will Dixon Will Dixon - 1 year ago 72
Apache Configuration Question

How can I open a web browser on a server that I can connect to through ssh?

I'm in a computer science program at my university (Ryerson) and I'm learning perl programming.

The way we're learning is by hosting perl scripts on our university's server and doing stuff with them.

I'm away from the university and the university's server is very strict about which IP's can use the www2 subdomain (which is the subdomain that runs perl scripts). And the IP I'm working from gets me the error:


You don't have permission to access /~w3dixon/cgi-bin/lab4.cgi on this server.

Apache/2.2.22 (Debian) Server at www2.scs.ryerson.ca Port 80

Here's the link, if you want to try to access the script yourself.

So I'm being blocked. Normally I'd contact the sys admin and get them to unblock me, but a working perl script is due tonight. (I also tried using a VPN, it was blocked as well).

My solution was to SSH with terminal on my mac and/or Putty on my PC into Ryerson's server and use the unix command 'lynx' to run my scripts (since they aren't blocking their own IPs).

I was having some success, until I tried to use the perl get method from an html form (I copy pasted a script from https://www.tutorialspoint.com/perl/perl_cgi.htm just to get started, to see if syntactically correct code would work properly with my lynx strategy).

So when I was working on my script using a terminal at the university (with google chrome), my scripts worked fine.

Ryerson (my university), doesn't have a remote access program set up (other than ssh), but is there a way to access my webpage through their servers on a GUI browser installed on my machine?

Answer Source

An SSH tunnel is most likely the most feasible and easiest way to do what you want. Set up the tunnel like this:

ssh -L8080:www2.scs.ryerson.ca:80 username@www2.scs.ryerson.ca

If the www2 server is not the host you SSH to, simply replace the second instance of it in the command with the SSH server.

I use port 8080 here, as that alleviates you from needing root privileges.

Now, on your local workstation, in your browser, browse to:

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download