当前位置:网站首页>Lnmp+wordpress to quickly build a personal website
Lnmp+wordpress to quickly build a personal website
2022-07-26 07:39:00 【Xiaolesheng】
#LNMP Composition Introduction
LNMP A set of free software acronyms commonly used together to run a dynamic web site or server .L finger Linux,N finger Nginx,M Generally refer to MySQL, It can also refer to MariaDB,P Generally refer to PHP, It can also refer to Perl or Python.
#LNMP working principle
- ① Browser send http request Request to server (Nginx), The server responds and processes Web request , Put some static resources (CSS、 picture 、 Video etc. ) Save on the server .
- ② take PHP The script transfers the protocol through the interface ( Gateway Protocol )PHP-FCGI(FastCGI) Transferred to the PHP FPM( Process Manager ),PHP-FPM Don't deal with it . then PHP-FPM call PHP Parser process PHP Parser parsing PHP Script information .PHP The parser process can start multiple , Concurrent execution .
- ③ Return the parsed script to PHP-FPM,PHP-FPM Re pass FastCGI Send script information to Nginx.
- ④ Server repass http response To the browser , The browser will parse and render again , Finally, present .

actual combat
- Installation environment
[[email protected] ~]# hostnamectl set-hostname lnmp
[[email protected] ~]# bash
[[email protected] ~]# yum install -y wget
[[email protected] ~]# wget http://soft.vpser.net/lnmp/lnmp1.8.tar.gz
[[email protected] ~]# tar zxf lnmp1.8.tar.gz
[[email protected] ~]# ls
anaconda-ks.cfg lnmp1.8 lnmp1.8.tar.gz
[[email protected] ~]# cd lnmp1.8
[[email protected] lnmp1.8]# ./install.sh
============================== Check install ==============================
Checking ...
Nginx: OK
MySQL: OK
PHP: OK
PHP-FPM: OK
Clean Web Server src directory...
+------------------------------------------------------------------------+
| LNMP V1.8 for CentOS Linux Server, Written by Licess |
+------------------------------------------------------------------------+
| For more information please visit https://lnmp.org |
+------------------------------------------------------------------------+
| lnmp status manage: lnmp {
start|stop|reload|restart|kill|status} |
+------------------------------------------------------------------------+
| phpMyAdmin: http://IP/phpmyadmin/ |
| phpinfo: http://IP/phpinfo.php |
| Prober: http://IP/p.php |
+------------------------------------------------------------------------+
| Add VirtualHost: lnmp vhost add |
+------------------------------------------------------------------------+
| Default directory: /home/wwwroot/default |
+------------------------------------------------------------------------+
| MySQL/MariaDB root password: 123456 |
+------------------------------------------------------------------------+
+-------------------------------------------+
| Manager for LNMP, Written by Licess |
+-------------------------------------------+
| https://lnmp.org |
+-------------------------------------------+
nginx (pid 94339) is running...
php-fpm is runing!
SUCCESS! MySQL running (94891)
State Recv-Q Send-Q Local Address:Port Peer Address:Port
LISTEN 0 50 *:3306 *:*
LISTEN 0 128 *:80 *:*
LISTEN 0 128 *:80 *:*
LISTEN 0 128 *:80 *:*
LISTEN 0 128 *:80 *:*
LISTEN 0 128 *:22 *:*
LISTEN 0 128 :::22 :::*
Install lnmp takes 13 minutes.
Install lnmp V1.8 completed! enjoy it.
- Deploy Wordpress application

- Configuration database
[[email protected] lnmp1.8]# mysql -uroot -p
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 1
Server version: 5.5.62-log Source distribution
Copyright (c) 2000, 2018, Oracle and/or its affiliates. All rights reserved.
Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
mysql> create database wordpress;
Query OK, 1 row affected (0.00 sec)
mysql> grant all privileges on *.* to [email protected] identified by '123456' with grant option;
Query OK, 0 rows affected (0.00 sec)
mysql> grant all privileges on *.* to [email protected]'%' identified by '123456' with grant option;
Query OK, 0 rows affected (0.01 sec)
mysql> exit
Bye
- download wordpres package
[[email protected] lnmp1.8]# cd
[[email protected] ~]# wget https://cn.wordpress.org/latest-zh_CN.zip
[[email protected] ~]# unzip latest-zh_CN.zip
# Delete nginx default Index.html file
[[email protected] ~]# cd /home/wwwroot/default/
[[email protected] default]# ls
index.html lnmp.gif ocp.php phpinfo.php phpmyadmin p.php
[[email protected] default]# rm -rf index.html
[[email protected] wordpress]# cd /root/wordpress/
[[email protected] wordpress]# cp -rvf * /home/wwwroot/default/
[[email protected] wordpress]# chmod 777 /home/wwwroot/default/*
[[email protected] default]# cp wp-config-sample.php wp-config.php
[[email protected] default]# vim wp-config.php
/** The name of the database for WordPress */
define( 'DB_NAME', 'wordpress' );
/** Database username */
define( 'DB_USER', 'root' );
/** Database password */
define( 'DB_PASSWORD', '123456' );
/** Database hostname */
define( 'DB_HOST', '127.0.0.1' );
/** Database charset to use in creating database tables. */
define( 'DB_CHARSET', 'utf8' );
/** The database collate type. Don't change this if in doubt. */ define( 'DB_COLLATE', '' );
- Browser access test





After entering the homepage of the blog , You can publish articles here , Record events, etc .
边栏推荐
- Taishan Office Technology Lecture: how to calculate page blank (margin)
- 2019 ZTE touyue · model compression scheme
- JWT快速入门
- API (common class 2)
- 记一次路由器频繁掉线问题的分析、解决与发展
- Machine learning related competition website
- Next item recommendations in short sessions
- Hystrix配置简单说明
- Web page basic label
- Summarize the common high-frequency interview questions of the software testing post
猜你喜欢

Network ()

Crawler data analysis

Parameterization of JMeter performance test using CSV file

Speech at 2021 global machine learning conference

Learning Efficient Convolutional Networks Through Network Slimming

JMeter性能测试之使用CSV文件参数化

System architecture & microservices

Now developers are beginning to do testing. Will there be no software testers in the future?

WCF deployed on IIS

【uniapp】多种支付方式封装
随机推荐
tensorflow2.x中的量化感知训练以及tflite的x86端测评
Taishan office lecture: word error about inconsistent values of page margins
MMOE多目标建模
Yaml language-01 (data type, array, object)
在线问题反馈模块实战(十四):实现在线答疑功能
音视频学习(十)——ps流
Vscode cannot start the problem solving idea
PostgreSQL UUID fuzzy search UUID string type conversion SQL error [42883] explicit type casts
1.MySQL架构篇【mysql高级】
什么是消息订阅和发布?
记一次路由器频繁掉线问题的分析、解决与发展
Interview question set
Pycharm common shortcut keys
[C language] do you really know printf? (printf is typically error prone, and collection is strongly recommended)
Use of views
Learning Efficient Convolutional Networks Through Network Slimming
Summary of API method
[keras entry log (3)] sequential model and functional model in keras
2022.7.22DAY612
如何保证缓存和数据库的双写一致性?