ubuntu 开启关闭mysql 服务

本文介绍了如何使用命令行工具管理Apache HTTP服务器和MySQL数据库服务,包括启动、重启和停止等操作。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >


[php]
  view plain copy
  1. // Apache  
  2. //Task: Start Apache 2 Server /启动apache服务  
  3. # /etc/init.d/apache2 start  
  4. //or  
  5. $ sudo /etc/init.d/apache2 start  
  6. //Task: Restart Apache 2 Server /重启apache服务  
  7. # /etc/init.d/apache2 restart  
  8. //or  
  9. $ sudo /etc/init.d/apache2 restart  
  10. //Task: Stop Apache 2 Server /停止apache服务  
  11. # /etc/init.d/apache2 stop  
  12. //or  
  13. $ sudo /etc/init.d/apache2 stop   
  14. // Mysql  
  15. /etc/init.d/mysql start  
  16. /etc/init.d/mysql stop  
  17. /etc/init.d/mysql restart  

[php]  view plain copy
  1. // httpd是Apache超文本传输协议(HTTP)服务器的主程序。被设计为一个独立运行的后台进程,它会建立一个处理请求的子进程或线程的池。  
  2. // 通常,httpd不应该被直接调用,而应该在类Unix系统中由 apachectl 调用  
  3. // man apache2 中介绍  
  4. // apache2 is the Apache HyperText Transfer Protocol (HTTP) server program.  
  5. // It is designed to be run as a standalone daemon process. When  used  like  
  6. // this it will create a pool of child processes or threads to handle requests.  
  7. // In general, apache2 should not be invoked directly,  
  8. // but rather should be invoked via /etc/init.d/apache2 or apache2ctl.  
  9. // The default Debian config-uration requires environment variables  
  10. // that are defined in /etc/apache2/envvars and are not available if apache2 is  started  directly.  
  11. // However,apache2ctl can be used to pass arbitrary arguments to apache2.  
  12. //  
  13. // apache2ctl = apache2 ConTroL  
  14. //  
  15. apache2ctl -restart  
  16. apache2ctl -stop  
  17. apache2ctl -t  
  18. // 详细见 man apache2  

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值