云计算 1月15号

1月15号

1.qqfarm
1.1安装环境

#修改主机名
[root@localhost ~]# hostnamectl set-hostname qqfarm
#防火墙和selinux
[root@qqfarm ~]# systemctl stop firewalld --now
[root@qqfarm ~]# setenforce 0
#校对时间
[root@qqfarm ~]# ntpdate cn.pool.ntp.org
#配置静态ip
vim /etc/sysconfig/network-scripts/ifcfg-ens33
TYPE=Ethernet
PROXY_METHOD=none
BROWSER_ONLY=no
BOOTPROTO=static
DEFROUTE=yes
DEVICE=ens33
ONBOOT=yes
IPADDR=192.168.100.222
PREFIX=24
GATEWAY=192.168.100.2
DNS1=223.5.5.5
DNS2=223.6.6.6
#重启网卡
[root@qqfarm ~]# systemctl restart network
#测试网络
[root@qqfarm ~]# ping baidu.com

1.2配置阿里云的yum源或者本地yum源
#阿里云
[root@qqfarm ~]# curl -o /etc/yum.repos.d/CentOS-Base.repo https://mirrors.aliyun.com/repo/Centos-7.repo
[root@qqfarm ~]# yum clean all
[root@qqfarm ~]# yum makecache
[root@qqfarm ~]# yum -y install epel-release
# 本地源
#1.2.1下载yum源配置文件
去ftp服务器下载
#1.2.2安装本地源
[root@qqfarm ~]# yum clean all
[root@qqfarm ~]# yum makecache

1.3部署应用
#部署nginx
[root@qqfarm ~]# yum -y install nginx
#启动nginx
[root@qqfarm ~]# systemctl start nginx
#测试是否启动成功
[root@qqfarm ~]# ss -nplt |  grep 80
LISTEN     0      128          *:80                       *:*                   users:(("nginx",pid=3117,fd=6),("nginx",pid=3116,fd=6),("nginx",pid=3115,fd=6))
LISTEN     0      128       [::]:80                    [::]:*                   users:(("nginx",pid=3117,fd=7),("nginx",pid=3116,fd=7),("nginx",pid=3115,fd=7))
# 部署MySQL数据库
[root@qqfarm ~]# yum -y install mysql-community-server
# 启动MySQL数据库
[root@qqfarm ~]# systemctl start mysqld
# 获取临时密码并修改
[root@qqfarm ~]# mysqladmin -p"`awk '/temporary password/{p=$NF}END{print p}' /var/log/mysqld.log`" password 'Qianfeng@123'
# 部署php
[root@qqfarm ~]# yum -y install php php-fpm php-curl php-intl php-mcrypt php-mysql php-mbstring php-xml php-dom php-gd gd  
[root@qqfarm ~]# systemctl start php-fpm

1.4部署项目
#将nginx和php关联起来
[root@qqfarm ~]# vim +42 /etc/nginx/nginx.conf
index  index.php index.html index.htm;
        location ~ .php$ {
            root           html;
            fastcgi_pass   127.0.0.1:9000;
            fastcgi_index  index.php;
            fastcgi_param  SCRIPT_FILENAME  /usr/share/nginx/html$fastcgi_script_name;
            include        fastcgi_params;
        }   
1.5#探测文件
[root@qqfarm ~]# rm -rf /usr/share/nginx/html/*
[root@qqfarm ~]# cd /usr/share/nginx/html/
[root@qqfarm ~]# vim index.php
<?php
phpinfo();
?>
1.6#修改php配置文件
[root@qqfarm ~]# vim /etc/php.ini
short_open_tag=On
[root@qqfarm ~]# systemctl restart php-fpm
1.7#部署项目
[root@qqfarm ~]# yum -y install unzip
[root@qqfarm ~]# unzip farm-ucenter1.5.zip
[root@qqfarm ~]# rm -rf /usr/share/nginx/html/*
[root@qqfarm ~]# cp -r upload/* /usr/share/nginx/html/
[root@qqfarm ~]# cd /usr/share/nginx/html/
[root@qqfarm html]# chmod -R 777 *
1.8#导入数据库
方法一:
[root@qqfarm ~]# mysql -p"Qianfeng@123" -e "create database qqfarm default charset 'utf8';
[root@qqfarm ~]# mysql -p"Qianfeng@123" qqfarm < ./upload/qqfarm.sql
方法二:
[root@qqfarm ~]# mysql -p"Qianfeng@123" qqfarm
mysql>source /root/upload/qqfarm.sql;

    
 2.部署项目【战姬物语】
    
 关闭php-fpm
 systemctl stop php-fpm
2.1部署java环境
[root@qqfarm ~]# tar -xf jdk-8u211-linux-x64.tar.gz
[root@qqfarm ~]# mv jdk1.8.0_211/ /usr/jdk
 #配置环境变量
[root@qqfarm ~]# vim /etc/profile
 #在文件的最后一行添加
 export PATH=/usr/jdk/bin:$PATH
[root@qqfarm ~]# source /etc/profile
#验证java是否安装成功
[root@qqfarm ~]# java -version
java version "1.8.0_211"
Java(TM) SE Runtime Environment (build 1.8.0_211-b12)
Java HotSpot(TM) 64-Bit Server VM (build 25.211-b12, mixed mode)
    
2.2部署项目
[root@qqfarm ~]# tar -xf zjwy.tar.gz -C /
[root@qqfarm ~]# cp -r /www/wwwroot/yixiaw/* /usr/share/nginx/html/
[root@qqfarm ~]# vim /usr/share/nginx/cdhtml/index.html
将218.93.207.238修改为自己的IP
:%s/218.93.207.238/192.168.100.222/g
[root@qqfarm ~]# vim /opt/server/100001/Application.properties
managerWhiteList=127.0.0.1,192.168.100.222
将192.168.100.222修改成自己的IP
[root@qqfarm ~]# vim /opt/server/apache-tomcat-8080/conf/context.xml
修改如图位置,内容为:下图

2.3导入数据库

#修改数据库密码:
[root@qqfarm ~]# mysqladmin -p'old-passwd' password 'jgirlstest'
# 创建数据库:
[root@qqfarm ~]# mysql -p'jgirlstest'
mysql> create database jgirls_test default charset 'utf8';
mysql> use jgirls_test
mysql> source /root/jgirls_test.sql;
mysql> UPDATE `jgirls_test`.`system` SET `id`='1', `data`='{"version":"1.0.0.0","resVersion":"1.0.0.0.0.0.0.0","areas":[{"id":100001,"name":"云计算1","host":"192.168.100.222","port":10090,"status":2},{"id":100002,"name":"www.QFetu.com","host":"192.168.100.222","port":10100,"status":1}],"globalStatus":1,"versionStr":"","whiteListWhenMaintenance":",","declaration":[{"declarationTitle":"云计算","declarationCotent":"www.QF.com"},{"declarationTitle":"公告标题2","declarationCotent":"公告内容2"},{"declarationTitle":"公告标题3","declarationCotent":"公告内容3"}]}' WHERE (`id`='1');
#注意:将上面sql语句中的IP,修改为自己的IP

2.4启动服务

[root@qqfarm ~]# cd /opt/server/mongodb-linux-x86_64-rhel70-3.2.9/ && ./start.sh
[root@qqfarm ~]# cd /opt/server/AdminNew/ && ./restart.sh
[root@qqfarm ~]# sh /opt/server/apache-tomcat-8080/bin/startup.sh
[root@qqfarm ~]# cd /opt/server/chatserver/ && ./start.sh :
[root@qqfarm ~]# cd /opt/server/100001/ && ./start.sh start

浏览器访问后台管理(用户名密码:admin/admin)

本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
THE END
分享
二维码
< <上一篇
下一篇>>