How to auto start apache2 and mysql service after reboot

Hello,

When I reboot the linode server then my apache2 is not started automatically, I needed to manually start it.

I given the commands as:

sudo systemctl enable mysql
sudo systemctl enable ssh

Also I tried by giving commands

sudo update-rc.d apache2 defaults
sudo update-rc.d sshd defaults
sudo update-rc.d mysql defaults

but it's not works.
I want the above Three services are start automatically.

Can you please help me for this.

Thank you

2 Replies

What are the commands that you're using to start them manually and what distribution are you using?

@aorme

sudo service sshd restart
sudo service apache2 restart
sudo /etc/init.d/mysql start

This Commands are used for manually start the services. But I want it after reboot the services are start auto.

What should I do for that.

Thank You.

Reply

Please enter an answer
Tips:

You can mention users to notify them: @username

You can use Markdown to format your question. For more examples see the Markdown Cheatsheet.

> I’m a blockquote.

I’m a blockquote.

[I'm a link] (https://www.google.com)

I'm a link

**I am bold** I am bold

*I am italicized* I am italicized

Community Code of Conduct