Get Apache2 to restart after reboot, ubuntu 16.04

Tags:

Answer: 1

22 hours ago

I installed apache as follows on my Ubuntu 16.04 machine:

$ sudo apt-get update
$ sudo apt-get install apache2

It served my test pages fine. Now I tested a reboot of the machine, and I can't reach the server. I try:

$ service apache2 status

and get:

● apache2.service - LSB: Apache2 web server
  Loaded: loaded (/etc/init.d/apache2; bad; vendor preset: enabled)
  Drop-In: /lib/systemd/system/apache2.service.d
       └─apache2-systemd.conf
  Active: inactive (dead) since Tue 2016-08-16 20:13:45 UTC; 6min ago
  Docs: man:systemd-sysv-generator(8)
  Process: 1111 ExecStop=/etc/init.d/apache2 stop (code=exited, status=0/SUCCESS)

Process: 2624 ExecStart=/etc/init.d/apache2 start (code=exited, status=0/SUCCESS)

How can I get apache to restart on reboot?

-- Edit -------------------------------------------------------

As per @mouseclone's suggestion, I ran:

sudo systemctl enable apache2.service

output:

apache2.service is not a native service, redirecting to systemd-sysv-install
Executing /lib/systemd/systemd-sysv-install enable apache2

still no change though, reboot and then apache is down.

Added by: Keaton Upton

Answer: 2

5 hours ago

Ubuntu 16.04 uses systemd.

General instructions: https://www.digitalocean.com/community/tutorials/systemd-essentials-working-with-services-units-and-the-journal

sudo systemctl enable nginx.service

Added by: Kevin Crooks

Answer: 3

8 hours ago

Strange.. though you could add @reboot service apache2 start to crontab to start apache2 service on boot. You can access crontab using crontab -e command

Added by: Krystina Cummings

Popular Search

A B C D E F G H I J K L M N O P Q R S T U V W X Y Z 1 2 3 4 5 6 7 8 9