I've got a rails application which has a private component along with a public component.

world wide web.hostname.com/ is private and really should simply be utilized from the inside our firewall, but i wish to allow use of www.hostname.com/public to internet customers. I performed around using the apache vhost config however it appears after i allow use of www.hostname.com it enables all of the pathways below it too. Any help could be very appreciated.

inside your web root (/var/www) create this .htaccess file:

Order deny,allow
Deny from all
allow from 192.168.0.0/24

Inside your public folder (/var/www/public) produce a new .htaccess folder that consists of this line:

allow from all

Make certain .htaccess overrides is enabled inside your apache/vhost configs, this ought to be enabled automatically.