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.
my postgres cant be found and my apache2 isnt running
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?
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