WordPress五分钟极速安装教程

2020年2月16日20:49:38 发表评论 64 views

WordPress五分钟极速安装教程

主机空间要求

  • docker
  • docker-compose
  • 空间 :100m+

就够了,是的,就只要docker环境就够了

安装最新版Wordpress

  1. 创建一个空目录
  2. 按照我的目录结构创建好目录和文件
  3. 用我的docker-compose.yml
  4. 启动
  5. 用root用户手动连下数据库,创建一下wordpress库,然后给wordpress用户授权
grant all privileges on *.* to [email protected]'%' identified by 'xxxxxxxxx';

flush privileges;

docker-compose.yml 文件内容

version: '3.7'
services:
  wordpress:
    image: 'wordpress:latest'
    ports:
      - 9000:80
      - 443:443 
    depends_on:
      - db
    environment:
      WORDPRESS_DB_HOST: db
      WORDPRESS_DB_USER: wordpress
      WORDPRESS_DB_PASSWORD: xxxxxxxxx
      WORDPRESS_DB_NAME: wordpress
    restart: on-failure
    volumes:
      - './www:/var/www/html/'
      - '/etc/localtime:/etc/localtime:ro'
      - './conf/apache/crt:/etc/crt/'
      - './conf/apache/mods-enabled/socache_shmcb.load:/etc/apache2/mods-enabled/socache_shmcb.load'
      - './conf/apache/mods-enabled/ssl.load:/etc/apache2/mods-enabled/ssl.load'
      - './conf/apache/mods-enabled/ssl.conf:/etc/apache2/mods-enabled/ssl.conf'
      - './conf/apache/sites-enabled/000-default.conf:/etc/apache2/sites-enabled/000-default.conf'
      - './conf/apache/sites-enabled/default-ssl.conf:/etc/apache2/sites-enabled/default-ssl.conf'
      - './conf/apache/ports.conf:/etc/apache2/ports.conf'

  db:
    image: 'mysql:5.7'
    ports:
      - 3306:3306
    environment:
      MYSQL_ALLOW_EMPTY_PASSWORD: 'yes'
      MYSQL_ROOT_PASSWORD: xxxxxxxxx
      MYSQL_USER: wordpress
      MYSQL_PASSWORD: xxxxxxxxx
    volumes:
      - '/etc/localtime:/etc/localtime:ro'
      - '.docker-compose/mysql/db/conf.d:/etc/mysql/conf.d'
      - './mount_points/mysql/:/var/lib/mysql'

volumes:
  wordpress: {}
  db: {}

顺着安装

打开浏览器,输入域名,即可弹出安装界面。填上相关网站信息,点击”安装Wordpress”按钮即可完成。

WordPress五分钟极速安装教程

WordPress五分钟极速安装教程

完事

参考

http://www.yzipi.com/13.htm

weinxin
微信公众号
三分钟学习晦涩难懂的技术,分享开发、运维、云技术等方面知识,带您轻松打破技术壁垒,编程如鱼得水。欢迎您的关注~!
小熊

发表评论

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen: