This is actually quite easy to do. there are two steps.
First, remove the mysql and apache start up scripts. (i also stop postfix as well since i dont need it with apache and mysql) just enter the following commands as root:
Code:
cd /etc/rc2.d/
mv S91apache2 K09apache2
mv S20postfix K80postfix
mv S19mysql K81mysql
mv S18mysql-ndb K82mysql-ndb
mv S17mysql-ndb-mgm K83mysql-ndb-mgm
You technically could delete them, but the proper thing to do is to move them with the S becoming a K and replacing the number in front of it with 100 minus the current number. This will stop the services if they get started by accident by another service.
Secondly, create 2 script and move them to /usr/local/bin (or any other directory in your path)
to start the services:
Code:
#!/bin/sh
# start up services needed by web server
sudo /etc/init.d/postfix start
sudo /etc/init.d/mysql-ndb-mgm start
sudo /etc/init.d/mysql-ndb start
sudo /etc/init.d/mysql start
sudo /etc/init.d/apache2 start
to stop the services:
Code:
#!/bin/sh
# stop up services needed by web server
sudo /etc/init.d/apache2 stop
sudo /etc/init.d/mysql stop
sudo /etc/init.d/mysql-ndb stop
sudo /etc/init.d/mysql-ndb-mgm stop
sudo /etc/init.d/postfix stop
I call them web-start and web-stop on my comp, but they can be named anything. If you have anyother servies running that are only for development you could do the same thing with them (such as bind). There is no need to stop php, since the interpertor is only run when you access it directly.
The sudo will let you run these command as a normal user and just enter your password.
Dan