1

I use latest Ubuntu 18.04 LAMP but might as well use Debian LAMP or CentOS or something else common.

To restart Apache2 I do:

systemctl restart apache2

But say "tomorrow" this changes the apache2 changes to apache3 or apache-3 or just apache.

What will be the most correct way to prevent a fail in restart? I assume this shell-glob is good:

systemctl restart apache*

Will you use this way as well, or something else?

2

It will not just magically change.

When it comes to apache for Debian/Ubuntu/Mint or httpd for Fedora/RHEL/CentOS, updates keep the same name with only the version number changing so the service unit will be the same. If a new release comes out such as apache3, that will be a different package and you'll have to configure and set that one up if you want to run a web server with it. apache2 will stay the same. httpd and httpd24 for Fedora/RHEL/CentOS are different packages and installing the latter doesn't change anything with the former.

In regards to some of your comments, apt-get upgrade will upgrade the package to its latest version. It will install new packages for dependencies if necessary but it won't remove or change existing packages.

  • This sounds to me a bit disturbing, pushes me more away from vanilla-Bash and towards Ansible (or I'm wrong here as well?). – JohnDoea Nov 18 '18 at 1:24
  • Wouldn't running upgrade lamp-server^ -y again when Apache-3 comes out transduce my Apache? – JohnDoea Nov 18 '18 at 1:26
  • Crap, maybe I need a Vagrant-Ansible-Docker stack after all, or maybe becoming more flexible with vanilla-Bash, I'm not sure. – JohnDoea Nov 18 '18 at 1:27
  • Nasir could I speak with you in person please, I feel a bit lost between the options, I'll gladly share with you my GitHub account and the four small scripts I wrote. Your advice could help me much... – JohnDoea Nov 18 '18 at 1:28
  • @JohnDoea Join me in chat. – Nasir Riley Nov 18 '18 at 1:35

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.