Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Steps for YUM to deploy a high-version LNMP environment

2025-01-17 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/01 Report--

This article mainly introduces "steps for YUM to deploy high-version LNMP environment". In daily operation, I believe many people have doubts about the steps of deploying high-version LNMP environment in YUM. The editor consulted all kinds of materials and sorted out simple and easy-to-use operation methods. I hope it will be helpful to answer the doubts about "steps for YUM to deploy high-version LNMP environment". Next, please follow the editor to study!

Status quo:

Yum epel originates from a lower version with php mysql nginx that does not meet the performance and security requirements of programs in test and production environments

Rapid deployment of LNMP-- > Web environment

Demand:

The php version of the yum source is also 5.4. when we need to use PHP version 5.6 or 7.0, we can only compile and install it. But sometimes we don't want to deal with some dependency problems and want to be able to deploy quickly through yum. At this time, we need to introduce third-party yum sources.

WEBTATIC foreign third party EPEL

Https://webtatic.com/packages/

PHP third-party EPEL source

CentOS 6.x source

Rpm-Uvh https://dl.fedoraproject.org/pub/epel/epel-release-latest-6.noarch.rpmrpm-Uvh https://mirror.webtatic.com/yum/el6/latest.rpm

CentOS 7.x sourc

Rpm-Uvh https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpmrpm-Uvh https://mirror.webtatic.com/yum/el7/webtatic-release.rpm

You can view the installation package corresponding to this source through the command

Yum list-- enablerepo=webtatic | grep php

Steps to deploy LNMP environment-> install Mysql---- > install PHP--- > NGINX

To install the php7.1 version sample

Yum install php71w php71w-fpm php71w-common php71w-gd php71w-mbstring php71w-mcrypt php71w-mysqlnd php71w-pdo php71w-bcmath-y

Example of installing the php5.6 version:

Yum install php56w php56w-fpm php56w-mysql php56w-mcrypt php56w-bcmath php56w-gd php56w-mbstring php56w-pdo-y

Briefly introduce the functions of each PHP component

# Foundation

Php71w

# nginx connection usage

Php71w-fpm

# wide bytes

Php71w-mbstring

# related to connecting to mysql

Php71w-mysqlnd

# redis extension

Php71w-pecl-redis

# encryption use

Php71w-mcrypt

# performance acceleration for php5.5 and above

Php71w-opcache

Installing these basics can meet a large number of requirements, and some extensions will be added when these libraries are installed

MySQL official yum EPEL

Introduction to CentOS 6.x Platform, its own version is 5.1. of course, MySQL website naturally provides the corresponding yum method, which may not be noticed by most people.

CentOS 7.x series all have their own MariaDB

Official introduction link: https://dev.mysql.com/doc/mysql-repo-excerpt/5.6/en/linux-installation-yum-repo.html

# Update yum source yum update # add mysql5.6 yum source # Centos6 rpm-Uvh http://dev.mysql.com/get/mysql-community-release-el6-5.noarch.rpm # Centos7 rpm-Uvh http://dev.mysql.com/get/mysql-community-release-el7-5.noarch.rpm yum install mysql-server

Installation is complete, start the Mysql service

# start service mysqld start#, restart service mysqld restart# and shut down service mysqld stop

If startup fails, first check whether the port number is temporarily used, then check the permission problem, and also check the mysql process.

Set mysql password

Mysqladmin-uroot password 123456 allows remote access to mysql-u rootmysql > use mysql;# allows external connection to database mysql > update user set host='% 'where host=' 127.0.0.1 permissions # View modification result mysql > select host, user, password from user;# refresh permission table (this operation must be performed, otherwise mysql needs to be restarted) mysql > flush privileges Remember, after a successful connection through the client, be sure to set the password. If the firewall is turned on, you need to release the external port of the database, which is usually 3306.

Reset the root user password (this can be done in two cases)

1. Remember the root user password

# where 123456 is the original password and cannot be separated from-p, and abcdefg is the new password

Mysqladmin-u root-p123456 password abcdef

2. Forget the root user password

# if MySQL is running, close it first

Killall-TERM mysqld

# start MySQL

Mysqld_safe-- skip-grant-tables &

# this is the time to enter MySQL without secret access.

> use mysql

> update user set password=password ("new_pass") where user= "root"

> flush privileges

# quit and start MySQL

Nginx deployment

The official website offers different OS Platform Version Download

Http://nginx.org/en/linux_packages.html#stable

At this point, the study on "the steps for YUM to deploy a high-version LNMP environment" is over. I hope to be able to solve your doubts. The collocation of theory and practice can better help you learn, go and try it! If you want to continue to learn more related knowledge, please continue to follow the website, the editor will continue to work hard to bring you more practical articles!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report