-   Linux - Newbie (
-   -   Symbolic Links, directories, and relative paths (../). Can it be done? (

jimwillsher 03-10-2005 05:58 AM

Symbolic Links, directories, and relative paths (../). Can it be done?
CentOs 4.0 (basically RHEL4), running Apache. Home directory for apache documents is /var/www/html/

I have 6 websites on my server, and all have a common "Latest news..." script which lives in a folder called News.

At present I have the following folders (representative):





Now, it would be very efficent if I could move the /News folder to a common place, e.g. /var/www/html/News

and create links to the /News and /News/Admin folders etc. This would allow multiple sites to use the same scripts.

Herein lies the problem though. For each site, the DisplayNews.php has an include of "../Config/Config.php". As such, when I try to create a symbolic link as:

cd /var/www/html/website1
ln /var/www/html/DisplayNews.php DisplayNews.php

and access the website, the DisplayNews.php file complains that it cannot find Config.php - because it's now looking in /var/www/html/News/Config instead of /var/www/html/website1/News/Config

Can this be done? Can I create a symlink (or other link) such that all the websites are looking at a common file, but that relative references (../) are processed as though the php page was a file and not a reference?



KimVette 03-11-2005 06:27 PM

Symlinks will work however you need to configure the .conf file or .htaccess to allow symlinks to be followed - it is considered to be a less secure server configuration method so it is not enabled by default in the more responsible distributions.

All times are GMT -5. The time now is 09:33 PM.