Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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.

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 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 '13 at 21:48
    
@GeoSword I was using Putty's tunneling feature. –  danator Aug 22 '13 at 1:35
    
@GioMac yes, only 127.0.0.1, 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

1 Answer 1

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

 
discard

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.