一、环境准备

1、准备云服务器、公网ip、和域名,推荐用国外的,在国内使用服务器、公网ip和域名都需要备案的。

namecheap国外网站(最好用翻墙软件访问)
https://namecheap.com

3、源码包(需要准备lnmp脚本和wordpress包,都需要在官网下载)。

下载链接:

https://pan.baidu.com/share/init?surl=IO9YT6ChImSwQylR6CDqZw

提取码:srri

二、环境搭建

1、下载lnmp脚本并且执行。

wget http://soft.vpser.net/lnmp/lnmp1.8.tar.gz -cO lnmp1.8.tar.gz && tar zxf lnmp1.8.tar.gz && cd lnmp1.8 && ./install.sh lnmp

2、选择第7个。

+------------------------------------------------------------------------+
|          LNMP V1.8 for CentOS Linux Server, Written by Licess          |
+------------------------------------------------------------------------+
|        A tool to auto-compile & install LNMP/LNMPA/LAMP on Linux       |
+------------------------------------------------------------------------+
|           For more information please visit https://lnmp.org           |
+------------------------------------------------------------------------+
You have 11 options for your DataBase install.
1: Install MySQL 5.1.73
2: Install MySQL 5.5.62 (Default)
3: Install MySQL 5.6.51
4: Install MySQL 5.7.34
5: Install MySQL 8.0.25
6: Install MariaDB 5.5.68
7: Install MariaDB 10.1.48
8: Install MariaDB 10.2.38
9: Install MariaDB 10.3.29
10: Install MariaDB 10.4.19
0: DO NOT Install MySQL/MariaDB
Enter your choice (1, 2, 3, 4, 5, 6, 7, 8, 9, 10 or 0): 7
You will install MariaDB 10.1.48
===========================
Please setup root password of MySQL.
Please enter: 123.com
MySQL root password:                                           \\必须要填写密码
===========================
Do you want to enable or disable the InnoDB Storage Engine?
Default enable,Enter your choice [Y/n]: y
You will enable the InnoDB Storage Engine

3、安装PHP

You have 9 options for your PHP install.
1: Install PHP 5.2.17
2: Install PHP 5.3.29
3: Install PHP 5.4.45
4: Install PHP 5.5.38
5: Install PHP 5.6.40 (Default)
6: Install PHP 7.0.33
7: Install PHP 7.1.33
8: Install PHP 7.2.34
9: Install PHP 7.3.29
10: Install PHP 7.4.21
11: Install PHP 8.0.8
Enter your choice (1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11): 6       \\填写第6个,因为WordPress支持php7的版本
You will install PHP 7.0.33
===========================
You have 3 options for your Memory Allocator install.
1: Don't install Memory Allocator. (Default)
2: Install Jemalloc
3: Install TCMalloc
Enter your choice (1, 2 or 3):                                  \\直接回车
No input,You will not install Memory Allocator.Press any key to install...or Press Ctrl+c to cancel             \\直接回车,就执行安装了,然后打会儿游戏

6、将wordpress安装包上传到服务器里,然后创建/var/www/html目录,并且解压到/var/www/html目录下。

[root@rainlist ~]# mkdir -p /var/www/html
[root@rainlist ~]# tar xf wordpress-5.4.tar.gz  -C /var/www/html/                      \\解压到/var/www/html的目录下
[root@rainlist ~]# ls /var/www/html/wordpress
index.php    readme.html      wp-admin            wp-comments-post.php  wp-content   wp-includes        wp-load.php   wp-mail.php      wp-signup.php     xmlrpc.php
license.txt  wp-activate.php  wp-blog-header.php  wp-config-sample.php  wp-cron.php  wp-links-opml.php  wp-login.php  wp-settings.php  wp-trackback.php

5、安装完成后提示这个界面,并且访问一下是否正常。

Checking ...
Nginx: OK
MariaDB: OK
PHP: OK
PHP-FPM: OK
Clean Web Server src directory...
+------------------------------------------------------------------------+
|          LNMP V1.8 for CentOS Linux Server, Written by Licess          |
+------------------------------------------------------------------------+
|           For more information please visit https://lnmp.org           |
+------------------------------------------------------------------------+
|    lnmp status manage: lnmp {start|stop|reload|restart|kill|status}    |
+------------------------------------------------------------------------+
|  phpMyAdmin: http://IP/phpmyadmin/                                     |
|  phpinfo: http://IP/phpinfo.php                                        |
|  Prober:  http://IP/p.php                                              |
+------------------------------------------------------------------------+
|  Add VirtualHost: lnmp vhost add                                       |
+------------------------------------------------------------------------+
|  Default directory: /home/wwwroot/default                              |
+------------------------------------------------------------------------+
|  MySQL/MariaDB root password: 123.com                          |
+------------------------------------------------------------------------+
+-------------------------------------------+
|    Manager for LNMP, Written by Licess    |
+-------------------------------------------+
|              https://lnmp.org             |
+-------------------------------------------+
nginx (pid 7532) is running...
php-fpm is runing!SUCCESS! MariaDB running (7888)
State      Recv-Q Send-Q Local Address:Port               Peer Address:Port
LISTEN     0      128          *:80                       *:*
LISTEN     0      128          *:22                       *:*
LISTEN     0      128         :::3306                    :::*
Install lnmp takes 45 minutes.
Install lnmp V1.8 completed! enjoy it.

6、用google浏览器访问测试,如果访问正常就没问题了。

7、修改nginx.conf文件的网站路径。


[root@localhost ~]# cd /usr/local/nginx/conf/
[root@localhost conf]# cp -a nginx.conf{,.bak}    \\备份nginx.conf文件,方便以后使用
[root@localhost conf]# ls
enable-php.conf           example       fastcgi.conf.default  fastcgi_params.default  koi-win     mime.types.default  nginx.conf.bak      pathinfo.conf  scgi_params          uwsgi_params          vhost
enable-php-pathinfo.conf  fastcgi.conf  fastcgi_params        koi-utf                 mime.types  nginx.conf          nginx.conf.default  rewrite        scgi_params.default  uwsgi_params.default  win-utf
[root@localhost conf]# vim nginx.conf    \\修改以下内容
63 server64      {65          listen 80 default_server reuseport;66          #listen [::]:80 default_server ipv6only=on;67          server_name _;68          index index.html index.htm index.php;69          root  /var/www/html/wordpress;                      \\默认路径是/home/wwwroot/default,给它改成/var/www/html/wordpress7071          #error_page   404   /404.html;

8、创建wordpress数据库,然后退出。

[root@localhost ~]# mysql -u root -p
Enter password:
Welcome to the MariaDB monitor.  Commands end with ; or \g.
Your MariaDB connection id is 4
Server version: 10.1.48-MariaDB Source distributionCopyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.MariaDB [(none)]> create database wordpress;
Query OK, 1 row affected (0.00 sec)MariaDB [(none)]> show databases;
+--------------------+
| Database           |
+--------------------+
| information_schema |
| mysql              |
| performance_schema |
| wordpress          |
+--------------------+
4 rows in set (0.01 sec)MariaDB [(none)]> quit;

9、修改wp-config.php文件。

[root@rainlist ~]# cd /var/www/html/wordpress/
[root@rainlist wordpress]# ls
index.php    readme.html      wp-admin            wp-comments-post.php  wp-content   wp-includes        wp-load.php   wp-mail.php      wp-signup.php     xmlrpc.php
license.txt  wp-activate.php  wp-blog-header.php  wp-config-sample.php  wp-cron.php  wp-links-opml.php  wp-login.php  wp-settings.php  wp-trackback.php
[root@rainlist wordpress]# cp wp-config-sample.php wp-config.php                            \\把wp-config-sample.php复制成wp-config.php
[root@rainlist wordpress]# vim wp-config.php                                                \\编辑wp-config.php文件\\请修改以下内容// ** MySQL settings - You can get this info from your web host ** //
/** The name of the database for WordPress */
define( 'DB_NAME', '数据库名称' );/** MySQL database username */
define( 'DB_USER', '数据库用户' );/** MySQL database password */
define( 'DB_PASSWORD', '数据库密码' );                                        \\修改完成后,然后保存退出

10、重启lnmp服务。

[root@localhost ~]# lnmp restart
+-------------------------------------------+
|    Manager for LNMP, Written by Licess    |
+-------------------------------------------+
|              https://lnmp.org             |
+-------------------------------------------+
Stoping LNMP...
Stoping nginx...  done
Stopping mariadb (via systemctl):                          [  OK  ]
Gracefully shutting down php-fpm . done
Starting LNMP...
Starting nginx...  done
Starting mariadb (via systemctl):                          [  OK  ]
Starting php-fpm  done

三、配置wordpress

1、重启lnmp后,直接在浏览器里访问http://你的ip地址,修改以下内容。


注意:配置好后,会显示log in界面。直接登录即可。

2、登录wordpress并且修改成中文版。

注意:因为是英文版,需要在官网上下中文版,然后在中文版找到languages文件夹,上传到服务器里,复制到/var/www/html/wordpress/wp-content的文件下。

四、关于主题的设置。

  1. 登录WordPress控制面板

  2. 点击外观 – 主题

  3. 在右侧主题,点击添加

  4. 在添加主题页面,点击上传主题

  5. 在文件浏览窗口选择要上传的主题,注意一定要是zip格式的主题,如果不是,先自行压缩一下

  6. 上传完成后点击现在安装

  7. 安装完成后,就可以预览或者启用这个主题了

五、域名绑定

1、我目前用的是阿里云的服务器以及域名,因为做了网站后需要备案,就先省略那个操作,接下来看一下以下图形,看看我是怎么操作的。登录阿里云然后找到域名,点击解析设置。

2、点击添加记录。

3、直接添加两个A记录。

4、修改主机名和hosts文件,主机名和hosts文件里,必须是你的域名,否则访问不到。

[root@localhost ~]# hostnamectl set-hostname rainlist && bash
[root@rainlist ~]# vim /etc/hosts
127.0.0.1   localhost localhost.localdomain localhost4 localhost4.localdomain4
::1         localhost localhost.localdomain localhost6 localhost6.localdomain6
123.56.222.102  rainlist.top

Linux网站服务之部署Wordpress教程相关推荐

  1. linux中apache配置文件在哪,linux网站服务Apache的安装与配置方法详解

    这篇文章介绍下linux网站服务apache的安装与配置方法,包括挂载光盘,安装http服务,管理httpd服务,httpd的配置文件几大部分.具体详情可以参考下文. 1.挂载光盘 自己习惯将光盘挂载 ...

  2. 个人网站学习实践(wordpress教程)

    个人网站学习实践(wordpress教程) from: http://www.xifengxx.com/wordpress-study 序: 还在上大学的时候,便有建立个人网站的想法. 那时清闲,去图 ...

  3. 完美世界服务端linux,完美世界服务端视频架设教程

    完美世界服务端视频架设教程 完美世界服务端视频架设教程 系统运行库: libtask.tar.gz compat-libstdc++-33-3.2.3-61.i386.rpm pcre-7.0-2.i ...

  4. 网站服务以及部署网站论坛discuz与网络论坛WordPress

    网站架构   LAMP   Linux+Apache+MySQL+PHP 系统+服务器程序+数据管理软件+中间软件 静态网站:Apache:服务端口:80/tcp(http)443/tcp(https ...

  5. Linux常用服务安装部署

    1,centos7默认是装有python的,检查python版本的命令 # 检查python版本 : python -V 2,centOS在安装python3以及tab补全功能 下载python3源码 ...

  6. Linux网络服务之部署YUM仓库

    镜像下载.域名解析.时间同步请点击 阿里云开源镜像站 1 YUM简介 1.1 YUM简介 CentOS使用yum和dnf 解决rpm的包依赖关系. YUM:rpm的前端程序,可解决软件包相关依赖性,可 ...

  7. linux网站服务及开源论坛Discuz

    安装Apache yum -y install httpd //安装 systemctl start httpd //启动 systemctl enable httpd //开机自启 systemct ...

  8. Linux网站服务Apache+php+mysql的安装

    1.挂载光盘 [root@localhost /]#mkdir /media/cdrom[root@localhost /]# mount /dev/cdrom /media/cdrom/ 2.安装本 ...

  9. Ruoyi-Vue在Linux云服务器上部署的记录和体会

    本文仅供调侃和有限参考,愿各位共勉之: "山穷水尽疑无路,柳暗花明又一村" 文章目录 1. 本文目标 2. 服务器 3. 运维工具 4. 正式部署 4.1. 设置参数 4.2. 打 ...

  10. 服务器部署sas_如何在阿里云SAS上部署WordPress网站

    服务器部署sas This article was created in partnership with Alibaba Cloud. Thank you for supporting the pa ...

最新文章

  1. Java查询大文本文件的处理方法
  2. 【WebPack】WebPack的安装、使用WebPack打包 js/css/img 等文件
  3. POJ 2353 DP
  4. Java开发必看JPA概念大全
  5. 聊题“谈、闲、想、省”
  6. delphi 鼠标获取窗口句柄_Python 脚本自动对窗口进行截图
  7. VWware虚拟机如何设置固定的IP地址(详细步骤)
  8. 两篇超好的C#操作并口和串口的文章
  9. ChAMP包处理甲基化芯片数据
  10. [译]使用MVI打造响应式APP(三):状态折叠器
  11. Oracle数据库update语句用法,多表批量更新对应的字段值
  12. Cobalt Strike客户端连接被拒绝
  13. 100个实用的 Linux Shell 脚本经典案例,收藏备用~
  14. 程序员如何保持身体健康?
  15. matlab累积分布图绘制cdfplot
  16. 信息学奥赛/CSP/NOIP是什么?怎么规划?
  17. 基于单片机的数字温度计及电压表
  18. 分治法解决循环赛日程表
  19. 2022-02-11 Android 弹出申请访问权限,动态访问权限弹窗,比如存储权限
  20. 本人的嵌入式职业英文记录 - 第2周

热门文章

  1. 数据可视化之美:桑基图的前世今生
  2. 智慧高铁、智慧机场对护照阅读器的应用 SDK说明
  3. 应用之星破除行业门槛 零成本开发手机应用
  4. Problem 1 : Multiples of 3 and 5
  5. Concatenated Multiples(串联倍数)
  6. 【验证小bai】乐于助人·比特序列匹配电路RTL验证环境笔试实操
  7. GPU和CPU计算速度
  8. 网络机顶盒固件提取、编辑和打包
  9. Scala Test
  10. 【Unity】跨场景音乐资源不间断播放(可控音量)