zoukankan      html  css  js  c++  java
  • yum 安装LAMP

    一、安装 MySQL

    首先来进行 MySQL 的安装。打开超级终端,输入:

    [root@localhost ~]# yum install mysql mysql-server

    安装完毕,让 MySQL 能够随系统自动启动:

    [root@localhost ~]# chkconfig --levels 235 mysqld on
    [root@localhost ~]# /etc/init.d/mysqld start

    设置 MySQL 数据 root 账户的密码:

    [root@localhost ~]# mysql_secure_installation

    当出现如下提示时候直接按回车:

    Enter current password for root

    出现如下再次回车:

    Set root password? [Y/n]

    出现如下提示输入你需要设置的密码,回车后在输入一次确认:

    New password:

    接下来还会有四个确认,分别是:

    Remove anonymous users? [Y/n]
    Disallow root login remotely? [Y/n]
    Remove test database and access to it? [Y/n]
    Reload privilege tables now? [Y/n]

    直接回车即可。

    二、安装 Apache 组件

      由于 CentOS 已经封装了 Apache,直接运行安装:

    [root@localhost ~]# yum install httpd

    同样配置系统让 Apache 随系统启动:

    [root@localhost ~]# chkconfig --levels 235 httpd on

    配置完毕,启动 Apache:

    [root@localhost ~]# /etc/init.d/httpd start

    三、安装 PHP

    输入如下指令安装 PHP:

    [root@localhost ~]# yum install php

    需要重新启动 Apache 服务:

    [root@localhost ~]# /etc/init.d/httpd restar
  • 相关阅读:
    xml ui
    xml ui
    xml ui
    debug
    centOS7 mini配置linux服务器(一)安装centOs7
    数据结构之__链表
    数据结构之__队列
    数据结构之__栈
    在树莓派上使用 SSD1306 OLED 屏幕
    git官方手册
  • 原文地址:https://www.cnblogs.com/darktime/p/3385977.html
Copyright © 2011-2022 走看看