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

How to install lnmp with yum in centos7

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

Share

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

This article mainly introduces how centos7 uses yum to install lnmp. It is very detailed and has a certain reference value. Friends who are interested must read it!

The steps are as follows:

Installation of yum

Yum update

Yum install nginx

Install the latest source for nginx

Yum localinstall http://nginx.org/packages/centos/7/noarch/RPMS/nginx-release-centos-7-0.el7.ngx.noarch.rpmyum repolist enabled | grep "nginx*"

Install nginx

Yum-y install nginx

Start nginx

Service nginx start

Set the nginx server to boot automatically

Systemctl enable nginx.service

Check whether the boot automatic setting is successful.

Systemctl list-dependencies | grep nginx

Enter the public network ip in the browser to check whether the installation is successful.

Http://00.00.00.00/

Install mysql5.7 using yum

Install the mysql source

Yum-y localinstall http://dev.mysql.com/get/mysql57-community-release-el7-7.noarch.rpmyum repolist enabled | grep "mysql.*-community.*"

Install mysql

Yum-y install mysql-community-server install mysql-community-devel

Start mysql

Service mysqld start

Check whether mysql starts properly

Service mysqld status or ps-ef | grep mysql

Set the mysqld service to boot automatically

Systemctl enable mysqld.service

Check whether the mysqld boot is set successfully.

Systemctl list-dependencies | grep mysqld

Mysql5.7 strives for a strong security mechanism in the future, so using yum installation, the startup system will automatically generate a random password and change the mysql password.

Check the random password of mysql

Grep 'temporary password' / var/log/mysqld.log

Log in at the terminal using the random password obtained by the query

Mysql-u root-p change password (mysql documents stipulate that passwords must include uppercase and lowercase alphanumerics plus special symbols > 8 digits) ALTER USER 'root'@'localhost' IDENTIFIED BY' Yourpassword'

Exit the mysql client and log in with the password you just modified to ensure that the password has been changed successfully

Exit;mysql-u root-p

Install php7.1

Install the php 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

Check whether the source is installed successfully

Yum repolist enabled | grep "webtatic*"

Install the php extension source

Yum-y install php71w php71w-fpmyum-y install php71w-mbstring php71w-common php71w-gd php71w-mcryptyum-y install php71w-mysql php71w-xml php71w-cli php71w-develyum-y install php71w-pecl-memcached php71w-pecl-redis php71w-opcache

Verify that php7.1.x and extensions are installed successfully

Verify that php is installed successfully

Php-v

Verify that the corresponding extension is installed successfully

Php-m

Set up php-fpm and detect the running status of php-fpm

Start php-fpm

Service php-fpm star

Check whether the startup is successful

Service php-fpm status

Set Boot self-boot

Systemctl enable php-fpm.service

Check whether the boot self-boot is set successfully

Systemctl list-dependencies | grep php-fpmps-ef | grep php-fpm

The nginx configuration is as follows:

Server {listen 80; server_name youserver; index index.html index.php; root / home/public; # charset koi8-r; # access_log logs/host.access.log main; location / {index index.html index.htm index.php; try_files $uri $uri/ / index.php?$query_string;} error_page 404 / 404.html; # redirect server error pages to the static page / 50x.html # error_page 500502 503 504 / 50x.html; location = / 50x.html {root html } # proxy the PHP scripts to Apache listening on 127.0.0.1 location 80 # # location ~ .php ${# proxy_pass http://127.0.0.1; #} # pass the PHP scripts to FastCGI server listening on 127.0.1 pass the PHP scripts to FastCGI server listening on 9000 # location ~ .php ${root / home/public; fastcgi_pass 127.0.1 location 9000; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME / home/public$fastcgi_script_name; include fastcgi_params } # deny access to .htaccess files, if Apache's document root # concurs with nginx's one # location ~ / .ht {deny all;}} these are all the contents of the article "how to install lnmp with yum by centos7". Thank you for reading! Hope to share the content to help you, more related knowledge, welcome to follow the industry information channel!

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