李明
|
安装截图说话
官网安装教程:
wordpress中文安装教程
image.png
image.png
官网的安装步骤一步两步直接五六步
1.安装docker
sudo yum update
vi /etc/yum.repos.d/docker.repo 写入下面的内容 [dockerrepo] name=Docker Repository baseurl=https://yum.dockerproject.org/repo/main/centos/$releasever/ enabled=1 gpgcheck=1 gpgkey=https://yum.dockerproject.org/gpg
sudo yum install docker-engine curl -sSL https://get.daocloud.io/daotools/set_mirror.sh | sh -s http://b81aace9.m.daocloud.io
sudo service docker restart 2.docker-compose
curl -L https://github.com/docker/compose/releases/download/1.8.0/docker-compose-`uname -s`-`uname -m` > /usr/local/bin/docker-compose && chmod +x /usr/local/bin/docker-compose
docker-compose --version 3.wordpress安装
mkdir myblog && cd myblog
vi docker-compose.yml 写入下面的内容 version: '2'services: db: image: mysql:5.7 volumes: - db_data:/var/lib/mysql restart: always environment: MYSQL_ROOT_PASSWORD: your-mysql-root-password MYSQL_DATABASE: wordpress MYSQL_USER: wordpress MYSQL_PASSWORD: wordpress wordpress: depends_on: - db image: wordpress:latest volumes: - wp_site:/var/www/html ports: - "80:80" - "443:443" restart: always environment: WORDPRESS_DB_HOST: db:3306 WORDPRESS_DB_USER: wordpress WORDPRESS_DB_PASSWORD: wordpress volumes: db_data: wp_site:
docker-compose up -d 访问虚拟机的路径查看效果http://192.168.30.5
大功告成 PS:docker的魅力就是这样,有点类似java的maven将该依赖的都自动关联起来,只要写好配置文件 问题收集回复:
sudo docker container ls #查找到wordpress的容器IDdocker exec -it 容器ID /bin/bash mv /etc/apt/sources.list /etc/apt/sources.list.bakecho "deb http://mirrors.163.com/debian/ jessie main non-free contrib" >/etc/apt/sources.listecho "deb http://mirrors.163.com/debian/ jessie-proposed-updates main non-free contrib" >>/etc/apt/sources.listecho "deb-src http://mirrors.163.com/debian/ jessie main non-free contrib" >>/etc/apt/sources.listecho "deb-src http://mirrors.163.com/debian/ jessie-proposed-updates main non-free contrib" >>/etc/apt/sources.list#更新安装源apt-get update #安装命令apt-get install -y vim vim wp-config.php
查找define('WPLANG', '');一行,在第二个参数处填入zh_CN,变成define('WPLANG', 'zh_CN');并保存文件。 往期精彩 |
2018-08-08 11:52:24