Exactly what David Dorward said, but I would advise you to take a look at the following fixes that will change apache so as not to send the source code if there is a wrong configuration.
http://mirror.facebook.net/facebook/patches/ap_source_defense.patch
A patch like:
cd apache-1.3.x patch -p1 -i ap_source_defense.patch
More patches from Facebook. Development Team: http://mirror.facebook.net/facebook/patches/
The best way to protect your much-needed source is to place them outside the publicly accessible root directory, as if it were executing it, it would not be able to serve files directly from the public_html folder
eg:
C:/server/apache/ C:/server/apache/htdocs/ C:/server/apache/htdocs/includes/
People can specifically view the files I'm going to
http://hostname.tld/includes/
but having a directory structure:
C:/server/apache/ C:/server/apache/includes/ C:/server/apache/htdocs/
and then inside
C:/server/apache/htdocs/index.php
you have
<?php require_once('../includes/config.php'); ?>
this should protect all the main files in the view file ( index.php )
source share