统信uos安装lnmp(基于x86_64架构)
统信uos安装lnmp(基于x86_64架构)
前提:需要在有网络环境的情况下进行, nginx/1.24.0, PHP7.2,mysql5.7
一、安装最新最稳定版本nginx
# 1、查看系统版本
[root@localhost yum.repos.d]# cat /etc/system-release
uos release 20 (fuyu)
# 2、查看授权是否是免费的
[root@localhost yum.repos.d]# uos-activator-cmd
System Version:1060e
Product ID:AJJ8AA
Authorization Mode:Open
Status:Free license
Expiration Date:Lifetime license
HWID:009B855D8D704F9D00C0DB132D67EA8D3244D8BD121879845CABF475B79F08FC86E78E992062970094CFD84D7E6CDDF142E66DD4E797A627E2069982E55F
OSID:0110C77101CB8C6248958B46EBD6A0B833CE0000000000000000DB8016946B12DABA21728062BA
Server URL:https://license.chinauos.com
Try 'uos-activator-cmd --help' for more information
#3、配置nginx yum源
cd /etc/yum.repos.d/
vi nginx.repo
[nginx-stable]
name=nginx stable repo
baseurl=http://nginx.org/packages/centos/7/x86_64/
gpgcheck=0
enabled=1
# 4、更新yum源
yum clean all
yum makecache
# 5、查看是否有最新最稳定版本的nginx
yum list all | grep nginx
# 6、安装nignx
[root@localhost yum.repos.d]# yum -y install nginx
# 查看nginx版本加入开机启动
nginx -V
systemctl enable nginx
systemctl is-enabled nginx
至此nginx安装完成
二、安装mysql5.7版本
# 1、查看mysql版本
[root@localhost ~]# yum list all | grep mysql5
mysql5.x86_64 5.7.38-1.up1.uel20 UnionTechOS-Server-20-everything
mysql5-common.x86_64 5.7.38-1.up1.uel20 UnionTechOS-Server-20-everything
mysql5-devel.x86_64 5.7.38-1.up1.uel20 UnionTechOS-Server-20-everything
mysql5-embedded.x86_64 5.7.38-1.up1.uel20 UnionTechOS-Server-20-everything
mysql5-embedded-devel.x86_64 5.7.38-1.up1.uel20 UnionTechOS-Server-20-everything
mysql5-errmsg.x86_64 5.7.38-1.up1.uel20 UnionTechOS-Server-20-everything
mysql5-libs.x86_64 5.7.38-1.up1.uel20 UnionTechOS-Server-20-everything
mysql5-server.x86_64 5.7.38-1.up1.uel20 UnionTechOS-Server-20-everything
mysql5-test.x86_64 5.7.38-1.up1.uel20 UnionTechOS-Server-20-everything
可以看到直接有mysql5的版本,那就直接安装把
# 2、安装mysql5
[root@localhost ~]# yum -y install mysql5-server
# 3、查看mysql是否安装成功
[root@localhost ~]# rpm -qa | grep mysql
mysql5-common-5.7.38-1.up1.uel20.x86_64
mysql5-5.7.38-1.up1.uel20.x86_64
mysql5-errmsg-5.7.38-1.up1.uel20.x86_64
mysql5-server-5.7.38-1.up1.uel20.x86_64
# 4、设置开机自启
systemctl start mysqld
systemctl enable mysqld
systemctl is-enabled mysqld
# 5、修改mysql密码(直接输入mysql,此时不需要输入密码)
mysql
msyql>use mysql;
mysql> alter user root@'localhost' identified with mysql_native_password by "123456";
mysql> flush privileges;
mysql> exit
# 创建数据库
create database ts character set 'utf8mb4' collate 'utf8mb4_general_ci';
# 创建用户
grant all privileges on ts.* to ts_user@'%' identified by '1234567';
# 刷新
flush privileges;
至此mysql5安装完成
三、安装php7.2
# 1、配置webtatic源
cd /etc/yum.repos.d
vi webtatic.repo
[webtatic]
name=Webtatic Repository EL7 - $basearch
#baseurl=https://repo.webtatic.com/yum/el7/$basearch/
mirrorlist=https://mirror.webtatic.com/yum/el7/x86_64/mirrorlist
failovermethod=priority
enabled=1
gpgcheck=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-webtatic-el7
[epel]
name=Extra Packages for Enterprise Linux 7 - $basearch
baseurl=http://mirrors.aliyun.com/epel/7/x86_64
failovermethod=priority
enabled=1
gpgcheck=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-7
# 2、更新yum源
yum clean all
yum makecache
# 3、查看php7.2w版本
[root@localhost yum.repos.d]# yum list all | grep php72w*
# 4、安装
mkdir -p /home/download
cd /home/download
wget -c http://mirror.centos.org/centos/7/updates/x86_64/Packages/libwebp-0.3.0-11.el7.x86_64.rpm
wget -c http://mirror.centos.org/centos/7/os/x86_64/Packages/libicu-50.2-4.el7_7.x86_64.rpm
# --force 强制安装
rpm -ivh libwebp-0.3.0-11.el7.x86_64.rpm --force
rpm -ivh libicu-50.2-4.el7_7.x86_64.rpm --force
#4、安装php7.2和扩展
yum -y install php72w
yum -y install php72w-cli
yum -y install php72w-fpm
yum -y install php72w-devel
yum -y install php72w-pdo
yum -y install php72w-mysqlnd
yum -y install php72w-soap
yum -y install php72w-xml
yum -y install php72w-gd
yum -y install php72w-opcache
yum -y install php72w-pecl-redis
yum -y install php72w-pecl-xdebug
yum -y install php72w-pecl-apcu
yum -y install php72w-intl
#安装完成后,启动服务
systemctl enable php-fpm
systemctl start php-fpm
至此php安装完成