Linux builds a WordPress blog based on LNMP

Source: Internet
Author: User
Tags fpm install wordpress wordpress blog

First of all to build LNMP environment, about LNMP installation please refer to my previous article: (http://wangwq.blog.51cto.com/8711737/1712811)

After installing the LNMP environment, start installing WordPress.

If the following commands do not apply to you, please refer to my LNMP installed article to make correspondence.


1. Download WordPress Source Package

WordPress official website address: https://cn.wordpress.org/, download the source package, if it is downloaded in Windows, downloaded with the FTP tool to transfer to the Linux system.

2. Unzip

Tar zxvf wordpress-4.3.1-zh_cn.tar.gz

Unzip complete, delete the file under/usr/local/nginx/html:

rm-rf/usr/local/nginx/html/*

Then copy all the files in WordPress after the decompression to/usr/local/nginx/html (note that all the files in the WordPress directory, not the WordPress directory):

Cp-r wordpress/*/usr/local/nginx/html/

3. Add MySQL Database

/usr/local/mysql/bin/mysql-uroot-pcreate database WordPress;     Create library use WordPress; Application Library

4. Configure Nginx

vim /usr/local/nginx/conf/nginx.conf   //empty The original configuration, add the following content:user nobody nobody;  worker_processes 2; error_log /usr/local/nginx/logs/nginx_error.log crit; pid  /usr/local/nginx/logs/nginx.pid; worker_rlimit_nofile 51200; events {      use epoll;     worker_connections 6000; } http  {     include mime.types;     default_type  application/octet-stream;     server_names_hash_bucket_size 3526;          //This number is not too big, generally 256 can be      server_names_hash_ max_size 4096;     log_format combined_realip  ' $remote _addr  $http _x_forwarded_for [$time _local] '       ' $host   $request _uri   $status '       '"$http _referer"   "$http _user_agent" ';     sendfile on;      tcp_nopush on;     keepalive_timeout 30;      client_header_timeout 3m;     client_body_timeout 3m;      send_timeout 3m;     connection_pool_size 256;      client_header_buffer_size 1k;     large_client_ header_buffers 8 4k;     request_pool_size 4k;      output_buffers 4 32k;     postpone_output 1460;      client_max_body_size 10m;     client_body_buffer_size  256k;     client_body_temp_path /usr/local/nginx/client_body_temp;      proxy_temp_path /usr/local/nginx/proxy_temp;     fastcgi_temp_path /usr/local/nginx/fastcgi_temp;      fastcgi_intercept_errors on;     tcp_nodelay  on;     gzip on;     gzip_min_length 1k;      gzip_buffers 4 8k;     gzip_comp_level 5;      gzip_http_version 1.1;     gzip_types text/ plain application/x-javascript text/css text/htm application/xml; server {      listen 80;     server_name localhost;      index index.html index.htm index.php;     root  /usr/local/nginx/html;     location ~ \.php$ {          include fastcgi_params;         fastcgi_pass  127.0.0.1:9000;         fastcgi_index index.php;          fastcgi_param script_filename /usr/local/nginx/html$ fastcgi_script_name;     } } }

5. Configure PHP-FPM

The configuration of PHP is configured according to its own situation, if only to do experiments, here is a configuration:

[Global] pid =/usr/local/php-fpm/var/run/php-fpm.piderror_log =/usr/local/php-fpm/var/log/php-fpm.log [www] listen =    /tmp/php-fcgi.sock//can also write TCP/IP, such as listen = 127.0.0.1:9000user = PHP-FPM Group = Php-fpmlisten.owner = Nobody  And the back of the nginx consistent listen.group = nobody//ditto PM = Dynamic Pm.max_children = Pm.start_servers = Pm.min_spare_servers = 5//min idle subprocess pm.max_spare_servers = 35//MAX idle child process pm.max_requests = Rlimit_files = 1024

6. Restart the service

Service mysqld restartservice nginx restartservice php-fpm Restart

7. Web Configuration Installation

After the above steps are completed, enter the IP in the browser to display the interface:


650) this.width=650; "src=" Http://s5.51cto.com/wyfs02/M00/76/5D/wKioL1ZRbFOhxX0kAAB0lrCGp7Y990.png "title=" 111. PNG "alt=" Wkiol1zrbfohxx0kaab0lrcgp7y990.png "/>


The information given is to create a file that is created in/usr/local/nginx/html, so the permission to modify this directory is 777:

chmod 777/usr/local/nginx/html

Or you can not change it, the following steps will give you a workaround.

Click on "Start now!" ", enter the configuration:

650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M01/76/5D/wKioL1ZRbkrAlOz7AABq7eXa5l0377.png "title=" 222. PNG "alt=" Wkiol1zrbkraloz7aabq7exa5l0377.png "/>


If the file permissions are not modified above, the content will appear:

650) this.width=650; "src=" Http://s5.51cto.com/wyfs02/M01/76/5E/wKiom1ZRcLSBnLs1AABiiUisSwo496.png "title=" 333. PNG "alt=" Wkiom1zrclsbnls1aabiiuisswo496.png "/>

You can create this manually:

vim/usr/local/nginx/html/wp-config.php

Then copy the contents of the box in the picture and save the exit.

If permissions have been modified earlier, you do not have to create them manually.

Click "Install" to proceed to the next step:

650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M01/76/5E/wKiom1ZRceywsvr-AABkNklsGHk184.png "title=" 444. PNG "alt=" Wkiom1zrceywsvr-aabknklsghk184.png "/>

At this point has basically completed the installation, enter the title, user and password, mail, click "Install wordpress":

650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M00/76/5D/wKioL1ZRczWR-Gs0AAA1FLVANIU184.png "title=" 555. PNG "alt=" Wkiol1zrczwr-gs0aaa1flvaniu184.png "/>

Successful installation, click "Login" to enter the login screen:

650) this.width=650; "src=" Http://s5.51cto.com/wyfs02/M01/76/5D/wKioL1ZRc5qSefAQAAAncH4HZCA538.png "title=" 666. PNG "alt=" Wkiol1zrc5qsefaqaaanch4hzca538.png "/>


Enter the user name and password, click "Login" to complete the login.

650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M00/76/5E/wKiom1ZRc-zSXiUYAABajFNcu60062.png "title=" 777. PNG "alt=" Wkiom1zrc-zsxiuyaabajfncu60062.png "/>



This article is from the "I am not my" blog, please be sure to keep this source http://wangwq.blog.51cto.com/8711737/1715675

Linux builds a WordPress blog based on LNMP

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.