diff --git a/config/linkchecker.apache2.conf b/config/linkchecker.apache2.conf index 5dd8c99e..cbd29851 100644 --- a/config/linkchecker.apache2.conf +++ b/config/linkchecker.apache2.conf @@ -2,24 +2,39 @@ WSGIScriptAlias /lconlinewsgi/lc.wsgi /usr/lib/cgi-bin/lc.wsgi -Alias /lconline/ /usr/share/linkchecker/lconline/ +Alias /lconline /usr/share/linkchecker/lconline # allow people to read the files - - Options Indexes MultiViews - AllowOverride None - Order allow,deny - Allow from all + + Options Indexes MultiViews + = 2.3> + Require local + + + Order deny,allow + Deny from all + Allow from 127.0.0.0/255.0.0.0 +# Before uncommenting the following lines please put IP address +# of your computer in the Allow line + # Allow from REPLACE-WITH.YOUR-HOST.IP-ADDRESS +# IPv6 addresses work only with apache2 + Allow from ::1/128 + - Order deny,allow - Deny from all - Allow from 127.0.0.0/255.0.0.0 + = 2.3> + Require local + + + Order deny,allow + Deny from all + Allow from 127.0.0.0/255.0.0.0 # Before uncommenting the following lines please put IP address # of your computer in the Allow line - # Allow from REPLACE-WITH.YOUR-HOST.IP-ADDRESS + # Allow from REPLACE-WITH.YOUR-HOST.IP-ADDRESS # IPv6 addresses work only with apache2 - Allow from ::1/128 + Allow from ::1/128 + diff --git a/debian/README.Debian.web b/debian/README.Debian.web index 3d4ce956..43a79d2f 100644 --- a/debian/README.Debian.web +++ b/debian/README.Debian.web @@ -1,12 +1,10 @@ Web Interface ============== -The web interface can be configured with -- executing "sudo a2enmod negotiation" -- accessing http://localhost/lconline/ +The web interface is at http://localhost/lconline/ If you want to access to web interface from other computers, add their IP addresses in the file -/etc/apache2/conf.d/linkchecker +/etc/apache2/conf-available/linkchecker.conf There is a default maximum check time of 5 minutes per request. After that, checking will be aborted. diff --git a/debian/linkchecker-web.dirs b/debian/linkchecker-web.dirs index 32971ba9..270d9a31 100644 --- a/debian/linkchecker-web.dirs +++ b/debian/linkchecker-web.dirs @@ -1,3 +1,3 @@ -etc/apache2/conf.d +etc/apache2/conf-available usr/lib/cgi-bin usr/share/linkchecker/lconline diff --git a/debian/linkchecker-web.postinst b/debian/linkchecker-web.postinst index f094abea..ed8a9313 100644 --- a/debian/linkchecker-web.postinst +++ b/debian/linkchecker-web.postinst @@ -14,9 +14,27 @@ esac #DEBHELPER# -# reload apache configuration -if [ "$1" = "configure" -a -x /etc/init.d/apache2 ]; then +if [ "$1" = "configure" ]; then + + CONF=linkchecker + + if [ -e /usr/share/apache2/apache2-maintscript-helper ]; then + # apache 2.4 + . /usr/share/apache2/apache2-maintscript-helper + apache2_invoke enconf $CONF + elif dpkg-query -f '${Version}' -W 'apache2.2-common' >/dev/null 2>&1; then + # apache 2.2 + # the configuration uses + a2enmod -q version + # the web interface uses content negotiation + a2enmod -q negotiation + [ -d /etc/apache2/conf.d/ ] && [ ! -L /etc/apache2/conf.d/$CONF.conf ] && ln -s ../conf-available/$CONF.conf /etc/apache2/conf.d/$CONF.conf + fi + + # reload apache configuration + if [ -x /etc/init.d/apache2 ]; then invoke-rc.d apache2 reload || true + fi fi exit 0 diff --git a/debian/linkchecker-web.postrm b/debian/linkchecker-web.postrm new file mode 100644 index 00000000..06d84870 --- /dev/null +++ b/debian/linkchecker-web.postrm @@ -0,0 +1,21 @@ +#!/bin/sh -e +# postrm script for linkchecker-web +# +# see: dh_installdeb(1) + +#DEBHELPER# + +if [ "$1" = "remove" ] || [ "$1" = "purge" ]; then + CONF="linkchecker" + + if [ -e /usr/share/apache2/apache2-maintscript-helper ]; then + # apache 2.4 + . /usr/share/apache2/apache2-maintscript-helper + apache2_invoke disconf $CONF + elif dpkg-query -f '${Version}' -W 'apache2.2-common' > /dev/null 2>&1; then + # apache 2.2 + [ -L /etc/apache2/conf.d/$CONF.conf ] && rm /etc/apache2/conf.d/$CONF.conf + fi +fi + +exit 0 diff --git a/debian/linkchecker.postinst b/debian/linkchecker.postinst index 492016f2..ca619197 100755 --- a/debian/linkchecker.postinst +++ b/debian/linkchecker.postinst @@ -24,6 +24,8 @@ fi dpkg-maintscript-helper rm_conffile /etc/linkchecker/linkcheckerrc 6.9 -- "$@" # remove system conffile for versions >= 7.4 dpkg-maintscript-helper rm_conffile /etc/linkchecker/logging.conf 7.3 -- "$@" +# remove system conffile for versions >= 7.7 +dpkg-maintscript-helper rm_conffile /etc/apache2/conf.d/linkchecker 7.7 -- "$@" #DEBHELPER# diff --git a/debian/linkchecker.postrm b/debian/linkchecker.postrm index 39d0c375..94acab06 100644 --- a/debian/linkchecker.postrm +++ b/debian/linkchecker.postrm @@ -19,14 +19,17 @@ #DEBHELPER# if [ "$1" = "purge" ]; then - # remove old conf file generated by previous updates - if [ -f /etc/linkchecker/linkcheckerrc.old ]; then - rm -f /etc/linkchecker/linkcheckerrc.old - fi + # remove old conf file generated by previous updates + if [ -f /etc/linkchecker/linkcheckerrc.old ]; then + rm -f /etc/linkchecker/linkcheckerrc.old + fi fi + # remove system conffile for versions >= 7.0 dpkg-maintscript-helper rm_conffile /etc/linkchecker/linkcheckerrc 6.9 -- "$@" # remove system conffile for versions >= 7.4 dpkg-maintscript-helper rm_conffile /etc/linkchecker/logging.conf 7.3 -- "$@" +# remove system conffile for versions >= 7.7 +dpkg-maintscript-helper rm_conffile /etc/apache2/conf.d/linkchecker 7.7 -- "$@" exit 0 diff --git a/debian/linkchecker.preinst b/debian/linkchecker.preinst index 039fd483..e367b0d4 100644 --- a/debian/linkchecker.preinst +++ b/debian/linkchecker.preinst @@ -30,6 +30,8 @@ esac dpkg-maintscript-helper rm_conffile /etc/linkchecker/linkcheckerrc 6.9 -- "$@" # remove system conffile for versions >= 7.4 dpkg-maintscript-helper rm_conffile /etc/linkchecker/logging.conf 7.3 -- "$@" +# remove system conffile for versions >= 7.7 +dpkg-maintscript-helper rm_conffile /etc/apache2/conf.d/linkchecker 7.7 -- "$@" exit 0 diff --git a/debian/rules b/debian/rules index a2060cdc..ac51ca2e 100755 --- a/debian/rules +++ b/debian/rules @@ -46,7 +46,7 @@ override_dh_auto_install: install -m 644 cgi-bin/lconline/*.ico $(HTMLDIRWEB) install -m 755 cgi-bin/lc.wsgi $(CGIDIRWEB) # apache configuration - install -m 644 config/linkchecker.apache2.conf $(ETCDIRWEB)/apache2/conf.d/linkchecker + install -m 644 config/linkchecker.apache2.conf $(ETCDIRWEB)/apache2/conf-available/linkchecker.conf # clean generated files override_dh_clean: