So back to the heading, to install apache on Debian you just have to follow the below two really simple steps:
- sudo apt update -y – This to make sure you got the latest repository and it’s information available.
- sudo apt install apache2 -y – The actual installation and use -y to answer yes to the questions automatically meaning a non interactive installation.
When done it might be useful to verify what you have accomplished and e.g
- Verify the apache server is up and via the following command – “sudo systemctl status apache“
- Check apache version via e.g::
During normal operation you might have to stop and start the apache server and that done using the following commands:
- sudo systemctl start apache2 – Start apache server
- sudo systemctl stop apache2 – Stop apache server
Last thing will be to check the Debian version and it’s very similar to what you do in e.g. CentOS meaning reading the file /etc/redhat-release but with debian you check the file /etc/similar