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

Example Analysis of WordPress deployment process steps in Nginx Service LNMP

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

Share

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

This article mainly shows you the "sample analysis of WordPress deployment process steps in Nginx service LNMP", which is easy to understand and well-organized. I hope it can help you solve your doubts. Let me lead you to study and learn "sample analysis of WordPress deployment process steps in Nginx service LNMP".

Experimental environment

Experimental environment:

[root@lnmp ~] # uname-r2.6.32-754.el6.x86_64 [root@lnmp ~] # cat / etc/redhat-release CentOS release 6.10 (Final) [root@lnmp ~] # cat / etc/hosts192.168.1.30 lnmp172.16.1.30 lnmp

Software version:

NGINX:nginx-1.12.2.tar.gzMYSQL:mysql-5.6.47-linux-glibc2.12-x86_64.tar.gzPHP:php-5.5.3.tar.gzlibiconv:libiconv-1.16.tar.gzwordpress:wordpress-4.7.3-zh_CN.tar.gz installs the Nginx service

Nginx service deployment process:

Please refer to: rookie can also complete the 0 basic deployment of Nginx services

Install the Mysql database

Download the binary MySQL package:

[root@lnmp tools] # wget-Q https://mirrors.tuna.tsinghua.edu.cn/mysql/downloads/MySQL-5.6/mysql-5.6.47-linux-glibc2.12-x86_64.tar.gz

Extract the MySQL package:

[root@lnmp tools] # tar xf mysql-5.6.47-linux-glibc2.12-x86_64.tar.gz-C / app/

Create MySQL users and authorizations:

[root@lnmp tools] # cd / app/ [root@lnmp app] # ln-s mysql-5.6.47-linux-glibc2.12-x86_64/ / app/mysql [root@lnmp tools] # useradd mysql- s / sbin/nologin-M [root@lnmp mysql] # chown mysql.mysql / app/mysql/data/

Initialize MySQL:

Initialize the error for the first time, and then I'll be fine after I kill the things in the data directory. How does it work?

[root@lnmp mysql] # bin/mysqld-user=mysql-datadir=/app/mysql/data-basedir=/app/mysql

Create a MySQL startup script:

[root@lnmp data] # cp / app/mysql/support-files/mysql.server / etc/init.d/mysqld cp: overwrite "/ etc/init.d/mysqld"? Y [root@lnmp mysql] # sed-ri's app/mysql/bin/mysqld_safe app/mysql/bin/mysqld_safe usr root@lnmp mysql localcolors ram appendage g'/

Create a profile:

[root@lnmp mysql] # cp / app/mysql/support-files/my-default.cnf / etc/my.cnf cp: overwrite "/ etc/my.cnf"? Y

Start MySQL:

[root@lnmp mysql] # / etc/init.d/mysqld restartShutting down MySQL.. SUCCESS! Starting MySQL. SUCCESS! [root@lnmp mysql] # netstat-utpln | grep mysqldtcp 0 0: 3306: * LISTEN 17796/mysqld

Set the environment variable:

[root@lnmp mysql] # echo 'export PATH=/app/mysql/bin:$PATH' > > / etc/profile [root@lnmp mysql] # source / etc/profile

Log in to the database:

Change the password after login because the initial password is empty

[root@lnmp mysql] # mysqlWelcome to the MySQL monitor. Commands end with; or\ g.Your MySQL connection id is 2Server version: 5.6.47 MySQL Community Server (GPL) Copyright (c) 2000, 2020, Oracle and/or its affiliates. All rights reserved.Oracle is a registered trademark of Oracle Corporation and/or itsaffiliates. Other names may be trademarks of their respectiveowners.Type 'help;' or'\ h' for help. Type'\ c'to clear the current input statement.mysql > [root@lnmp mysql] # mysqladmin-uroot password '123123'Warning: Using a password on the command line interface can be insecure. [root@lnmp mysql] # mysql-uroot-pEnter password: Welcome to the MySQL monitor. Commands end with; or\ g.Your MySQL connection id is 4Server version: 5.6.47 MySQL Community Server (GPL) Copyright (c) 2000, 2020, Oracle and/or its affiliates. All rights reserved.Oracle is a registered trademark of Oracle Corporation and/or itsaffiliates. Other names may be trademarks of their respectiveowners.Type 'help;' or'\ h' for help. Type'\ c'to clear the current input statement.mysql > install PHP

Download PHP package and liblconv package:

[root@lnmp ~] # cd / server/tools/ [root@lnmp tools] # wget https://museum.php.net/php5/php-5.5.3.tar.gz[root@lnmp tools] # wget https://ftp.gnu.org/pub/gnu/libiconv/libiconv-1.16.tar.gz

Install the dependency package:

[root@lnmp tools] # yum-y install zlib-devel libxml2-devel libjpeg-devel libjpeg-turbo-devel [root@lnmp tools] # yum-y install libiconv-devel freetype-devel libpng-devel gd-devel [root@lnmp tools] # yum-y install libcurl-devel libxslt-devel [root@lnmp tools] # yum-y install libmcrypt-devel mhash mcrypt

Compile and install the language conversion tool:

[root@lnmp tools] # tar xf libiconv-1.16.tar.gz [root@lnmp tools] # cd libiconv-1.16 [root@lnmp libiconv-1.16] #. / configure-- prefix=/usr/local/libiconv [root@lnmp libiconv-1.16] # make & & make install

Extract the PHP package for precompilation:

[root@lnmp libiconv-1.16] # cd / server/tools/ [root@lnmp tools] # tar xf php-5.5.3.tar.gz [root@lnmp tools] # cd php-5.5.3 [root@lnmp php-5.5.3] # mkdir-p / app/php-5.5.3 [root@lnmp php-5.5.3] #. / configure-- prefix=/app/php-5.5.3-- with-mysql-- with-pdo-mysql=mysqlnd -- with-iconv-dir=/usr/local/libiconv-- with-freetype-dir-- with-jpeg-dir-- with-png-dir-- with-zlib-- with-libxml-dir=/usr-- disable-rpath-- enable-bcmath-- enable-shmop-- enable-sysvsem-- enable-inline-optimization-- with-curl-- enable-mbregex-- enable-fpm-- enable-mbstring-- with-mcrypt-- with-gd-- enable-gd-native-ttf-- -with-openssl-- with-mhash-- enable-pcntl-- enable-sockets-- with-xmlrpc-- enable-soap-- enable-short-tags-- enable-static-- with-xsl-- with-fpm-user=www-- with-fpm-group=www-- enable-ftp-- enable-opcache=no [root@lnmp php-5.5.3] # echo $? 0

Anti-error handling:

[root@lnmp php-5.5.3] # ln-s / app/mysql/lib/libmysqlclient.so.18 / usr/lib64/ [root@lnmp php-5.5.3] # touch ext/phar/phar.phar

Compile and install PHP:

[root@lnmp php-5.5.3] # make & & make install [root@lnmp php-5.5.3] # echo $? 0 [root@lnmp php-5.5.3] # cp php.ini-production / app/php-5.5.3/lib/ [root@lnmp php-5.5.3] # ln-s / app/php-5.5.3/ / app/php [root@lnmp php-5.5.3] # cd / app/php/etc/ [root@lnmp etc] # ll Total usage 28 root root RW root@lnmp etc-1 root root 1152 August 25 06:39 pear.conf-rw-r--r-- 1 root root 21846 August 25 06:39 php-fpm.conf.default [root@lnmp etc] # cp php-fpm.conf.default php-fpm.conf [root@lnmp etc] # vim php-fpm.conflisten = 172.16.1.30 pear.conf-rw-r--r-- 9000

Start PHP:

[root@lnmp etc] # useradd-s / sbin/nologin-M www [root@lnmp etc] # / app/php/sbin/php-fpm [root@lnmp etc] # netstat-utpln | grep phptcp 00 172.16.1.30 sbin/nologin 9000 0.0.0.0 LISTEN 39741/php-fpm modify Nginx configuration file [root@lnmp etc] # cd / app/nginx/conf/ [root@ Lnmp conf] # cp nginx.conf nginx.conf.bak [root@lnmp conf] # grep-Ev "# | ^ $" nginx.conf.default > nginx.conf [root@lnmp conf] # vim nginx.conf [root@lnmp conf] # cat nginx.confworker_processes 1 Events {worker_connections 1024;} http {include mime.types; default_type application/octet-stream; sendfile on; keepalive_timeout 65; server {listen 80; server_name 192.168.1.30; location / {root html/www; index index.html index.htm index.php Location ~ *. *\. (php | php5)? ${fastcgi_pass 172.16.1.30 fastcgi_pass 9000; fastcgi_index index.php; include fastcgi.conf;}} error_page 500 502 503 504 / 50x.htl; location = / 50x.html {root html } [root@lnmp conf] # / app/nginx/sbin/nginx-tnginx: the configuration file / app/nginx-1.12.2//conf/nginx.conf syntax is oknginx: configuration file / app/nginx-1.12.2//conf/nginx.conf test is successful

Restart the Nginx service:

[root@lnmp etc] # / app/nginx/sbin/nginx-s reload

Test:

[root@lnmp etc] # cd / app/nginx/html/ [root@lnmp html] # ls50x.html index.html [root@lnmp html] # vim test_ php.php [root @ lnmp html] # cat test_php.php web page visit: php page appears in 192.168.1.30/test_php.php, which represents the normal deployment of WordPress personal blog

Download the installation package:

[root@lnmp tools] # wget https://cn.wordpress.org/wordpress-4.7.3-zh_CN.tar.gz[root@lnmp tools] # tar xf wordpress-4.7.3-zh_CN.tar.gz

Deployment site:

[root@lnmp tools] # mkdir-p / app/nginx/html/www [root@lnmp tools] # mv wordpress/* / app/nginx/html/www [root@lnmp tools] # chown-R www.www / app/nginx/html/www/

Create database information:

[root@lnmp tools] # mysql-uroot-p123123mysql > create database wordpress;Query OK, 1 row affected (0.01 sec) mysql > grant all on wordpress.* to 'wordpress'@'localhost' identified by' 123123 question OK, 0 rows affected (0.04 sec)

Log in to the website to configure the website:

Http://ip/wp-admin

The host defaults to localhost. Truncated by mistake

This is all the content of the article "sample Analysis of WordPress deployment process steps in Nginx Services LNMP". Thank you for reading! I believe we all have a certain understanding, hope to share the content to help you, if you want to learn more 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

Development

Wechat

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

12
Report