一、Apache2
1、Start Apache 2 Server /启动apache服务
sudo /usr/sbin/http2 -t
sudo /etc/init.d/apache2 start
2、Restart Apache 2 Server /重启apache服务
sudo /etc/init.d/apache2 restart
3、Stop Apache 2 Server /停止apache服务
sudo /etc/init.d/apache2 stop
二、Mysql
1、查看状态
sudo /usr/sbin/service mysql status
mysql.service - LSB: Start the MySQL database server
Loaded: loaded (/etc/init.d/mysql)
Active: inactive (dead) since Thu, 2013-09-05 17:57:55 CST; 4s ago
2、启动Mysql/重启
sudo /usr/sbin/service mysql start / restart mysql.service - LSB: Start the MySQL database server
Loaded: loaded (/etc/init.d/mysql)
Active: active (
running) since Thu, 2013-09-05 18:57:37 CST; 4s ago
Process: 6903 ExecStart=/etc/init.d/mysql start (code=exited, status=0/SUCCESS)
3、关闭
sudo /usr/sbin/service mysql stop
三、添加自启动服务
1、查看启动服务/帮助
/sbin/chkconfig /sbin/chkconfig -help
2、添加启动服务
sudo /sbin/chkconfig -a mysql
3、删除启动服务
sudo /sbin/chkconfig -d mysql