iis服务器助手广告广告
返回顶部
首页 > 资讯 > CMS >Nginx服务LNMP中WordPress部署流程步骤的示例分析
  • 782
分享到

Nginx服务LNMP中WordPress部署流程步骤的示例分析

2023-06-29 14:06:54 782人浏览 薄情痞子
摘要

这篇文章主要为大家展示了“Nginx服务LNMP中WordPress部署流程步骤的示例分析”,内容简而易懂,条理清晰,希望能够帮助大家解决疑惑,下面让小编带领大家一起研究并学习一下“Nginx服务LNMP中WordPress部署流程步骤的示

这篇文章主要为大家展示了“Nginx服务LNMP中WordPress部署流程步骤的示例分析”,内容简而易懂,条理清晰,希望能够帮助大家解决疑惑,下面让小编带领大家一起研究并学习一下“Nginx服务LNMP中WordPress部署流程步骤的示例分析”这篇文章吧。

    实验环境

    实验环境:

    [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

    软件版本:

    NGINX:nginx-1.12.2.tar.gzMYSQLMysql-5.6.47-linux-glibc2.12-x86_64.tar.gzPHPphp-5.5.3.tar.gzlibiconv:libiconv-1.16.tar.gzwordpress:wordpress-4.7.3-zh_CN.tar.gz

    安装Nginx服务

    Nginx服务部署过程:

    请参考:小白也可以完成的0基础部署Nginx服务

    安装mysql数据库

    下载二进制Mysql包:

    [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

    解压MySQL包:

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

    创建MySQL用户及授权:

    [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/

    初始化MySQL:

    第一遍初始化报错,然后我把data目录下东西干掉后就好了。什么原理?

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

    制作MySQL启动脚本:

    [root@lnmp data]# cp /app/mysql/support-files/mysql.server /etc/init.d/mysqld cp:是否覆盖"/etc/init.d/mysqld"? y[root@lnmp mysql]# sed -ri 's#/usr/local#/app#g' /etc/init.d/mysqld /app/mysql/bin/mysqld_safe

    创建配置文件:

    [root@lnmp mysql]# cp /app/mysql/support-files/my-default.cnf /etc/my.cnf cp:是否覆盖"/etc/my.cnf"? y

    启动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

    设置环境变量:

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

    登录数据库

    因为初始密码为空,所以登录后要修改密码

    [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 -u root 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>

    安装PHP

    下载PHP包及liblconv包:

    [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

    安装依赖包:

    [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

    编译安装语言转换工具

    [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

    解压PHP包进行预编译:

    [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 --enable-xml --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

    防报错处理:

    [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

    编译安装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总用量 28-rw-r--r-- 1 root root  1152 8月  25 06:39 pear.conf-rw-r--r-- 1 root root 21846 8月  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:9000

    启动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        0      0 172.16.1.30:9000            0.0.0.0:*                   LISTEN      39741/php-fpm

    修改Nginx配置文件

    [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:9000;                   fastcgi_index index.php;                   include fastcgi.conf;             }     }        error_page   500 502 503 504  /50x.html;        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

    重新启动Nginx服务:

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

    测试

    [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 <?phpphpinfo();?>网页访问:192.168.1.30/test_php.php出现php页面,代表正常

    部署WordPress个人博客

    下载安装包:

    [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

    部署站点:

    [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/

    创建数据库信息:

    [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';Query OK, 0 rows affected (0.04 sec)

    登录网站配置网站:

    http://ip/wp-admin

    Nginx服务LNMP中WordPress部署流程步骤的示例分析

    主机默认localhost。截错了

    Nginx服务LNMP中WordPress部署流程步骤的示例分析

    Nginx服务LNMP中WordPress部署流程步骤的示例分析

    Nginx服务LNMP中WordPress部署流程步骤的示例分析

    以上是“Nginx服务LNMP中WordPress部署流程步骤的示例分析”这篇文章的所有内容,感谢各位的阅读!相信大家都有了一定的了解,希望分享的内容对大家有所帮助,如果还想学习更多知识,欢迎关注编程网CMS频道!

    --结束END--

    本文标题: Nginx服务LNMP中WordPress部署流程步骤的示例分析

    本文链接: https://www.lsjlt.com/news/325189.html(转载时请注明来源链接)

    有问题或投稿请发送至: 邮箱/279061341@qq.com    QQ/279061341

    本篇文章演示代码以及资料文档资料下载

    下载Word文档到电脑,方便收藏和打印~

    下载Word文档
    猜你喜欢
    • Nginx服务LNMP中WordPress部署流程步骤的示例分析
      这篇文章主要为大家展示了“Nginx服务LNMP中WordPress部署流程步骤的示例分析”,内容简而易懂,条理清晰,希望能够帮助大家解决疑惑,下面让小编带领大家一起研究并学习一下“Nginx服务LNMP中WordPress部署流程步骤的示...
      99+
      2023-06-29
    • Nginx服务LNMP之WordPress部署流程步骤
      目录实验环境安装Nginx服务安装Mysql数据库安装PHP修改Nginx配置文件部署WordPress个人博客实验环境 实验环境: [root@lnmp ~]# uname -r ...
      99+
      2024-04-02
    • 在nginx中部署https服务,详细步骤
      目录 前言 一、https是什么? 二、部署步骤 1.下载SSL证书 2.上传文件 3.解压文件 4.在nginx.conf配置文件中,修改https服务 5.修改hosts文件 6.http跳转到https中 三、注意事项 前言 Web...
      99+
      2023-08-31
      nginx 运维 服务器 https
    • 基于Vue+Nginx前后端不分离部署的示例分析
      这篇文章主要介绍基于Vue+Nginx前后端不分离部署的示例分析,文中介绍的非常详细,具有一定的参考价值,感兴趣的小伙伴们一定要看完!一、在这里我前端vue项目使用vue cli脚手架进行搭建的,后台使用N...
      99+
      2024-04-02
    • Nginx搭建图片视频服务器的部署步骤
      目录1 前言1.1 关于视频1.2 关于图片2 搭建图片服务器2.1 配置文件2.2 显示效果3 搭建视频服务器3.1 添加视频模块3.2 配置文件3.3 展示1 前言 首先是俩故事...
      99+
      2024-04-02
    • jenkins+gitlab+nginx部署前端应用实现的示例分析
      这篇文章将为大家详细讲解有关jenkins+gitlab+nginx部署前端应用实现的示例分析,小编觉得挺实用的,因此分享给大家做个参考,希望大家阅读完这篇文章后可以有所收获。相关依赖安装docker由于国内安装太慢,所以可以使用 http...
      99+
      2023-06-15
    • Tomcat9请求处理流程与启动部署过程的示例分析
      这篇文章主要为大家展示了“Tomcat9请求处理流程与启动部署过程的示例分析”,内容简而易懂,条理清晰,希望能够帮助大家解决疑惑,下面让小编带领大家一起研究并学习一下“Tomcat9请求处理流程与启动部署过程的示例分析”这篇文章吧。Over...
      99+
      2023-06-02
    • IDEA2022中部署TomcatWeb项目的流程分析
      目录使用工具:1.下载Tomcat:1.1.Tomcat启动、关闭。卸载:在Tomcat在启动Web项目:2.在IDEA中构建Maven Web项目  2.1.使用模板构建2.2.不...
      99+
      2023-05-13
      idea部署Tomcat项目 idea配置部署Tomcat
    • Vue项目打包并部署nginx服务器的详细步骤
      目录使用场景:一.打包二.部署(nginx)总结使用场景: 我们常使用前后端分离项目时,会需要将前端vue打包然后部署。 一.打包 vue项目其实可以直接通过一下语句进行打包: np...
      99+
      2024-04-02
    • 前端将项目部署到服务器(Nginx)的完整步骤
      目录一、准备环境二、安装Nginx1、 安装Nginx依赖2、下载Nginx3、解压下载好的Nginx 压缩包4、编译安装Nginx5、启动Nginx服务三、操作步骤1、使用Xshe...
      99+
      2023-01-12
      前端项目部署到nginx服务器 前端项目怎么部署到服务器上 nodejs部署前端项目
    • 阿里云服务器成功部署的过程步骤解析
      在数字化时代,云计算服务已经成为企业级应用的首选。本文将详细介绍阿里云服务器成功部署的过程,包括准备阶段、创建云服务器、连接云服务器、配置服务器环境和部署应用程序等步骤。 一、准备阶段在开始部署阿里云服务器之前,首先需要进行一些准备工作。这...
      99+
      2023-11-19
      阿里 步骤 过程
    • 远程部署亚马逊服务器的步骤
      1. 创建亚马逊 Web 服务(AWS)账户 首先,你需要在亚马逊网站上创建一个 AWS 账户。访问 AWS 官方网站并按照指示注册一个账户。完成注册后,你将获得一个访问 AWS 服务的凭证。 2. 启动亚马逊 EC2 实例 EC2 是亚...
      99+
      2023-10-27
      亚马逊 步骤 服务器
    • Docker部署服务的坑实例分析
      这篇文章主要讲解了“Docker部署服务的坑实例分析 ”,文中的讲解内容简单清晰,易于学习与理解,下面请大家跟着小编的思路慢慢深入,一起来研究和学习“Docker部署服务的坑实例分析 ”吧!本项目采用的是s...
      99+
      2024-04-02
    • CentOs中Solr6.2.1单机安装部署的示例分析
      这篇文章主要介绍CentOs中Solr6.2.1单机安装部署的示例分析,文中介绍的非常详细,具有一定的参考价值,感兴趣的小伙伴们一定要看完!Solr体系结构图开始安装:到网站http://lucene.apache.org/solr/dow...
      99+
      2023-06-03
    • php中PHPCMS流程图的示例分析
      小编给大家分享一下php中PHPCMS流程图的示例分析,相信大部分人都还不怎么了解,因此分享这篇文章给大家参考一下,希望大家阅读完这篇文章后大有收获,下面让我们一起去了解一下吧!首先要知道PHPCMS这个系...
      99+
      2024-04-02
    • Koa服务限流的示例分析
      小编给大家分享一下Koa服务限流的示例分析,相信大部分人都还不怎么了解,因此分享这篇文章给大家参考一下,希望大家阅读完这篇文章后大有收获,下面让我们一起去了解一下吧!koa 中间件不调用 next最初的想法...
      99+
      2024-04-02
    • 基于Centos7系统一键部署EFK服务的示例分析
      本篇文章给大家分享的是有关基于Centos7系统一键部署EFK服务的示例分析,小编觉得挺实用的,因此分享给大家学习,希望大家阅读完这篇文章后可以有所收获,话不多说,跟着小编一起来看看吧。最近平台EFK版本均作了升级,平台采用EFK(Elas...
      99+
      2023-06-05
    • Promise中异步编程的示例分析
      这篇文章主要介绍Promise中异步编程的示例分析,文中介绍的非常详细,具有一定的参考价值,感兴趣的小伙伴们一定要看完!实例如下所示://1.解决异步回调问题 //1.1 如何同步异步请求 //如...
      99+
      2024-04-02
    • JavaScript中异步编程的示例分析
      这篇文章给大家分享的是有关JavaScript中异步编程的示例分析的内容。小编觉得挺实用的,因此分享给大家做个参考,一起跟随小编过来看看吧。目的提升开发效率,编写易维护的代码引子问题请求时候为什么页面卡死??$.ajax({ &n...
      99+
      2023-06-15
    • c#中异步编程的示例分析
      这篇文章给大家分享的是有关c#中异步编程的示例分析的内容。小编觉得挺实用的,因此分享给大家做个参考,一起跟随小编过来看看吧。一、什么算异步?  广义来讲,两个工作流能同时进行就算异步,例如,CPU与外设之间的工作流就是异步的。在面向服务的系...
      99+
      2023-06-14
    软考高级职称资格查询
    编程网,编程工程师的家园,是目前国内优秀的开源技术社区之一,形成了由开源软件库、代码分享、资讯、协作翻译、讨论区和博客等几大频道内容,为IT开发者提供了一个发现、使用、并交流开源技术的平台。
    • 官方手机版

    • 微信公众号

    • 商务合作