May 2024
M T W T F S S
 12345
6789101112
13141516171819
20212223242526
2728293031  

Categories

May 2024
M T W T F S S
 12345
6789101112
13141516171819
20212223242526
2728293031  

YUM deployment of high-level LNMP environment

YUM deployment of high-level LNMP environment

 

Status:
yum epel comes with a low version of php mysql nginx can not meet the test and production environment in the program performance and security requirements

LNMP -> Web environment for rapid deployment

Demand:
yum source version of the php is 5.4, when we need to use 5.6 or 7.0 version of PHP, it can only compile and install. But sometimes we do not want to deal with some dependencies, hoping to be able to quickly deploy through yum, this time You need to introduce a third party yum source
WEBTATIC foreign third party EPEL

Https://webtatic.com/packages/

PHP third party EPEL source

CentOS 6.x source

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

CentOS 7.x source

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

You can view the installation package for the source by command

Yum list –enablerepo = webtatic | grep php

Deploy LNMP environment steps —–> install Mysql —-> install PHP —>
NGINX to install php7.1 version of the example
yum install php71w php71w-fpm php71w-common php71w-gd php71w-mbstring php71w-mcrypt php71w -mysqlnd php71w-pdo php71w-bcmath -y

Install php5.6 version example:
yum install php56w php56w-fpm php56w-mysql php56w-mcrypt php56w-bcmath php56w-gd php56w-mbstring php56w-pdo -y

Simple description of the various PHP components function
# basic
php71w
# nginx connection using
php71w-fpm
# wide byte
php71w-mbstring
# connect mysql related
php71w-mysqlnd
# redis extended
php71w-pecl-redis
# encryption using
php71w-mcrypt
# performance acceleration php5. 5 more than the use of
php71w-opcache
installation of these basic can meet a large number of needs, as some expansion, will be installed in the installation of these libraries

 

Mysql official yum EPEL
introduced CentOS 6.x Platform, comes with the version are 5.1, of course, the MySQL website naturally have to provide the appropriate yum method, most people may not care.
CentOS 7.x series are carrying MariaDB

Official description 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

The installation is complete, start the Mysql service

123456 # start
service mysqld start
# restart
service mysqld restart
# close
service mysqld stop

If the start fails, first check whether the port number is temporary, followed by check the permissions, in addition to the need to check the mysql process

Set the mysql password

Mysqladmin -u root password 123456
Allow remote access
mysql -u root
mysql> use mysql;
# Allow external connection database
mysql> update user set host = ‘%’ where host = ‘127.0.0.1’;
# View the results of the change
mysql> select host, the User, the User password from;
# refresh authority table (this operation must be performed, or the need to restart MySQL)
MySQL> flush privileges;
remember, after a successful connection through the client, be sure to set a password, if a firewall is turned on, you need to let go Database external port, generally 3306

Reset the root password (this operation in two cases)
1, remember the root user password
# 123456 which is the original password, can not be separated from the -p, abcdefg for the new password
mysqladmin -u root -p 123456 password abcdef

2, forget the root user password
# If MySQL is running, first turn off
killall -TERM mysqld
# start MySQL
mysqld_safe – skip-grant-tables &
# this time is to go to MySQL
> use mysql
> update user set password = password (” New_pass “) where user =” root “;
> flush privileges
# Exit, start mysql

Nginx Deployment
Website provides different OS Platform Version Download

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

Leave a Reply

You can use these HTML tags

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>