---
title: "ubuntu 开启关闭mysql 服务"
author: "vergilwang"
date: "2013-07-15T10:34:00Z"
tags: []
categories: ["操作系统"]
slug: "ubuntu-mysql"
draft: false
lastmod: "2014-02-15T14:03:45Z"
id: 2011154
url: "https://vergilwang.iteye.com/blog/2011154"
---

**\[php]**[view plain](http://blog.csdn.net/phpandjava/article/details/4636610 "view plain")[copy](http://blog.csdn.net/phpandjava/article/details/4636610 "copy")

 

01. //Apache
02. //Task:StartApache2Server/启动apache服务
03. #/etc/init.d/apache2start
04. //or
05. $sudo/etc/init.d/apache2start
06. //Task:RestartApache2Server/重启apache服务
07. #/etc/init.d/apache2restart
08. //or
09. $sudo/etc/init.d/apache2restart
10. //Task:StopApache2Server/停止apache服务
11. #/etc/init.d/apache2stop
12. //or
13. $sudo/etc/init.d/apache2stop
14. //Mysql
15. /etc/init.d/mysqlstart
16. /etc/init.d/mysqlstop
17. /etc/init.d/mysqlrestart

 

 

**\[php]**[view plain](http://blog.csdn.net/phpandjava/article/details/4636610 "view plain")[copy](http://blog.csdn.net/phpandjava/article/details/4636610 "copy")

 

01. //httpd是Apache超文本传输协议(HTTP)服务器的主程序。被设计为一个独立运行的后台进程，它会建立一个处理请求的子进程或线程的池。
02. //通常，httpd不应该被直接调用，而应该在类Unix系统中由apachectl调用
03. //manapache2中介绍
04. //apache2istheApacheHyperTextTransferProtocol(HTTP)serverprogram.
05. //Itisdesignedtoberunasastandalonedaemonprocess.Whenusedlike
06. //thisitwillcreateapoolofchildprocessesorthreadstohandlerequests.
07. //Ingeneral,apache2shouldnotbeinvokeddirectly,
08. //butrathershouldbeinvokedvia/etc/init.d/apache2orapache2ctl.
09. //ThedefaultDebianconfig-urationrequiresenvironmentvariables
10. //thataredefinedin/etc/apache2/envvarsandarenotavailableifapache2isstarteddirectly.
11. //However,apache2ctlcanbeusedtopassarbitraryargumentstoapache2.
12. //
13. //apache2ctl=apache2ConTroL
14. //
15. apache2ctl-restart
16. apache2ctl-stop
17. apache2ctl-t
18. //详细见manapache2