Configure apache in postrm script (code taken from phpmyadmin)
Enable apache CGI module in postinst script (not enabled in debian 8 by default)