{"id":144,"date":"2023-08-21T23:23:35","date_gmt":"2023-08-21T15:23:35","guid":{"rendered":"http:\/\/8.130.131.184\/wordpress\/?p=144"},"modified":"2023-11-04T20:26:01","modified_gmt":"2023-11-04T12:26:01","slug":"lnmp%e5%ae%89%e8%a3%85%e9%83%a8%e7%bd%b2","status":"publish","type":"post","link":"https:\/\/xianyijitan.top\/?p=144","title":{"rendered":"LNMP\u5b89\u88c5\u90e8\u7f72"},"content":{"rendered":"<h4>\u5b89\u88c5Nginx,\u4e0b\u8f7dNginx\u8f6f\u4ef6\u5305<\/h4>\n<pre><code class=\"language-shell\">wget http:\/\/nginx.org\/download\/nginx-1.19.2.tar.gz\n# \u6216\u8005\ncurl -O http:\/\/nginx.org\/download\/nginx-1.19.2.tar.gz<\/code><\/pre>\n<p>\u5bf9\u4e8eDebian\/Ubuntu\u7cfb\u7edf\uff1a<\/p>\n<pre><code>sudo apt-get install wget curl<\/code><\/pre>\n<p>\u5bf9\u4e8eCentOS\/RHEL\u7cfb\u7edf\uff1a<\/p>\n<pre><code>sudo yum install wget curl<\/code><\/pre>\n<h4>\u8fdb\u884c\u6e90\u7801\u7f16\u8bd1\u5b89\u88c5Nginx\uff0c\u5177\u4f53\u64cd\u4f5c\u5982\u4e0b\uff1a<\/h4>\n<pre><code class=\"language-shell\">[root@localhost ~]# tar -zxvf nginx-1.22.1.tar.gz \n[root@localhost ~]# cd nginx-1.22.1\n[root@localhost nginx-1.22.1]#  .\/configure   \\\n &gt; --prefix=\/usr\/local\/nginx    \\\n &gt; --with-http_ssl_module   \n[root@localhost nginx-1.22.1]# make  &amp;&amp; make install<\/code><\/pre>\n<h4>\u5b89\u88c5MariaDB<\/h4>\n<p>LNMP\u67b6\u6784\u540e\u7aef\u4f7f\u7528MariaDB\u6570\u636e\u5e93\uff0c\u8bb0\u5f55\u5404\u79cd\u6570\u636e\u4fe1\u606f\uff0c\u5176\u4ed6\u7a0b\u5e8f\u901a\u8fc7SQL\u8bed\u53e5\u6765\u67e5\u8be2\u3001\u66f4\u6539\u8fd9\u4e9b\u4fe1\u606f\u3002MariaDB\u6570\u636e\u5e93\u76f4\u63a5\u4f7f\u7528yum\u8fdb\u884c\u5b89\u88c5\uff0c\u5177\u4f53\u64cd\u4f5c\u5982\u4e0b\uff1a<\/p>\n<pre><code class=\"language-shell\">[root@localhost ~]# yum -y  install   mariadb-server\n[root@localhost ~]# yum -y  install   mariadb\n[root@localhost ~]# yum -y  install   mariadb-devel<\/code><\/pre>\n<h4>\u5b89\u88c5PHP<\/h4>\n<p>\u4f7f\u7528PHP\u4f5c\u4e3aLNMP\u7684\u811a\u672c\u8bed\u8a00\u5d4c\u5165\u5230HTML\u4e2d\uff0c\u7528\u4e8eWeb\u5e94\u7528\u5f00\u53d1\u3002PHP\u5b89\u88c5\u5177\u4f53\u64cd\u4f5c\u5982\u4e0b\uff1a<\/p>\n<pre><code class=\"language-shell\">[root@localhost  ~ ]# yum -y install php \n[root@localhost  ~ ]# yum -y install php-fpm\n[root@localhost  ~ ]# yum -y install php-mysqlnd<\/code><\/pre>\n<p>\u4f7f\u7528 php-mysqlnd\u7ed9PHP\u5b89\u88c5\u6269\u5c55\u5e93\u6587\u4ef6\uff0c\u4f7f\u5f97PHP\u53ef\u4ee5\u8fde\u63a5MariaDB\u6570\u636e\u5e93.<\/p>\n<h4>\u542f\u52a8\u670d\u52a1<\/h4>\n<p>\u542f\u52a8Nginx\u670d\u52a1\uff1a<\/p>\n<pre><code class=\"language-shell\">[root@localhost ~]# \/usr\/local\/nginx\/sbin\/nginx<\/code><\/pre>\n<p>\u542f\u52a8MySQL\u670d\u52a1\uff1a<\/p>\n<pre><code class=\"language-shell\">[root@localhost ~]# systemctl start mariadb\n[root@localhost ~]# systemctl status mariadb\n[root@localhost ~]# systemctl enable mariadb<\/code><\/pre>\n<p>\u542f\u52a8PHP\u670d\u52a1\uff1a<\/p>\n<pre><code class=\"language-shell\">[root@localhost ~]# systemctl start php-fpm\n[root@localhost ~]# systemctl status php-fpm<\/code><\/pre>\n<p>\u6d4b\u8bd5\u662f\u5426\u5b89\u88c5\u6210\u529f\uff1a<\/p>\n<pre><code class=\"language-shell\">[root@zabbixserver conf]# vim \/usr\/local\/nginx\/html\/test.php\n&lt;?php\necho phpinfo();\n?&gt;<\/code><\/pre>\n<p><img data-recalc-dims=\"1\" decoding=\"async\" src=\"https:\/\/i0.wp.com\/xianyijitan.top\/wp-blog\/typora-user-images\/image-20230825175104941.png?w=960&#038;ssl=1\" alt=\"image-20230825175104941\" \/><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u5b89\u88c5Nginx,\u4e0b\u8f7dNginx\u8f6f\u4ef6\u5305 wget http:\/\/nginx.org\/download\/nginx-1.19.2.tar.gz # \u6216\u8005 curl -O http:\/\/nginx.org\/download\/nginx-1.19.2.tar.gz \u5bf9\u4e8eDebian\/Ubuntu\u7cfb\u7edf\uff1a sudo apt-get install wget curl \u5bf9\u4e8eCentOS\/RHEL\u7cfb\u7edf\uff1a sudo yum install wget curl \u8fdb\u884c\u6e90\u7801\u7f16\u8bd1\u5b89\u88c5Nginx\uff0c\u5177\u4f53\u64cd\u4f5c\u5982\u4e0b\uff1a [root@localhost ~]# tar -zxvf nginx-1.22.1.tar.gz [root@localhost ~]# cd nginx-1.22.1 [root@localhost nginx-1.22.1]# .\/configure \\ &gt; &#8211;prefix=\/usr\/local\/nginx \\ &gt; &#8211;with-http_ssl_module [root@localhost nginx-1.22.1]# make &amp;&amp; make install \u5b89\u88c5MariaDB LNMP\u67b6\u6784\u540e\u7aef\u4f7f\u7528MariaDB\u6570\u636e\u5e93\uff0c\u8bb0\u5f55\u5404\u79cd\u6570\u636e\u4fe1\u606f\uff0c\u5176\u4ed6\u7a0b\u5e8f\u901a\u8fc7SQL\u8bed\u53e5\u6765\u67e5\u8be2\u3001\u66f4\u6539\u8fd9\u4e9b\u4fe1\u606f\u3002MariaDB\u6570\u636e\u5e93\u76f4\u63a5\u4f7f\u7528yum\u8fdb\u884c\u5b89\u88c5\uff0c\u5177\u4f53\u64cd\u4f5c\u5982\u4e0b\uff1a [root@localhost ~]# yum -y install mariadb-server [root@localhost ~]# yum -y install mariadb [root@localhost ~]# yum -y install mariadb-devel \u5b89\u88c5PHP \u4f7f\u7528PHP\u4f5c\u4e3aLNMP\u7684\u811a\u672c\u8bed\u8a00\u5d4c\u5165\u5230HTML\u4e2d\uff0c\u7528\u4e8eWeb\u5e94\u7528\u5f00\u53d1\u3002PHP\u5b89\u88c5\u5177\u4f53\u64cd\u4f5c\u5982\u4e0b\uff1a [root@localhost ~ ]# yum -y install php [root@localhost ~ ]# yum -y install php-fpm [root@localhost ~ ]# yum -y install php-mysqlnd \u4f7f\u7528 php-mysqlnd\u7ed9PHP\u5b89\u88c5\u6269\u5c55\u5e93\u6587\u4ef6\uff0c\u4f7f\u5f97PHP\u53ef\u4ee5\u8fde\u63a5MariaDB\u6570\u636e\u5e93. \u542f\u52a8\u670d\u52a1 \u542f\u52a8Nginx\u670d\u52a1\uff1a [root@localhost ~]# \/usr\/local\/nginx\/sbin\/nginx \u542f\u52a8MySQL\u670d\u52a1\uff1a [root@localhost ~]# systemctl start mariadb [root@localhost ~]# systemctl status mariadb [root@localhost ~]# systemctl enable mariadb \u542f\u52a8PHP\u670d\u52a1\uff1a [root@localhost ~]# systemctl start php-fpm [root@localhost ~]# systemctl status php-fpm \u6d4b\u8bd5\u662f\u5426\u5b89\u88c5\u6210\u529f\uff1a [root@zabbixserver conf]# vim \/usr\/local\/nginx\/html\/test.php &lt;?php echo phpinfo(); ?&gt;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[6],"tags":[],"class_list":["post-144","post","type-post","status-publish","format-standard","hentry","category-lixx"],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/xianyijitan.top\/index.php?rest_route=\/wp\/v2\/posts\/144","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/xianyijitan.top\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/xianyijitan.top\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/xianyijitan.top\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/xianyijitan.top\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=144"}],"version-history":[{"count":4,"href":"https:\/\/xianyijitan.top\/index.php?rest_route=\/wp\/v2\/posts\/144\/revisions"}],"predecessor-version":[{"id":313,"href":"https:\/\/xianyijitan.top\/index.php?rest_route=\/wp\/v2\/posts\/144\/revisions\/313"}],"wp:attachment":[{"href":"https:\/\/xianyijitan.top\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=144"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/xianyijitan.top\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=144"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/xianyijitan.top\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=144"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}