I'm trying to simplify commands on my ubuntu server.
For now, to start / stop / restart apache2, we have to type those commands :
stop : /etc/apache2/bin/apachectl -k stop
start : /etc/apache2/bin/apachectl -f /usr/local/apache2/conf/httpd.conf
restart : /etc/apache2/bin/apachectl restart
and kinda same for MySql :
stop : mysqladmin -u root shutdown
start : mysqld_safe --user=mysql --log &
What I wish is to be able to use /etc/init.d/apache2 start
or /etc/init.d/mysql start
to make it simple and not having to always look at the Wiki to find the exact command to use each time...
I tried to find samples of files to put in init.d
folder, but found nothing.
I also wanted to know how to do the same with service apache2 start
(and same for stop/restart and MySql).
Is there a difference between using /etc/init.d/xx start
and service xx start
?
Thanks for you help !