Score:0

Apache not found but exists

az flag

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.

in flag
Wow. That tool does a lot of weird stuff to build a LAMP stack. If the goal is to automate the process and you use Ubuntu exclusively, you can build a quick installation script that will do the installation without using non-standard directories and repositories. The problem with deviating from defaults is that it makes debugging — or asking questions here — later much more difficult
Armitage2k avatar
az flag
To be frank, I don’t think it’s the tools fault. I used the same script before and it worked fine, but this time I’m stuck. First time for me setting up in 20.04 LTS, might be because of that.
in flag
Mhmm. Regardless of “fault”, it’s doing all sorts of non-standard things with its configurations. This makes debugging anything a heck of a lot harder for people familiar with how Apache (and other tools) are generally installed and configured on Ubuntu
Armitage2k avatar
az flag
Guess it’s time to wipe it clean and do a manual setup. Thanks though!
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.