httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Dean Grant" <dgr...@manweb.gov.mb.ca>
Subject RE: forcing apache to process files read from a database by php
Date Mon, 24 Jun 2002 19:59:53 GMT
Right now I have been doing some testing of various other components of
the system I want to build.  The table structure is as follows:

Files table
	-file id
	-filename
	-etc

Directories table
	-dir id
	-dir name
 
Contains table
	-parent id
	-child id
	-child type (file or directory)

In other words.....tree format.

-----Original Message-----
From: Andrew Hawkes [mailto:ahawkes@unicon.net] 
Sent: Monday, June 24, 2002 2:35 PM
To: users@httpd.apache.org
Subject: Re: forcing apache to process files read from a database by php

All right, that makes sense - it is an interesting idea.

If I were you I'd write a module. I think the book I've seen is "Writing
Apache Modules in Perl and C", an O'Reilly book. I've never written an
Apache module but get the idea it isn't terribly hard.

Would you put all pages in a single flat table, or concoct some kind of
tree representation? Either way, it seems your module would have to do
this:

1. Translate the URI into a SQL query.
2. Perform the query and extract the requested "page".
3. Spit out the page to the client.

-Andy


On Mon, 24 Jun 2002 11:03:24 -0500
"Dean Grant" <dgrant@manweb.gov.mb.ca> wrote:

> I understand that, for the moment, storing and distributing a website
> from a database is not as fast or efficient as running from the file
> system.  But, I do believe that, eventually, the speed gap will be
> reduced sufficiently that the difference will be negligible.
Currently,
> my reasons for wanting things done in this manner are two-fold:
> 
> 1.  To increase organization and allow inherent searching abilities of
> the       
>     web site without the need of a crawler.
> 
> 2.  To see if it can be done.
> 
> Dean
> 
> 
> 
> -----Original Message-----
> From: Andrew Hawkes [mailto:ahawkes@unicon.net] 
> Sent: Monday, June 24, 2002 10:08 AM
> To: users@httpd.apache.org
> Subject: Re: forcing apache to process files read from a database by
php
> 
> On Mon, 24 Jun 2002 09:56:07 -0500
> "Dean Grant" <dgrant@manweb.gov.mb.ca> wrote:
> 
> > Ok, I apologize if I did not give adequate information.
> > 
> > I have a database that stores files in binary form.  I have a PHP
> script
> > that, depending on a URL request, will grab one of the files and
> attempt
> > to display it in the browser.  The problem is that PHP is not
Apache.
> > There are certain types of files that are treated in a special way
by
> > Apache - such as scripts (cgi, php, asp, etc.).  Apache knows where
> the
> > perl and php interpreters are located and how to use them.  What I
> > require is a way to feed the files from the database into Apache so
> that
> > Apache treats the file as though it was read from the file system
like
> > usual.  I thought about creating a temporary file and directing
Apache
> > to that file, but it kind of defeats the idea I'm aiming for - which
> is
> > to store a website in a database.
> 
> Why is the PHP script solution unsatisfactory? It sounds a lot more
> simple
> than any alternative I know.
> 
> Also, if you don't mind telling, why do you want to store the entire
> site
> in a database? That doesn't really make sense to me since filesystems
> seem
> to work so nicely for that purpose.
> 
> Anyway, it sounds if you really want to do this you'll need to write
an
> Apache module (there are some books on that subject). The module would
> need to somehow translate URLs into a SQL statement and then select
> each file from the database, writing it to the client.
> 
> -Andy
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
> For additional commands, e-mail: users-help@httpd.apache.org
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
> For additional commands, e-mail: users-help@httpd.apache.org
> 
> 

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Mime
View raw message