[root@centos181001 home]# cat /etc/centos-release
CentOS Linux release 7.6.1810 (Core)
MySQL version 5.6 OR MariaDB version 10.0 or greater.
1.设置官方YUM源
cat </etc/yum.repos.d/mariadb.repo
[mariadb]
name = MariaDB
baseurl = http://yum.mariadb.org/10.3/centos7-amd64
gpgkey=https://yum.mariadb.org/RPM-GPG-KEY-MariaDB
gpgcheck=1
EOF
2.安装并设置开机自动启动
yum install -y MariaDB-server MariaDB-client
systemctl enable mariadb
systemctl start mariadb
systemctl status mariadb
1.设置Tengine官方YUM源:CentOS7
curl -o /etc/yum.repos.d/opsx-centos7.repo https://mirrors.aliyun.com/opensource/149994924900000037/opsx/centos7/opsx-centos7.repo
yum clean all #清理本地缓存
yum clean plugins #清理插件缓存
yum makecache #构建缓存
2.安装Tengine并启动
yum install -y tengine
/opt/tengine/sbin/nginx
3.配置文件路径
默认安装路径在:/opt/tengine
# 测试配置文件是否正确
/opt/tengine/sbin/nginx -t
4.优雅的重启(重载配置文件,如果配置文件有错误的话,会继续使用之前配置运行)
/opt/tengine/sbin/nginx -s reload
-s stop 快速停止
-s quit 优雅的退出
-s reopen 重新打开日志文件
-s reload 重新加载配置文
docker pull wordpress:5.0.3-php7.1-apache
docker pull mysql:5.7.25
docker run --name some-mysql -e MYSQL_ROOT_PASSWORD=xiaoliu -d mysql:5.7.25
docker run --name some-wordpress --link some-mysql:mysql -p 8080:80 -d wordpress:5.0.3-php7.1-apache
http://11.11.11.61:8080
docker stack deploy
或docker-compose
cat </home/wordpress.yml
version: '3.1'
services:
wordpress:
image: wordpress:5.0.3-php7.1-apache
restart: always
ports:
- 8080:80
environment:
WORDPRESS_DB_HOST: db
WORDPRESS_DB_USER: exampleuser
WORDPRESS_DB_PASSWORD: examplepass
WORDPRESS_DB_NAME: exampledb
db:
image: mysql:5.7.25
restart: always
environment:
MYSQL_DATABASE: exampledb
MYSQL_USER: exampleuser
MYSQL_PASSWORD: examplepass
MYSQL_RANDOM_ROOT_PASSWORD: '1'
EOF
docker stack deploy -c wordpress.yml wordpress
docker-compose -f wordpress.yml up
http://11.11.11.61:8080
如果WORDPRESS_DB_NAME给定的MySQL服务器上尚未存在指定的,则在启动wordpress容器时将自动创建,只要WORDPRESS_DB_USER指定的具有创建它的必要权限。