Velvet Star Monitor

Standout celebrity highlights with iconic style.

news

Ubuntu 'Failed to restart apache2.service: Unit apache2.service not found.'

Writer Andrew Henderson

I am using Google Cloud Platform to test out ModSecurity and I am using a tutorial to launch it. However, I need to restart Apache every once in a while. I'm using Ubuntu 18.04. I write sudo systemctl restart apache2, but an error comes back and it says Failed to restart apache2.service: Unit apache2.service not found. What should I do?

4 Answers

Did you install apache2 first ?

sudo apt install apache2

For those who run into the same issue using Debian

I did have apache2 installed and running as was confirmed by apache2.service | loaded active running.

enter image description here

I still tried to install it.

enter image description here

I did also get the same error Failed to restart apache2.service: Unit apache2.service not found

enter image description here

How I got apache2 to restart

Using: Debian (9.13)

sudo service apache2 restart

or by typing

sudo apachectl stop
sudo apachectl start
2

if you tried to install it and still got the same problem , you can update it , try : apt-get update

Type sudo apt install apache2

To start the apache service type

sudo systemctl start apache2

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

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