From: Robin H.Johnson <robbat2@gentoo.org>
To: gentoo-dev@gentoo.org
Subject: Re: [gentoo-dev] Web Application installations
Date: Wed, 23 Jul 2003 19:55:18 -0700 [thread overview]
Message-ID: <20030724025518.GB770@cherenkov.orbis-terrarum.net> (raw)
In-Reply-To: <20030724021840.GA24746@time>
[-- Attachment #1: Type: text/plain, Size: 2436 bytes --]
On Wed, Jul 23, 2003 at 10:18:40PM -0400, Aron Griffis wrote:
> Robin H.Johnson wrote: [Wed Jul 23 2003, 04:31:52AM EDT]
> > After the 1.4 release (maybe before, depending on how busy I am with
> > work), there will be a migration of all web applications to install
> > somewhere like /usr/share/webapp/${P} (maybe ${PF})
>
> This doesn't sound right to me since /usr should be mountable read-only.
> Don't many/most web applications need to be able to write to their
> installation area? I personally like the Debian solution of /var/www
I agree totally with keeping /usr read-only during normal system use.
Very few applications do write their directories, and those that do are
in the great majority of cases broken. This is because this requires that their
directories have permissions suitable for the webserver to write to
them.
ALL of /usr/share/webapp will be chown root.root, with mode 755 for
directories, and 644 for files.
Under my solution the application THINKS it is running in the instance
directory.
The key thing is this inside the .htaccess file for each instance:
php_value include_path ".:/usr/share/webapp/${P}"
Then they have whatever access to . and read-only to
/usr/share/webapp/${P}.
Say a web application requires a config file 'config.php'.
You could then have two instances
/var/www/site1/webapp/
/var/www/site2/webapp/
Where each directory contains only two files, 'config.php' and '.htaccess'.
Now even if somebody were to break in and get your PHP to run arbitrary
code, their damage would be limited to those two files (and anything
else the apache user has permissions to, which does NOT include the
actual webapp.
If you wanted to seriously customize an instance, all that would be
needed would be to copy the file from /usr/share/webapp/${P} to your
instance directory, and modify the copy in your instance directory.
In my entire time as a PHP programmer, I have seen only one instance
where an application really needed access to a local directory to write
files, and that was only because of a shortcoming in the API used, that
could not send data directly but had to build it on disk (PDF creation
stuff).
--
Robin Hugh Johnson
E-Mail : robbat2@orbis-terrarum.net
Home Page : http://www.orbis-terrarum.net/?l=people.robbat2
ICQ# : 30269588 or 41961639
GnuPG FP : 11AC BA4F 4778 E3F6 E4ED F38E B27B 944E 3488 4E85
[-- Attachment #2: Type: application/pgp-signature, Size: 232 bytes --]
prev parent reply other threads:[~2003-07-24 2:55 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-07-23 4:13 [gentoo-dev] Web Application installations Andrew Cowie
2003-07-23 5:17 ` Max Kalika
2003-07-23 6:17 ` Andrew Cowie
2003-07-23 8:31 ` Robin H.Johnson
2003-07-23 12:27 ` Don Seiler
2003-07-23 14:12 ` Max Kalika
2003-07-23 18:07 ` Max Kalika
2003-07-24 2:18 ` Aron Griffis
2003-07-24 2:55 ` Robin H.Johnson [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20030724025518.GB770@cherenkov.orbis-terrarum.net \
--to=robbat2@gentoo.org \
--cc=gentoo-dev@gentoo.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox