• 001.WordPress建站部署


    一 WordPress简介

    WordPress是一种使用PHP语言开发的博客平台,用户可以在支持PHP和MySQL数据库的服务器上架设属于自己的网站。也可以把 WordPress当作一个内容管理系统CMS)来使用。
    本内容基于Linux的LAMP平台构建个人博客站点。

    二 环境

    • LAMP平台
    • 域名:www.imxhy.cn
    • IP:172.24.8.100

    三 部署

    3.1 Linux服务器上部署LAMP环境

    注意:可采用yum快速部署,并安装相应php-mysql。
    [root@imxhy ~]# yum install wget unzip httpd mariadb-server mariadb php php-mbstring php-mysql php-gd

    3.2 下载对应的程序包

    https://cn.wordpress.org/,官网下载对应的程序包。
    https://cn.wordpress.org/wordpress-4.7.4-zh_CN.tar.gz

    3.3 上传程序并解压

    将程序上传至Linux服务器/root/mytmp
    [root@imxhy mytmp]# tar -xzf wordpress-4.5.3-zh_CN.tar.gz #解压WordPress
    [root@imxhy mytmp]# mkdir -p /var/www/html/wordpress/ #创建WordPress的网页主目录
    [root@imxhy mytmp]# cp wordpress/* /var/www/html/wordpress/ #复制WordPress至网页主目录

    3.4 配置并修改

    新建Apache虚拟机
      1 [root@imxhy ~]# cp /usr/share/doc/httpd-2.4.6/httpd-vhosts.conf /etc/httpd/conf.d/vhosts.conf
      2 [root@imxhy conf.d]# vi vhosts.conf
      3 <VirtualHost *:80>
      4 ServerAdmin x120952576@126.com					#管理者邮箱
      5 DocumentRoot "/var/www/html/wordpress"				#主目录
      6 ServerName imxhy.cn							#域名
      7 ServerAlias www.imxhy.com
      8 ErrorLog "/var/log/httpd/imxhy_error"
      9 CustomLog "/var/log/httpd/imxhy_access" common
     10 </VirtualHost>
     

    四 测试并链接数据库

    浏览器输入172.24.8.100

    4.1 创建数据库

      1 [root@imxhy conf.d]# mysql_secure_installation		#建议设置相关安全性
      2 MariaDB [(none)]> create databases wordpress;
      3 ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'databases wordpress' at line 1
      4 MariaDB [(none)]>
      5 MariaDB [(none)]>
      6 MariaDB [(none)]> create database wordpress;       		#创建一个新的数据库WordPress
      7 Query OK, 1 row affected (0.00 sec)
      8 MariaDB [(none)]> grant all privileges on *.* to mysql@'localhost' identified by 'x7374521*'; #新建最高权限的管理账户mysql
      9 Query OK, 0 rows affected (0.00 sec)
     10 MariaDB [(none)]> grant all privileges on wordpress.* to xhy@'localhost' identified by 'x120952576'; #新建对WordPress具有所有权限的账户xhy
     11 Query OK, 0 rows affected (0.00 sec)
     12 MariaDB [(none)]> flush privileges;				#刷新权限
     13 Query OK, 0 rows affected (0.00 sec)
     
    01

    4.2 其他配置

      1 [root@imxhy ~]# chown -R apache /var/www/html/wordpress/
      2 [root@imxhy ~]# systemctl restart httpd.service
     

    五 建立数据表

    5.1 登录WordPress

    02
    #填入之前创建的数据库名字和密码
    03
    #创建站点相关信息
    04
    #测试成功
  • 相关阅读:
    Python在计算内存时应该注意的问题?
    如何高效地远程部署?自动化运维利器 Fabric 教程
    强大的 Python 任务自动化工具!invoke 十分钟入门指南
    进一步学习 nox 教程,轻松掌握命令行用法
    Oracle Solaris 11.4安装桌面/gdb
    Solaris 10上Oracle 10g安装步骤图解
    Oracle Solaris 10图文安装
    读取模式下cbc latch的事件模拟(热块竞争和热链竞争)-P62
    关于位图数据位和系统管理区大小-P6
    关于位图数据和标记位-P3
  • 原文地址:https://www.cnblogs.com/itzgr/p/9962540.html
Copyright © 2020-2023  润新知