On Ubuntu, each time I use sudo service apache2 reload
command to reload apache2 service , my terminal showed
apache2.service is not active, cannot reload.
And, I'm trying to add phpMyAdmin as virtual host, using phpmyadmin.local
as local-area-network domain name; can anyone tell me how? I have tried many times today, I searched many methods, but until now, it's still 404 not found
.
I had the same problem with Ubuntu 16.04. This was causing problems with logrotate, because it could not reload Apache after rotating logs.
The full error I was getting:
/etc/init.d/apache2 reload
[....] Reloading apache2 configuration (via systemctl): apache2.serviceapache2.service is not active, cannot reload.
failed!
The problem went away after stopping Apache with apachectl and starting it with /etc/init.d/apache2:
apachectl stop
/etc/init.d/apache2 start
You can now reload Apache:
/etc/init.d/apache2 reload
[ ok ] Reloading apache2 configuration (via systemctl): apache2.service.
If you start Apache with apachectl start
, it is not being marked as an active service, so you can't reload it with service apache2 reload
. You have to start Apache with /etc/init.d/apache2 start
or service apache2 start
.
I'm not sure if it's intended or a bug. I can't reproduce this with an older system.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With