{"id":80244,"date":"2023-10-22T22:25:06","date_gmt":"2023-10-22T14:25:06","guid":{"rendered":"http:\/\/lrxjmw.cn\/?p=80244"},"modified":"2023-10-22T22:25:06","modified_gmt":"2023-10-22T14:25:06","slug":"centos-lamp-build-wordpress","status":"publish","type":"post","link":"https:\/\/lrxjmw.cn\/centos-lamp-build-wordpress.html","title":{"rendered":"\u5229\u7528LAMP\u514d\u8d39\u642d\u5efaWordPress\u535a\u5ba2"},"content":{"rendered":"\n\n\n
\u5bfc\u8bfb<\/td>\nWordPress\u662f\u4f7f\u7528PHP\u8bed\u8a00\u5f00\u53d1\u7684\u535a\u5ba2\u5e73\u53f0\uff0c\u7528\u6237\u53ef\u4ee5\u5728\u652f\u6301PHP\u548cMySQL\u6570\u636e\u5e93\u7684\u670d\u52a1\u5668\u4e0a\u67b6\u8bbe\u5c5e\u4e8e\u81ea\u5df1\u7684\u7f51\u7ad9\u3002\u4e5f\u53ef\u4ee5\u628a WordPress\u5f53\u4f5c\u4e00\u4e2a\u5185\u5bb9\u7ba1\u7406\u7cfb\u7edf\uff08CMS\uff09\u6765\u4f7f\u7528\u3002 WordPress\u662f\u4e00\u6b3e\u4e2a\u4eba\u535a\u5ba2\u7cfb\u7edf\uff0c\u5e76\u9010\u6b65\u6f14\u5316\u6210\u4e00\u6b3e\u5185\u5bb9\u7ba1\u7406\u7cfb\u7edf\u8f6f\u4ef6\uff0c\u5b83\u662f\u4f7f\u7528PHP\u8bed\u8a00\u548cMySQL\u6570\u636e\u5e93\u5f00\u53d1\u7684\u3002\u7528\u6237\u53ef\u4ee5\u5728\u652f\u6301 PHP \u548c MySQL\u6570\u636e\u5e93\u7684\u670d\u52a1\u5668\u4e0a\u4f7f\u7528\u81ea\u5df1\u7684\u535a\u5ba2\u3002<\/strong><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n

\u73af\u5883\u8bf4\u660e\uff1a<\/p>\n

\u5728\u540c\u4e00\u53f0\u4e3b\u673a\u4e0a\u5b9e\u73b0LAMP\uff08Linux + Apache + MariaDB + PHP\uff09
\nCentOS 7.3\u3001Apache 2.4.6\u3001MariaDB 5.5.52\u3001PHP 5.4.16<\/p>\n

1 \u5b89\u88c5LAMP<\/strong><\/div>\n

\u91c7\u7528yum\u65b9\u5f0f\u8fdb\u884c\u5b89\u88c5httpd\u3001MariaDB\u3001php\u3001php-mysql\uff0cphp-mysql\u7528\u6765\u8fdb\u884cphp\u548cMariaDB\u6570\u636e\u5e93\u7684\u8fde\u63a5\u3002<\/p>\n

[root@CentOS7 ~]# yum install httpd mariadb-server php php-mysql -y\r\n<\/pre>\n
2 \u521b\u5efa\u65b0\u7684\u865a\u62df\u4e3b\u673a<\/strong><\/div>\n
\uff081\uff09\u65b0\u589e\u865a\u62df\u4e3b\u673a\u914d\u7f6e\u6587\u4ef6<\/strong><\/span><\/div>\n
[root@CentOS7 ~]# vim \/etc\/httpd\/conf.d\/vhost.conf\r\n\r\nDocumentRoot \"\/var\/www\/wordpress\"\r\nServerName www.mywordpress.com\r\n<Directory \"\/var\/www\/wordpress\">\r\nAllowOverride None\r\nRequire all granted\r\n<\/pre>\n
\uff082\uff09\u521b\u5efa\u6240\u9700\u76ee\u5f55<\/strong><\/span><\/div>\n
[root@CentOS7 ~]# mkdir \/var\/www\/wordpress\r\n<\/pre>\n
3 \u5728\u865a\u62df\u4e3b\u673a\u4e3b\u76ee\u5f55\/var\/www\/wordpress\u4e0b\u65b0\u5efaindex.php\u6587\u4ef6<\/strong><\/div>\n
[root@CentOS7 ~]# vim \/var\/www\/wordpress\/index.php\r\n<!--?php phpinfo(); ?-->\r\n\r\n<\/pre>\n
4 \u68c0\u67e5\u8bed\u6cd5\u5e76\u542f\u52a8httpd\u670d\u52a1<\/strong><\/div>\n
\uff081\uff09\u68c0\u67e5\u8bed\u6cd5<\/strong><\/span><\/div>\n
[root@CentOS7 ~]# httpd -t\r\nSyntax OK\r\n<\/pre>\n
\uff082\uff09\u542f\u52a8httpd\u670d\u52a1<\/strong><\/span><\/div>\n
[root@CentOS7 ~]# systemctl start httpd.service\r\n<\/pre>\n
5 \u6d4b\u8bd5<\/strong><\/div>\n

\u5728\u6d4f\u89c8\u5668\u4e2d\u8f93\u5165www.mywordpress.com<\/p>\n

\"\"<\/p>\n

\u53ef\u4ee5\u770b\u5230PHP\u9ed8\u8ba4\u9875\u9762\u5df2\u7ecf\u6210\u529f\u663e\u793a\uff0c\u8bf4\u660e\u6d4b\u8bd5\u6210\u529f<\/p>\n

6 \u4e0b\u8f7dwordpress\u538b\u7f29\u5305\uff0cwordpress-4.7.4-zh_CN.tar.gz<\/strong><\/div>\n
\uff081\uff09\u89e3\u538b\u7f29<\/strong><\/span><\/div>\n
[root@CentOS7 ~]# tar -xf wordpress-4.7.4-zh_CN.tar.gz\r\n<\/pre>\n
\uff082\uff09\u628a\u89e3\u538b\u7f29\u540e\u5f97\u5230\u7684\u6587\u4ef6\uff08wordpress\uff09\u590d\u5236\u5230DocumentRoot\uff08\/var\/www\/wordpress\/\uff09\u4e0b<\/strong><\/span><\/div>\n
[root@CentOS7 ~]# cp -a wordpress \/var\/www\/wordpress\/\r\n<\/pre>\n
7 \u542f\u52a8MariaDB\u670d\u52a1<\/strong><\/div>\n
[root@CentOS7 ~]# systemctl start mariadb\r\n<\/pre>\n
8 \u901a\u8fc7\u6d4f\u89c8\u5668\u8bbf\u95eewordpress<\/strong><\/div>\n

\u5728\u6d4f\u89c8\u5668\u4e2d\u8f93\u5165http:\/\/www.mywordpress.com\/wordpress<\/p>\n

\u6ce8\u610f\uff1a\u914d\u7f6eDNS\u670d\u52a1\u5668\u89e3\u6790www.test.com \u4e3a192.168.29.100
\n\u6216\u8005 \u4fee\u6539windows \u4e0b\u7684C:\\Windows\\Systeme32\\drivers\\etc\\hosts\u6587\u4ef6
\n192.168.29.100 www.test.com<\/p>\n

\"\"<\/p>\n

\u53ef\u4ee5\u770b\u5230\u5df2\u7ecf\u51fa\u4e86wordpress \u9875\u9762\uff0c\u53ef\u4ee5\u70b9\u51fb\u201c\u73b0\u5728\u5c31\u5f00\u59cb\u201d\u5c31\u884c\u914d\u7f6e\uff0c\u4e5f\u53ef\u4ee5\u624b\u52a8\u4fee\u6539\u914d\u7f6e\u6587\u4ef6<\/p>\n

9 \u4fee\u6539wordpress\u914d\u7f6e\u6587\u4ef6<\/strong><\/div>\n
\uff081\uff09\u8fdb\u5165WordPress\u76ee\u5f55\uff08\/var\/www\/wordpress\/wordpress\/\uff09<\/strong><\/span><\/div>\n
[root@CentOS7 ~]# cd \/var\/www\/wordpress\/wordpress\/\r\n<\/pre>\n
\uff082\uff09\u590d\u5236cp wp-config-sample.php\u6a21\u677f\u6587\u4ef6\u4e3a wp-config.php\uff0c\u7136\u540e\u7f16\u8f91<\/strong><\/span><\/div>\n
[root@CentOS7 ~]# vim \/var\/www\/wordpress\/wordpress\/wp-config.php\r\n\/\/ ** MySQL \u8bbe\u7f6e - \u5177\u4f53\u4fe1\u606f\u6765\u81ea\u60a8\u6b63\u5728\u4f7f\u7528\u7684\u4e3b\u673a ** \/\/\r\n\/** WordPress\u6570\u636e\u5e93\u7684\u540d\u79f0 *\/\r\ndefine('DB_NAME', 'wordpress');\r\n\/** MySQL\u6570\u636e\u5e93\u7528\u6237\u540d *\/\r\ndefine('DB_USER', 'test1');\r\n\/** MySQL\u6570\u636e\u5e93\u5bc6\u7801 *\/\r\ndefine('DB_PASSWORD', '123456');\r\n\/** MySQL\u4e3b\u673a *\/\r\ndefine('DB_HOST', 'localhost');\r\n<\/pre>\n
10 \u5728\u6570\u636e\u5e93\u4e2d\u521b\u5efa\u6570\u636e\u5e93\u548c\u7528\u6237<\/strong><\/div>\n
\uff081\uff09\u521b\u5efa\u6570\u636e\u5e93<\/strong><\/span><\/div>\n
MariaDB [(none)]> create database wordpress;\r\nQuery OK, 1 row affected (0.00 sec)\r\n<\/pre>\n
\uff082\uff09\u521b\u5efa\u7528\u6237<\/strong><\/span><\/div>\n
MariaDB [(none)]> create user 'test1'@'localhost' identified by '123456';\r\nQuery OK, 0 rows affected (0.00 sec)\r\n<\/pre>\n
\uff083\uff09\u7ed9\u7528\u6237\u6388\u6743<\/strong><\/span><\/div>\n
MariaDB [(none)]> grant all on wordpress.* to 'test1'@'localhost';\r\nQuery OK, 0 rows affected (0.01 sec)\r\n<\/pre>\n
11 \u518d\u6b21\u8bbf\u95eeWordPress<\/strong><\/div>\n

http:\/\/www.mywordpress.com\/wordpress<\/p>\n

\"\"
\n\u586b\u5165\u76f8\u5173\u4fe1\u606f\uff0c\u5c31\u53ef\u4ee5\u6b63\u5e38\u8bbf\u95ee\u535a\u5ba2\u4e86\u3002
\n\"\"<\/p>\n

\n

\u539f\u6587\u6765\u81ea\uff1ahttp:\/\/www.linuxidc.com\/Linux\/2017-07\/145947.htm<\/a><\/p>\n

\u672c\u6587\u5730\u5740\uff1a http:\/\/lrxjmw.cn\/centos-lamp-build-wordpress.html<\/a>\u7f16\u8f91\uff1a\u90d1\u5e05\uff0c\u5ba1\u6838\u5458\uff1a\u9004\u589e\u5b9d<\/span><\/p>\n<\/blockquote>\n","protected":false},"excerpt":{"rendered":"

\u5bfc\u8bfb WordPress\u662f\u4f7f\u7528PHP\u8bed\u8a00\u5f00\u53d1\u7684\u535a\u5ba2\u5e73\u53f0\uff0c\u7528\u6237\u53ef\u4ee5\u5728\u652f\u6301PHP\u548cMySQL\u6570\u636e\u5e93\u7684\u670d\u52a1\u5668\u4e0a\u67b6\u8bbe\u5c5e […]<\/p>\n","protected":false},"author":63,"featured_media":80306,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[55],"tags":[],"class_list":["post-80244","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-thread"],"acf":[],"_links":{"self":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/80244","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/users\/63"}],"replies":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/comments?post=80244"}],"version-history":[{"count":11,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/80244\/revisions"}],"predecessor-version":[{"id":285456,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/80244\/revisions\/285456"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/media\/80306"}],"wp:attachment":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/media?parent=80244"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/categories?post=80244"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/tags?post=80244"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}