其他分享
首页 > 其他分享> > 三、LVS集权的搭建-搭建LAMP分离结构

三、LVS集权的搭建-搭建LAMP分离结构

作者:互联网

3.1 服务器分类
-应用服务器-web服务器。
-数据库服务器:mysql
-文件服务器:存静态文件
3.2 准备4台服务器
ip地址 hostname
192.168.4.1 mysql
192.168.4.2 web1
192.168.4.3 web2
192.168.4.4 LVS
3.3 配置mysql服务器(这儿为了方便我选用的mariadb)
[root@mysql ~]# yum -y install mariadb-server
[root@mysql ~]# systemctl start mariadb.service
[root@mysql ~]# systemctl enable mariadb.service
MariaDB [(none)]> grant all on *.* to 'admin'@'%' identified by "123456";
注:上述操作在mysql服务器上完成
3.4 在两台web服务器上安装web服务
[root@web1 ~]# yum install -y httpd php php-mysql
[root@web1 ~]# systemctl start httpd
[root@web1 ~]# systemctl enable httpd
3.5 在web1上部署Discuz
[root@web1 ~]# unzip Discuz_X3.3_SC_UTF8.zip
[root@web1 ~]# cp -r upload/ /var/www/html/bbs
[root@web1 ~]# chown -R apache.apache /var/www/html/bbs
[root@web1 ~]# firefox http://192.168.4.2/bbs &

 

 3.6 配置web2

[root@web1 html]# rm -rf bbg,tar.gz
[root@web1 html]# tar czf bbs.tar.gz bbs
[root@web1 html]# scp bbs.tar.gz 192.168.4.3:/var/www/html
bbs.tar.gz 100% 8806KB 8.6MB/s 00:00
[root@web2 html]# tar xzf bbs.tar.gz

 

 

 

标签:tar,LVS,bbs,192.168,LAMP,web1,mysql,root,搭建
来源: https://www.cnblogs.com/momo6656/p/15001140.html