centos7 yum安装配置Lamp(Linux+Apache+MySql+Php)

1.安装apache

官方金沙娱乐赌场网站_赌博娱乐注册送18现金,要加强师德师风建设,坚持教书和育人相统一,坚持言传和身教相统一,坚持潜心问道和关注社会相统一,坚持学术自由和学术规范相统一,引导广大教师以德立身、以德立学、以德施教。,星际线上娱乐,据了解,作为中国最大“氡”温泉,万福温泉常年恒温53℃,富含偏硅酸、锶、锂、锌、硒等多种对人体有益的微量元素。其在森林中建设了199泓功效不同的特色泉池,并拥有独具特色的高空玻璃泡池、半山森林无边际温泉泳池等产品,日接待可达万人。今年暑期,万福温泉主打泼水狂欢节,将“温泉·冷泉·冰泉”与民俗文化相融,让游客在民俗体验游中“嗨”起来。

[[email protected] ~]# yum install httpd

根据提示,输入Y安装即可成功安装

   systemctl start httpd.service   #启动apache  
   systemctl stop httpd.service    #停止apache  
   systemctl restart httpd.service #重启apache  
   systemctl enable httpd.service  #设置apache开机启动

2.安装mariadb(MySQL

   [[email protected] ~]# yum install mariadb mariadb-server 

询问是否要安装,输入Y即可自动安装,直到安装完成

   systemctl start mariadb.service   #启动MariaDB  
   systemctl stop mariadb.service    #停止MariaDB  
   systemctl restart mariadb.service #重启MariaDB  
   systemctl enable mariadb.service  #设置开机启动

3.修改mysql密码,安装后默认为空

修改mysql密码为root:

[[email protected] ~]# mysql -u root
MariaDB [(none)]> set password for 'root'@'localhost'=password('root');

再次登录mysql,验证密码 root

[[email protected] ~]# mysql -u root -p
Enter password: 
Welcome to the MariaDB monitor.  Commands end with ; or \g.
Your MariaDB connection id is 6
Server version: 5.5.50-MariaDB MariaDB Server

Copyright (c) 2000, 2016, Oracle, MariaDB Corporation Ab and others.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

MariaDB [(none)]> 

mysql授权远程连接(navicat等):

MariaDB [(none)]> grant all on *.* to root identified by 'root';
Query OK, 0 rows affected (0.00 sec)

4.安装PHP以及组件,使PHP支持 MariaDB

yum install php php-mysql php-gd libjpeg* php-ldap php-odbc php-pear php-xml php-xmlrpc php-mbstring php-bcmath php-mhash

选择以上安装包进行安装,根据提示输入Y回车
#重启MariaDB

systemctl restart mariadb.service 

#重启apache

systemctl restart httpd.service 

5.访问测试

[[email protected] ~]# cd /var/www/html
[[email protected] html]# vi index.php

#输入下面内容

<?php
   phpinfo();
?>

Esc键 输入
:wq!
#保存退出
在客户端浏览器输入服务器IP地址,可以看到如下图所示相关的配置信息!

511遇见


发布日期:

所属分类: Linux/Centos/Os 标签: