LAMP分离结构+ Discuz论坛搭建
搭建LAMP分离结构
1、服务器分类:
(1)应用服务器:web服务器。存程序源码,如php/python/jsp
(2)数据库服务器:mysql
(3)文件服务器:存静态文件
3、准备三台虚拟机
Vh01.tedu.cn 192.168.4.1 mysql
Vh02.tedu.cn 192.168.4.2 web
Vh03.tedu.cn 192.168.4.3 web
4、配置mysql服务器
[root@vh01 ~]# yum install -y mariadb-server
[root@vh01 ~]# systemctl start mariadb
[root@vh01 ~]# systemctl enable mariadb
[root@vh01 ~]# mysql
MariaDB [(none)]> grant all on . to 'admin'@'%' identified by 'tedu.cn';
5、在vh02和vh03上安装web服务
[root@vh02 ~]# yum install -y httpd php php-mysql
[root@vh02 ~]# systemctl start httpd
[root@vh02 ~]# systemctl enable httpd
6、在vh02上部署Discuz
[root@vh02 ~]# unzip Discuz_X3.0_SC_UTF8.zip
[root@vh02 ~]# cp -r upload/ /var/www/html/bbs
[root@vh02 ~]# chown -R apache.apache /var/www/html/bbs
[root@room8pc16 ~]# firefox http://192.168.4.2/bbs
7、配置vh03
[root@vh02 ~]# cd /var/www/html/
[root@vh02 html]# tar czf bbs.tar.gz bbs
[root@vh02 html]# scp bbs.tar.gz 192.168.4.3:/var/www/html/
[root@vh03 ~]# cd /var/www/html/
[root@vh03 html]# tar xzf bbs.tar.gz
转载于:https://blog.51cto.com/13124606/2151808