Re: PEAR and Virtual Hosts

From: Date: Tue, 02 Nov 2004 17:48:14 +0000
Subject: Re: PEAR and Virtual Hosts
References: 1 2  Groups: php.pear.general 
Request: Send a blank email to pear-general+get-15303@lists.php.net to get a copy of this message
On Tue, 2 Nov 2004 09:43:35 -0800, Nickolas Burger <nick@dmcontact.com> wrote: > > -----Original Message----- > > > > From: Justin Patrin [mailto:papercrane@gmail.com] > > Sent: November 2, 2004 9:29 AM > > To: Nickolas Burger > > Cc: pear-general@lists.php.net > > Subject: Re: [PEAR] PEAR and Virtual Hosts > > > > On Tue, 2 Nov 2004 09:04:37 -0800, Nickolas Burger <nick@dmcontact.com> > > wrote: > > > Greetings. A newbie question, if you will. > > > > > > I've got several FreeBSD servers that use Virtual Hosts for the various > > > clients hosted on those servers. Each of the virtual hosts are set up > > like > > > this: > > > > > > <VirtualHost XXX.XXX.XXX.XXX> > > > ServerAdmin webmaster@website.com > > > DocumentRoot /home/www/website.com > > > ServerName website.com > > > ServerAlias www.website.com > > > > > > php_admin_value doc_root /home/www/website.com > > > php_admin_value open_basedir /home/www/website.com > > > php_value include_path .:/home/www/website.com/includes > > > > > > php_value auto_prepend_file header.inc.php > > > php_value auto_append_file footer.inc.php > > > > > > ErrorDocument 404 http://www.website.com > > > </VirtualHost> > > > > > > Each of the virtual hosts like this in the httpd.conf file has its own > > > include path because each of the client's needs are different and in > > some > > > cases *need* to be isolated from each other. The base directory is, of > > > course, to make sure each has their own playground. > > > > > > The problem comes in where when I want to use a PEAR library (installed > > in > > > /usr/local/lib/php). Even if I add the appropriate directory to the > > include > > > path, the open_basedir screams violation. I also tried creating a > > symbolic > > > link within the includes directory to the PEAR includes directory but > > that > > > didn't fool the open_basedir rule and it screamed again about trying to > > open > > > a file outside of its own "playground". > > > > > > Now I've got to assume there are others out there with virtual hosts > > > configurations that would like to use PEAR so I'm looking for > > suggestions on > > > how to get this to work. I was able to get things to work by removing > > the > > > open_basedir rule and adding the PEAR directory to the include path, but > > I > > > do feel there must be a more secure way of doing this. Not to mention I > > > wouldn't look forward to doing this to every virtual host entry on all > > of > > > our servers. > > > > > > > Well, if you want security and isolation, I would suggest each virtual > > host should install PEAR as they see fit. Not everyone needs it and > > some projects like older versions of packages, etc. etc. Of course, > > this makes it harder to admin and update, but I'm assuming each > > virtual host is for a different person here. > > > > -- > > paperCrane --Justin Patrin-- > > Thanks for responding Justin, > > Yes, each virtual host *can* be for a different person and I had thought of > simply copying the entire PEAR installed directory into the include path of > each client but as you mentioned, that would be a nightmare for updates when > each of our servers could have dozens of virtual hosts. Not to mention > having that many copies of the same files on one server seems like an awful > waste. I'm hoping for a more efficient solution. > Well, you could always hard-link the pear dir into the include path of each virtual host. Instead of "ln -s" use "ln". There's one problem, though. The directories have to be on the same filesystem. This works basically the same as a symlink, except that it looks and acts like a real directory. -- paperCrane --Justin Patrin--

« previous php.pear.general (#15303) next »