[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: [PHP] Placement of PHP programs?



On Mon, 2 Sep 2002, Fabien Penso wrote:

>  > As a kind of an adjunct to the other discussion on PHP libraries, what about
>  > PHP programs?  Not quite so touchy, as I can't see a single way forward here
>  > (and there's no blazingly obvious reason to do so).  So what are people's
>  > best thoughts on the matter?  Most packages I've seen put their
>  > web-accessible content in /usr/share/<package>, then either set up a
>  > separate apache config and include it from the main apache config
>  > (phpgroupware does it this way, for one example) while other packages modify
>  > apache.conf more intrusively.  I'm a fan of the phpgroupware method, which
>  > at least minimises pain.
> 
> Shouldn't webpage go to /var/www or at least /var/, and _not_ /usr/share
> ? We are talking about PHP, but it's still webpages after all.

I don't know of any web server which doesn't support an equivalent concept
to Apache's aliases; I feel that /var/www (and I think practice bears me out)
is pretty much local space - we don't fiddle with it (except when putting an
*initial* web site in on install - which is never again touched after that).

Imagine if the sysadmin had a whole pile of stuff in a directory of /var/www
which had the same name as a web-based package he'd just installed.  Without
any warning, a whole block of his files go bye-bye, to be replaced with
files from the package just installed.  As a sysadmin, I'd be seriously
annoyed - homicidally so, in fact.

> The apache configuration should go into a separate file in /etc/apache/
> which would be included in httpd.conf later; easier to modify I guess.

If the files were in /var/www, then there would be no need for an apache
config in most cases.  The fact that the package scripts go in
/usr/share/<package> means that there needs to be apache directives to make
that accessible, so we put Alias directives in that config file.  Link it
into the apache config using an IncludeFile, and we're off.  If it's in
/var/www then I don't think there'd typically be much need for an apache
config (I may be wrong on that).

> The software configuration should stay into the its location, the
> software directory.

Configuraton goes in /etc; The 'software directory' I would take to be where
the actual program is located - /var/www in your proposal,
/usr/share/<package> in mine.  Either way, config lives in /etc.


-- 
Matthew Palmer, Debian Developer
mpalmer@debian.org     http://www.debian.org



Reply to: