The problem I'm having seems to be true to all distors but let's assume I use an all-default debian-stable (server), and ran apt update -y.

Installing, upgrading, restarting as well as enabling or disabling modules in Apache are all non version-agnostic operations and I find this a problem:

  1. Installing or upgrading Apache should be apt upgrade apache1 or apt upgrade apache2. It can't be just "apt upgrade apache" with whatever version out there, as with apt upgrade zip or apt upgrade unzip and so forth.

  2. To restart Apache one has to do systemctl restart apache2 and to enable or disable an Apache module one has to do say a2enmod http2 deflate expires or a2dismod http2 deflate expires.

Approaches I considered to deal with that problem

I thought Ansible might help here by transcribing the old installation command with Ansible's apt module's state=latest option but the Ansible Apache docs doesn't include a non version-agnostic syntax of these commands and installs only Apache2 as well, so even when Apache3 comes out, I will still have to manually release_upgrade it from 2.4 to 3.x even though I continuously-upgrade basically all the rest of the above-OS software with Ansible (like zip and unzip).

1. Combining Ansible with regex (as in Ansible's apt apache* or systemctl restart apache*) is still not enough or at least "fragile".

2. Even combining Ansible and tasksel with and regex:

- name: Install latest Apache
  apt: lamp-server^ 
  state: latest

- do stuff and restart Apache
        - aenmod http2 deflate expires # Non version-agnostic http version;
        - systemctl restart apache*

may not be enough, as it will still require me for manual changes when Apache 3 or 4 or 5 comes out (say, to existing virtual host files).

My question

I know it might be an extreme desire but is there a way to install, and totally continuously upgrade Apache (including release_upgrades and virtual host files and so forth) smoothly?

Maybe a communally maintained and well supported Ansible-Galaxy role is the correct approach. Maybe I should pick another webserver - I don't know.

Update per comment

It comes up from a comment by Michael Hampton that this is all Debian specific and that other distros might have version-agnostic ways to install Apache - to be honest, I considered ArchLinux because of its fully rolling-release OS upgrade model. An answer could example a few distros that may suffice the approach I seek in Apache.

  • Part of the problem is you're comparing small utilities that have zero configuration such as zip and unzip with Apache that has non-trivial configuration; it's the configuration that is the complicated part. A major version bump implies there are major (potentially breaking) changes that whatever tool you're using has to be aware of, before you want that major upgrade to occur. Personally I think it'll be a long time before Apache 3+ appears. – bodgit Dec 21 '18 at 13:24
  • 1
    This is all Debian-specific. The software is actually named httpd, but Debian inexplicably chose to rename it apache2 and give it a bunch of nonstandard commands like a2enmod. Nobody knows what the future will bring, but fortunately there is no httpd 3.x on the horizon. – Michael Hampton Dec 21 '18 at 15:06

You're right

"well supported Ansible-Galaxy role is the correct approach".

I'm looking for contributions to Apache role. You might want to suggest other role.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.