|
Posted by J.O. Aho on 11/04/05 19:26
JDS wrote:
> Hi all. I don't know if this is possible, and if it is, whether it needs
> to be done within Apache configuration or PHP configuration, but here goes:
>
> I am migrating my web server to another machine. In fact, it is two
> machines -- one for the web server itself, and one as a data server for
> user home directories and MySQL.
>
> The users' home dirs will be mounted on the web server as NFS mounts.
>
> Now, the original, current, configuration has user home directories in
> /home/*. There are a number of PHP scripts that refer to this directory
> by an absolute path, for example, with lines like:
>
> <? include("/home/webmaster/public_html/include/thing.inc"); ?>
>
> However, the NFS mounted home directories are mounted on /webusers. This
> is because I was reserving /home for actual local user directories.
>
> Is there a way I can map calls to "/home" to "/webusers" without actually
> changing all of the places that such absolute-path calls exist?
>
> Note that a symbolic link from /home->/webusers wil not work because /home
> is a real, existing, local directory.
The fastest solution I can think of would be to make symlinks for all users
located in /webusers to /home, this way you would get around the problem of
all absolute paths without modifying anything.
eg: ln -s /webusers/webmaster /home
of course this will lead to problems if there are two users with the same
directory name.
Best solution would of course to fix those hard coded paths, you could run
something like:
perl -npe 's/\/home\//\/webusers\//g' -i *
on each public_html and the subdirectories (sure there are people good at
writing a small script that you could use).
//Aho
[Back to original message]
|