Giter Site home page Giter Site logo

Comments (2)

Reiner030 avatar Reiner030 commented on July 21, 2024

I found in phpmyadmin package these nice script snippets for lighthttpd and apache2.4 which both have now an conf-available folder:

postinst:

lighttpd_install() {
        if [ ! -f /etc/lighttpd/conf-available/50-phpmyadmin.conf ] ; then
                if which lighty-enable-mod >/dev/null 2>&1 ; then
                        ln -s ../../phpmyadmin/lighttpd.conf /etc/lighttpd/conf-available/50-phpmyadmin.conf
                        # We also need auth to protect setup.php
                        lighty-enable-mod phpmyadmin auth fastcgi fastcgi-php
                        avahi_install
                        desktop_install
                else
                        echo "Lighttpd not installed, skipping"
                fi
        fi
}

apache_install() {
        mkdir -p /etc/apache2/conf-available
        ln -sf ../../phpmyadmin/apache.conf /etc/apache2/conf-available/phpmyadmin.conf

        COMMON_STATE=$(dpkg-query -f '${Status}' -W 'apache2.2-common' 2>/dev/null | awk '{print $3}' || true)

        if [ -e /usr/share/apache2/apache2-maintscript-helper ] ; then
                . /usr/share/apache2/apache2-maintscript-helper
                apache2_invoke enconf phpmyadmin
        elif [ "$COMMON_STATE" = "installed" ] || [ "$COMMON_STATE" = "unpacked" ] ; then
                [ -d /etc/apache2/conf.d/ ] && [ ! -L /etc/apache2/conf.d/phpmyadmin.conf ] && ln -s ../conf-available/phpmyadmin.conf /etc/apache2/conf.d/phpmyadmin.conf
        fi

        avahi_install
        desktop_install
}

postrm

lighttpd_remove() {
        if [ -f /etc/lighttpd/conf-available/50-phpmyadmin.conf ] ; then
                rm -f /etc/lighttpd/conf-available/50-phpmyadmin.conf
                if which lighty-enable-mod >/dev/null 2>&1 ; then
                        lighty-disable-mod phpmyadmin
                        # We also enabled auth in postinst, but I think it's safer to keep it there
                else
                        echo "Lighttpd not installed, skipping"
                fi
                # See bug #448682
                if [ -h /etc/lighttpd/conf-enabled/50-phpmyadmin.conf ] ; then
                    echo 'Manually deleting lighttpd/phpMyAdmin configuration link'
                    rm /etc/lighttpd/conf-enabled/50-phpmyadmin.conf
                fi
        fi
}

apache_remove() {
        COMMON_STATE=$(dpkg-query -f '${Status}' -W 'apache2.2-common' 2>/dev/null | awk '{print $3}' || true)

        if [ -e /usr/share/apache2/apache2-maintscript-helper ] ; then
                . /usr/share/apache2/apache2-maintscript-helper
                apache2_invoke disconf phpmyadmin
        elif [ "$COMMON_STATE" = "installed" ] || [ "$COMMON_STATE" = "unpacked" ] ; then
                rm -f /etc/apache2/conf.d/phpmyadmin.conf
        fi

        rm -f /etc/apache2/conf-available/phpmyadmin.conf
}

from matomo-package.

aureq avatar aureq commented on July 21, 2024

@Reiner030 Thanks for the code. #42 has been closed and embeds one configuration file for both Apache 2.2 and 2.4. This should work out of the box now.

from matomo-package.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.