Start apache and mysql at boot on Kali Linux

By | May 11, 2013

Apache and mysql are installed by default in Kali Linux. They can be accessed through the Kali Linux menu in Applications. To start apache web server click the menu entry at "Applications > Kali Linux > System Services > HTTP > apache2 start". Similary to start mysql click MySQL > mysql start.

However starting services manually everytime is a waste of time and its better to get them to start automatically at boot.

To configure services like apache, mysql etc to start automatically at bootup just execute the following simple commands.

Apache

The following command will configure apache to start at bootup.

root@kali:~# update-rc.d apache2 enable
update-rc.d: using dependency based boot sequencing

Mysql

The following command will configure mysql to start at bootup.

root@kali:~# update-rc.d mysql enable
update-rc.d: using dependency based boot sequencing

Postgresql

Postgresql is used by metasploit for caching data. Therefore its better to get it started at bootup as well. Command is similar to the above ones.

root@kali:~# update-rc.d postgresql enable
update-rc.d: using dependency based boot sequencing

TOR

Tor, the great anonymity network is also a must for hackers. So it should always be at service when you are hacking inside Kali.

root@kali:~# update-rc.d tor enable
update-rc.d: using dependency based boot sequencing

Test configuration

The configuration is now done. Now reboot kali. After it boots up, check the status of the services by running the following commands.

root@kali:~# service apache2 status
Apache2 is running (pid 2072).

Check status of postgresql

root@kali:~# service postgresql status
Running clusters: 9.1/main

So all services should startup themselves at boot up. If there are any more services you need to startup, configure them using the update-rc.d command, and they should work.

About Silver Moon

A Tech Enthusiast, Blogger, Linux Fan and a Software Developer. Writes about Computer hardware, Linux and Open Source software and coding in Python, Php and Javascript. He can be reached at [email protected].

3 Comments

Start apache and mysql at boot on Kali Linux
  1. Organharvester

    when i try to manually go through Applications>Kali Linux>System Services>MySQL >start
    i get the error “sh: 1: service: not found”, but if i run mysql -u root from the terminal it works. Can anybody explain this to me?

    1. ayoub

      hey i wish you receive this , you are not under root surface you have to use sudo i assume otherwise its not going to work or login as root and you can command freely with no root errors

Leave a Reply

Your email address will not be published. Required fields are marked *