If you build a Zend Framework website then you will know that it is customary practice to move most of the work out of the publicly accessible web folder and then simple feed back the results to this folder so that the visitors can see a page off your site. So all projects always contain a /public folder which technically should be the root of your Apache webserver.

If you don’t in particular want to mess around with the various rights and permissions already linked to the default /var/www folder, it turns out that there is a elegantly simple solution to your problem – simply symlink the /var/www folder to your zendproject/public folder!

rm -r /var/www
ln -sv /home/user/zendproject/public /var/www

What we are doing above is simply removing the existing /var/www folder and then creating a symlink version of it that points to our project’s public folder. So now anyone browsing our web server will be served pages out of the /public folder, without them knowing any different, keeping the rest of our Zend project out of any potential snooper’s hands!

Nifty.