0

I'm trying to configure Apache to serve some intranet pages. Access to the intranet is made using SSH tunneling. Using the tunnel, I would like to access http://intranet.boss and expect those pages, but instead I get "connection refused" in Firefox.

<VirtualHost 127.0.0.1:80>
DocumentRoot /var/www/boss
ServerName intranet.boss

Something like this.

Later: Working!

I needed to add 127.0.0.1 intranet.boss to /etc/hosts file.

6
  • what command are you using to establish your tunnel? Is apache definitely listening on port 80 (netstat)?
    – GeoSword
    Aug 21, 2013 at 21:18
  • are you sure that client will access 127.0.0.1 and not other ip? change configuration to listen 0.0.0.0:80 and limit users/virtualhost by source ip's
    – GioMac
    Aug 21, 2013 at 21:48
  • @GeoSword I was using Putty's tunneling feature.
    – danator
    Aug 22, 2013 at 1:35
  • @GioMac yes, only 127.0.0.1, so that it will be accessible only by ssh tunneling.
    – danator
    Aug 22, 2013 at 1:36
  • I've edited my question. Problem solved. Thanks guys!
    – danator
    Aug 22, 2013 at 1:36

1 Answer 1

0

Consider using the SOCKS proxy feature in SSH instead of port forwarding. With most command-line SSH clients, it's the -D option. Then, once you configure your browser to use the SOCKS proxy, you can just go to http://intranet.boss/, without having to hack /etc/hosts.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .