-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcentos_wordpress.html
More file actions
21 lines (21 loc) · 11.3 KB
/
centos_wordpress.html
File metadata and controls
21 lines (21 loc) · 11.3 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
<!doctype html><html lang=en><head><meta charset=utf-8><meta http-equiv=X-UA-Compatible content="IE=edge,chrome=1"><title>Centos Wp - Frank Wang's Coding World</title><meta name=renderer content="webkit"><meta name=viewport content="width=device-width,initial-scale=1,maximum-scale=1"><meta http-equiv=Cache-Control content="no-transform"><meta http-equiv=Cache-Control content="no-siteapp"><meta name=theme-color content="#f8f5ec"><meta name=msapplication-navbutton-color content="#f8f5ec"><meta name=apple-mobile-web-app-capable content="yes"><meta name=apple-mobile-web-app-status-bar-style content="#f8f5ec"><meta name=author content><meta name=description content="Build a WordPress blog on CentOS system. First, you need to prepare the basic operating environment that the WordPress blog system depends on."><meta name=keywords content="CentOS,WordPress,Build a website,LNMP"><meta name=generator content="Hugo 0.157.0 with theme even"><link rel=canonical href=http://frankwang0909.github.io/centos_wordpress.html><link rel=apple-touch-icon sizes=180x180 href=/apple-touch-icon.png><link rel=icon type=image/png sizes=32x32 href=/favicon-32x32.png><link rel=icon type=image/png sizes=16x16 href=/favicon-16x16.png><link rel=manifest href=/manifest.json><link rel=mask-icon href=/safari-pinned-tab.svg color=#5bbad5><link href=/sass/main.min.af7fd1da18d66c2b017df5b4cae508ef44cfcac3fb4c7c7a327fe4f4f9e28b08.css rel=stylesheet><link href=/lib/fancybox/jquery.fancybox-3.1.20.min.css rel=stylesheet><meta property="og:url" content="http://frankwang0909.github.io/centos_wordpress.html"><meta property="og:site_name" content="Frank Wang's Coding World"><meta property="og:title" content="Centos Wp"><meta property="og:description" content="Build a WordPress blog on CentOS system. First, you need to prepare the basic operating environment that the WordPress blog system depends on."><meta property="og:locale" content="en_US"><meta property="og:type" content="article"><meta property="article:section" content="post"><meta property="article:published_time" content="2017-08-02T21:23:27+08:00"><meta property="article:modified_time" content="2017-08-02T21:23:27+08:00"><meta property="article:tag" content="WordPress"><meta itemprop=name content="Centos Wp"><meta itemprop=description content="Build a WordPress blog on CentOS system. First, you need to prepare the basic operating environment that the WordPress blog system depends on."><meta itemprop=datePublished content="2017-08-02T21:23:27+08:00"><meta itemprop=dateModified content="2017-08-02T21:23:27+08:00"><meta itemprop=wordCount content="449"><meta itemprop=keywords content="CentOS,WordPress,Build a website,LNMP"><meta name=twitter:card content="summary"><meta name=twitter:title content="Centos Wp"><meta name=twitter:description content="Build a WordPress blog on CentOS system. First, you need to prepare the basic operating environment that the WordPress blog system depends on."><!--[if lte IE 9]><script src=https://cdnjs.cloudflare.com/ajax/libs/classlist/1.1.20170427/classList.min.js></script><![endif]--><!--[if lt IE 9]><script src=https://cdn.jsdelivr.net/npm/html5shiv@3.7.3/dist/html5shiv.min.js></script><script src=https://cdn.jsdelivr.net/npm/respond.js@1.4.2/dest/respond.min.js></script><![endif]--></head><body><div id=mobile-navbar class=mobile-navbar><div class=mobile-header-logo><a href=/en/ class=logo>Frank Wang’s Coding World</a></div><div class=mobile-navbar-icon><span></span>
<span></span>
<span></span></div></div><nav id=mobile-menu class="mobile-menu slideout-menu"><ul class=mobile-menu-list><a href=/en/><li class=mobile-menu-item>Home</li></a><a href=/en/post/><li class=mobile-menu-item>Archives</li></a><a href=/en/tags/><li class=mobile-menu-item>Tags</li></a><a href=/en/categories/><li class=mobile-menu-item>Categories</li></a><a href=/><li class=mobile-menu-item>中文</li></a></ul></nav><div class=container id=mobile-panel><header id=header class=header><div class=logo-wrapper><a href=/en/ class=logo>Frank Wang’s Coding World</a></div><nav class=site-navbar><ul id=menu class=menu><li class=menu-item><a class=menu-item-link href=/en/>Home</a></li><li class=menu-item><a class=menu-item-link href=/en/post/>Archives</a></li><li class=menu-item><a class=menu-item-link href=/en/tags/>Tags</a></li><li class=menu-item><a class=menu-item-link href=/en/categories/>Categories</a></li><li class=menu-item><a class=menu-item-link href=/>中文</a></li></ul></nav></header><main id=main class=main><div class=content-wrapper><div id=content class=content><article class=post><header class=post-header><h1 class=post-title>Centos Wp</h1><div class=post-meta><span class=post-time>2017-08-02</span><div class=post-category><a href=/en/categories/tools/>tools</a></div><span class=more-meta>449 words </span><span class=more-meta>3 mins read</span></div></header><div class=post-toc id=post-toc><h2 class=post-toc-title>Contents</h2><div class="post-toc-content always-active"><nav id=TableOfContents><ul><li><a href=#1-prepare-lnmp-environment>1. Prepare LNMP environment</a><ul><li><a href=#11-install-nginx>1.1 Install Nginx</a></li></ul></li></ul><ul><li><ul><li><a href=#12-install-mysql>1.2 Install MySQL</a></li><li><a href=#13-install-php>1.3 Install PHP</a></li></ul></li><li><a href=#2-install-and-configure-wordpress>2. Install and configure WordPress</a><ul><li><a href=#21-install-wordpress>2.1 Install WordPress</a></li><li><a href=#22-configure-database>2.2 Configure database</a></li></ul></li></ul></nav></div></div><div class=post-content><p>When the financial budget or human resources are limited, <code>WordPress</code> is still the best choice to quickly build a blog or corporate website.</p><p>Recently, I used <code>WordPres</code>s while learning to build a simple official website for a brother company. The code is debugged locally. Today I learned how to publish this program on the server.</p><p>Note: The server is a cloud host on Tencent, and the operating system is <code>CentOS</code> 6.8 64-bit.</p><h2 id=1-prepare-lnmp-environment>1. Prepare LNMP environment</h2><p><code>LNMP</code> is the abbreviation of <code>Linux, Nginx, MySQL and PHP</code> and is the basic operating environment that the <code>WordPress</code> blog system relies on. Let’s first prepare the LNMP environment.</p><h3 id=11-install-nginx>1.1 Install Nginx</h3><p>Install <code>Nginx</code> using <code>yum</code>:</p><p>yum install nginx -y</p><p>Modify <code>/etc/nginx/conf.d/default.conf</code> to remove the monitoring of <code>IPv6</code> addresses (<code>CentOS 6</code> does not support IPv6, you need to cancel the monitoring of IPv6 addresses, otherwise <code>Nginx</code> cannot start successfully), you can refer to the following example:</p><p>server {
listen 80 default_server;
# listen [::]:80 default_server;
server_name _;
root /usr/share/nginx/html;</p><h1 id=load-configuration-files-for-the-default-server-block>Load configuration files for the default server block.</h1><pre><code> include /etc/nginx/default.d/*.conf;
</code></pre><p>location/{
}</p><p>error_page 404 /404.html;
location = /40x.html {
}</p><p>error_page 500 502 503 504 /50x.html;
location = /50x.html {
}</p><p>}</p><p>After the modification is completed, start <code>Nginx</code>:</p><p>nginx</p><p>At this point, you can access the external HTTP service of the cloud host to confirm whether the installation has been successful.</p><p>Set <code>Nginx</code> to <code>start automatically at boot</code>:</p><p>chkconfig nginx on</p><h3 id=12-install-mysql>1.2 Install MySQL</h3><p>Install <code>MySQL</code> using <code>yum</code>:</p><p>yum install mysql-server -y</p><p>After the installation is complete, start the <code>MySQL</code> service:</p><p>service mysqld restart</p><p>Set the <code>MySQL</code> account <code>root</code> password:</p><p>/usr/bin/mysqladmin -u root password ‘yourPassword4WordPress’</p><p>Set <code>MySQ</code>L to <code>start automatically at boot</code>:</p><p>chkconfig mysqld on</p><h3 id=13-install-php>1.3 Install PHP</h3><p>Install <code>PHP</code> using <code>yum</code>:</p><p>yum install php-fpm php-mysql -y</p><p>(CentOs 6 has PHP-FPM and PHP-MYSQL installed by default. Executing the above command may prompt that they are already installed.)</p><p>After installation, start the <code>PHP-FPM</code> process:</p><p>service php-fpm start</p><p>After starting, you can use the following command to check which port the <code>PHP-FPM</code> process is listening on (PHP-FPM listens to port 9000 by default)</p><p>netstat -nlpt | grep php-fpm</p><p>Set <code>PHP-FPM</code> to <code>start automatically at boot</code>:</p><p>chkconfig php-fpm on</p><h2 id=2-install-and-configure-wordpress>2. Install and configure WordPress</h2><h3 id=21-install-wordpress>2.1 Install WordPress</h3><p>After configuring the <code>LNMP</code> environment, continue to use <code>yum</code> to install <code>WordPress</code>:</p><p>yum install wordpress -y</p><p>After the installation is complete, you can see the source code of <code>WordPress</code> in <code>/usr/share/wordpress</code>.</p><h3 id=22-configure-database>2.2 Configure database</h3><p>Configuration to enter <code>MySQL</code>:</p><p>mysql -uroot –password=‘yourPassword4WordPress’</p><p>Create a database for <code>WordPress</code>:</p><p>CREATE DATABASE wordpress;</p><p>The <code>MySQL</code> part is set up, we exit the <code>MySQL</code> environment:</p><p>exit</p><p>To synchronize the above <code>DB</code> configuration to the <code>configuration file</code> of <code>WordPress</code>, please refer to the following configuration:</p></div><footer class=post-footer><div class=post-tags><a href=/en/tags/wordpress/>WordPress</a></div><nav class=post-nav><a class=next href=/nvm_for_window.html><span class="next-text nav-default">NVM for Windows</span>
<span class="next-text nav-mobile">Next</span>
<i class="iconfont icon-right"></i></a></nav></footer></article></div></div></main><footer id=footer class=footer><div class=social-links><a href=mailto:frankwang0909@gmail.com class="iconfont icon-email" title=email></a><a href=https://www.twitter.com/frankwang0909 class="iconfont icon-twitter" title=twitter></a><a href=https://www.github.com/frankwang0909 class="iconfont icon-github" title=github></a><a href=http://frankwang0909.github.io/en/index.xml type=application/rss+xml class="iconfont icon-rss" title=rss></a></div><div class=copyright><span class=power-by>Powered by <a class=hexo-link href=https://gohugo.io>Hugo</a>
</span><span class=division>|</span>
<span class=theme-info>Theme -
<a class=theme-link href=https://github.com/olOwOlo/hugo-theme-even>Even</a>
</span><span class=copyright-year>©
2016 -
2026<span class=heart><i class="iconfont icon-heart"></i></span><span></span></span></div></footer><div class=back-to-top id=back-to-top><i class="iconfont icon-up"></i></div></div><script type=text/javascript src=/lib/jquery/jquery-3.2.1.min.js></script><script type=text/javascript src=/lib/slideout/slideout-1.0.1.min.js></script><script type=text/javascript src=/lib/fancybox/jquery.fancybox-3.1.20.min.js></script><script type=text/javascript src=/js/main.min.4ae89da218555efa0e7093a20b92017d2e1202b66fff9fc2edf4cb8d44b44c6e.js></script><script type=text/javascript>window.MathJax={tex:{}}</script><script async src=https://cdn.jsdelivr.net/npm/mathjax@3.0.5/es5/tex-mml-chtml.js integrity="sha256-HGLuEfFcsUJGhvB8cQ8nr0gai9EucOOaIxFw7qxmd+w=" crossorigin=anonymous></script></body></html>