WordPress五分钟极速安装教程

小熊 网站建设评论6,049字数 1454阅读4分50秒阅读模式

WordPress五分钟极速安装教程

主机空间要求

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

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

安装最新版Wordpress

  1. 创建一个空目录
  2. 按照我的目录结构创建好目录和文件
  3. 用我的docker-compose.yml
  4. 启动
  5. 用root用户手动连下数据库,创建一下wordpress库,然后给wordpress用户授权
grant all privileges on *.* to wordpress@'%' 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
公众号
扫码订阅最新深度技术文,回复【资源】获取技术大礼包
小熊