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

Re: Packaging data for a CGI



On Sat, Jun 20, 2009 at 08:08:49PM +1000, Erik de Castro Lopo wrote:
> Peter Pentchev wrote:
> 
> > Look at some other packages; I believe the convention is to use
> > /usr/share/<appname>.  In your case, if there is already stuff in
> > /usr/share/hoogle/ for the hoogle-data package, you might pick
> > /usr/share/hoogle/www/ or www-data/ or something like that for
> > the CGI script's resources.
> 
> Sorry, I don't think I explained my self clearly enough.
> 
> The problem is that the CGI generates HTML which has links
> which look like:
> 
>      /hoogle/hoogle.css
>      /hoogle/hoogle.png
>      /hoogle/hoogle.js
> 
> which the web client would interpret as:
> 
>     http://host-cgi-was-served-from/hoogle/hoogle.css
> 
> and so on. The obvious solution is to put them in /var/www/hoogle/
> but this location seems to be discouraged by the policy manual.
> 
> I was wondering if there was another solution.

Yes, there is, and that's exactly what I meant :)  Sorry for not
explaining this more clearly, or pointing at a specific package;
take a look at e.g. the phpmyadmin or phppgadmin packages.

(of course, I am not a Debian Developer, so the following might
 not necessarily be the right way of doing things; it's just that
 I've seen it done in more than one package)

Your package should place the files into /usr/share/hoogle/www/.
After that, it should either create a file in /etc/apache2/conf.d/
containing something like this (that's what phppgadmin does):

  Alias /hoogle /usr/share/hoogle/www/

  <Directory "/usr/share/hoogle/www">
    Order allow,deny
    Allow from all

    # Any other options your data files might need
  </Directory>

...or it should instruct the user to do that for the virtual hosts
she wants it active on.  It may also install a symlink in /var/www/hooogle/
pointing to /usr/share/hoogle/www/.  The latter two options are what
the phpmyadmin package does; also see its README.Debian file.

G'luck,
Peter

-- 
Peter Pentchev	roam@ringlet.net    roam@space.bg    roam@FreeBSD.org
PGP key:	http://people.FreeBSD.org/~roam/roam.key.asc
Key fingerprint	FDBA FD79 C26F 3C51 C95E  DF9E ED18 B68D 1619 4553
You have, of course, just begun reading the sentence that you have just finished reading.

Attachment: pgpbhnS0SZYpN.pgp
Description: PGP signature


Reply to: