Discussion:
Newbie in packaging web apps
Filippo Rusconi
2014-10-09 12:33:33 UTC
Permalink
Greetings, Fellow Developers,

I set out to package a scientific application that has a web interface
(its name is hekate). It is mainly Perl code, with some javascript for
displaying data in the browser.

I can succesfully install that application according to the webapps
recommendations (/usr/share/<PACKAGE>/www and
/usr/share/<PACKAGE>/cgi-bin, for example).

I would like that the final user accesses the program with that URL:

http://hekate.localhost

and I could do this if:

1. /etc/hosts has lines like

127.0.0.1 localhost
127.0.0.1 hekate.localhost

2. /etc/apache2/sites-enabled/hekate.conf has the following directives:

<VirtualHost *:80>

ServerName hekate.localhost
ServerAdmin ***@localhost

DocumentRoot /usr/share/hekate/www/html

<Directory />
Options FollowSymLinks
AllowOverride None

<RequireAll>
# Require all granted
Require ip 127.0.0.1
</RequireAll>
</Directory>

<Directory /usr/share/hekate/www/html>
Options Indexes FollowSymLinks MultiViews
AllowOverride None

<RequireAll>
# Require all granted
Require ip 127.0.0.1
</RequireAll>
</Directory>

ScriptAlias /cgi-bin/ /usr/share/hekate/cgi-bin/
# <Directory "/srv/www/Hekate/cgi-bin">
<Directory "/usr/share/hekate/cgi-bin">
AllowOverride None
Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch

<RequireAll>
# Require all granted
Require ip 127.0.0.1
</RequireAll>
</Directory>

So, for the hekate.conf apache2 conf file, that is easy, all I have to
do is ship this in the binary package and install it in the
sites-available directory, then call the a2ensite program to make a
link to the sites-enabled directory (a2dissite when uninstalling the
software).

For the /etc/hosts file, I wonder how I could ensure that there is
effectively a

127.0.0.1 localhost

line and then add this one:

127.0.0.1 hekate.localhost

Likewise, how could I make sure that the added line is removed upon
uninstalling the software package ?

Am I totally out of track or is this something doable ? Maybe debconf
is my friend ? Or should I go into prerm / postinst scripting ?

Thank your for your time,

Cheers,
Filippo
--
Filippo Rusconi, PhD - public crypto key 7694CF42@ pgp.mit.edu
Researcher at CNRS and Debian Developer <***@debian.org>
Author of ``massXpert'' at http://www.massxpert.org
--
To UNSUBSCRIBE, email to debian-webapps-***@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact ***@lists.debian.org
Archive: https://lists.debian.org/***@licorne
Paul Wise
2014-10-09 16:52:14 UTC
Permalink
I think the sysadmin should be the one to make the decisions about the
URLs a webapp should be installed at and where data for the webapp is
stored. They might want the app on a subdir of their main site, the
database on their postgres server and files in /srv/nfs/someapp-files.
--
bye,
pabs

https://wiki.debian.org/PaulWise
--
To UNSUBSCRIBE, email to debian-webapps-***@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact ***@lists.debian.org
Archive: https://lists.debian.org/CAKTje6GyZOsehYWUEGCMJwaFmW0Rx_q9-LCd=Ny=***@mail.gmail.com
Loading...