公有云
1.安装apache,PHP服务
yum -y install httpd php php-fpm php-server php-mysql
systemctl restart httpd
systemctl enable httpd
systemctl restart php-fpm
systemctl enable php-fpm
记得加上新的安全组web
主机一主机二同操作
查看php版本信息
echo "<?php echo phpinfo();?>" > /var/www/html/index.php
2.在database上部署mysql服务
yum remove MariaDB* -y
wget -i -c http://dev.mysql.com/get/mysql57-community-release-el7-10.noarch.rpm
yum -y install mysql57-community-release-el7-10.noarch.rpm
yum -y install mysql-community-server
grep 'temporary password' /var/log/mysqld.log
##查找MySQL初始密码
mysql_secure_installation
update user set host='%' where user='root' LIMI 1;
flush privileges;
在node主机上安装mysql:yum install -y mysql
在database上创建数据库:
使用现有软件包在node1、node2安装Discuz网站。
wget http://download.comsenz.com/DiscuzX/3.3/Discuz_X3.3_SC_UTF8.zip
ll
unzip Discuz_X3.3_SC_UTF8.zip
unzip Discuz_X3.3_SC_UTF8.zip -d /var/www/html/
cd /var/www/html/
rm -rf readme utility
rm -rf index.php
mv upload/* .
cd ..
chmod 777 -R html
cd html/
[root@node-0002 html]# vim config/config_global.php
redis上操作:
yum install -y yum-utils device-mapper-persistent-data lvm2
cd /home/
vim docker.sh
docker脚本:
#!/bin/bash
yum update -y
yum-config-manager \--add-repo \https://download.docker.com/linux/centos/docker-ce.repo
sed -i 's+download.docker.com+mirrors.aliyun.com/docker-ce+'/etc/yum.repos.d/docker-ce.repo
yum install -y yum-utils device-mapper-persistent-data lvm2
yum list docker-ce --showduplicates | sort -r
yum install docker-ce -y
systemctl start docker
systemctl enable docker
redis安装脚本:
#!/bin/bash
docker search redis
docker pull redis
docker images
mkdir /usr/local/docker
cd /usr/local/docker
yum -y install wget
wget http://download.redis.io/redis-stable/redis.conf
sed -i 's/bind127.0.0.1/#bind127.0.0.1/g' /usr/local/docker/redis.conf
sed -i 's/protected-mode yes/protected-mode no/g' /usr/local/docker/redis.conf
docker run -itd --name redis-test -p 6379:6379 redis
docker run -itd -p 192.168.100.10:6379:6379 --name redis -v /usr/local/docker/redis.conf:/etc/redis/redis.conf -v /usr/local/docker/data:/data redis redis-server /etc/redis/redis.conf
docker start redis
docker ps -a
docker exec -it redis-test bash
- 点赞
- 收藏
- 关注作者
评论(0)