lamp 重启mysql_lamp常用命令 --Ubuntu下启动/重启/停止apache,mysql服务器

lamp常用命令 --Ubuntu下启动/重启/停止apache,mysql服务器

(2011-08-19 16:20:35)转载▼标签: it 分类: LINUX

Ubuntu下启动/重启/停止apache,mysql服务器

// Apache

//Task: Start Apache 2 Server /启动 apache服务

# /etc/init.d/apache2 start

//or

$ sudo /etc/init.d/apache2 start

//Task: Restart Apache 2 Server /重启 apache服务

# /etc/init.d/apache2 restart

//or

$ sudo /etc/init.d/apache2 restart

//Task: Stop Apache 2 Server /停止 apache服务

# /etc/init.d/apache2 stop

//or

$ sudo /etc/init.d/apache2 stop

// Mysql

/etc/init.d/mysql start

/etc/init.d/mysql stop

/etc/init.d/mysql restart

// httpd是Apache超文本传输协议(HTTP) 服务器的主程序。被设计为一个独立运行的后台进程,它会建立一个处理请求的子进程或线程的池。

// 通常,httpd不应该被直接调用,而应该在类Unix系统中由 apachectl 调用

// man apache2 中介绍

// apache2 is the Apache HyperText Transfer Protocol (HTTP) server program.

// It is designed to be run as a standalone daemon process. When used like

// this it will create a pool of child processes or threads to handle requests.

// In general, apache2 should not be invoked directly,

// but rather should be invoked via /etc/init.d/apache2 or apache2ctl.

// The default Debian config-uration requires environment variables

// that are defined in /etc/apache2/envvars and are not available if apache2 is started directly.

// However,apache2ctl can be used to pass arbitrary arguments to apache2.

//

// apache2ctl = apache2 ConTroL

//

apache2ctl -restart

apache2ctl -stop

apache2ctl -t

// 详细见 man apache2

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
要在Ubuntu上安装LAMP堆栈,您需要按照以下步骤进行操作: 1. 首先,确保您已使用sudo特权登录操作系统,以便安装软件包。 2. 执行以下命令来更新系统的软件包列表和安装已有的更新: ``` sudo apt-get update && sudo apt-get upgrade ``` 3. 接下来,您可以使用以下命令来安装Apache Web服务器: ``` sudo apt-get install apache2 ``` 4. 安装完成后,您可以通过访问服务器的公共IP地址来验证Apache是否安装成功。您可以在Web浏览器中输入"http://服务器IP地址/"来检查是否显示Apache默认页面。 5. 接下来安装MySQL数据库服务器,您可以使用以下命令完成安装: ``` sudo apt-get install mysql-server ``` 6. 在MySQL安装过程中,您将会被要求设置root用户的密码。请确保设置一个强密码并妥善保存。 7. 安装完成后,您可以使用以下命令来验证MySQL是否安装成功: ``` sudo systemctl status mysql ``` 8. 最后,安装PHP语言解释器和相关的扩展。您可以使用以下命令来完成安装: ``` sudo apt-get install php libapache2-mod-php php-mysql ``` 9. 安装完成后,您可以创建一个名为info.php的文件并将其放在Apache的默认网站目录(/var/www/html/)中。您可以使用以下命令进行编辑: ``` sudo nano /var/www/html/info.php ``` 10. 在打开的文件中,输入以下内容并保存: ``` <?php phpinfo(); ?> ``` 11. 确保Apache服务正在运行,您可以使用以下命令启动它: ``` sudo systemctl start apache2 ``` 12. 最后,通过在Web浏览器中输入"http://服务器IP地址/info.php"来访问info.php文件,您将能够查看与PHP相关的详细信息,以确认LAMP堆栈已成功安装。 请注意,在安装过程中,您可能需要根据您的特定需求进行额外的配置和设置。这些步骤仅提供了LAMP堆栈的基本安装过程。<span class="em">1</span><span class="em">2</span><span class="em">3</span> #### 引用[.reference_title] - *1* [Ubuntu安装LAMP](https://blog.csdn.net/LhUAn9898/article/details/126233835)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 50%"] - *2* *3* [ubuntu 安装lamp](https://blog.csdn.net/bianjiyuyan/article/details/11982785)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 50%"] [ .reference_list ]

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值