Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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.

DocumentRoot /var/www/boss
ServerName intranet.boss

Something like this.

Later: Working!

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

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

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.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.