I set up a LAMP stack via Teddy Sun's LAMP Setup Script and when trying to restart Apache I end getting the below error:
Unit apache.service could not be found.
Obviously Apache is running, there are Process IDs for Apache
in the htop
, the index.html in the webroot loads correctly, and there is a valid folder structure and config file in /usr/local/apache/
, so by all means Apache runs and exists.
First I thought I missed out on any syntax changes for Apache, but when running either of the below commands, I always end up with either command not found
or unit xxx could not be found
.
apachectl configtest
sudo systemctl start apache2.service
sudo systemctl reload apache2
sudo service apache2 restart
sudo /etc/init.d/apache2 restart
sudo /etc/init.d/apache2 restart
I suppose the easiest way forward would be to reinstall Apache, but since the current, clearly installed and running, Apache works and has numerous customisations in place (eg. changed webroot default folder), I would rather first understand what the actual issue is.
I am considering redoing the LAMP setup from scratch, but the whole purpose of the LAMP script is to automate the setup, hence doing it manually is not preferred.
Appreciate any help with this, thank you.