记录:云计算日常学习分享

部署QQ农场项目:

准备环境:

1.修改主机名
hostnamectl set-hostname qqfarm
2.防火墙和selinux
systemctl stop firewalld --now

setenforce 0
3.校对时间
ntpdate cn.pool.ntp.org
4.配置静态ip
vim  /etc/sysconfig/network-scripts/ifcfg-ens33
5.重启网卡
systemctl restart network
6.测试网络
ping baidu.com

配置阿里云yum源或者本地yum源

1.阿里云
​
curl -o /etc/yum.repos.d/CentOS-Base.repo https://mirrors.aliyun.com/repo/Centos-7.repo

yum clean all  清理缓存

yum makecache   生成缓存

yum -y install epel-release 安装扩展源

​
2.本地源

下载yum配置文件   

安装本地源   操作同上

yum  clean all  清理缓存

yum makecache  生成缓存

部署应用

1.部署nginx
yum -y install nginx
2.启动nginx
systemctl start nginx
3.测试是否启动成功
ss -nplt | grep 80
4.部署MySQL数据库
yum -y install mysql-community-server
5.启动MySQL数据库
systemctl start  mysqld
6.获取临时密码并修改
awk '/temporary password/{p-$NF}END{print p}'  /var/log/mysqld.log

修改密码

mysqladmin -uroot -p '临时密码' password '新密码'
7.部署php
yum -y install php php-fpm php-curl php-intl php-mcrypt php-mysql php-mbstring php-xml php-dom php-gd gd
8.启动
systemctl start php-fpm

systemctl restart nginx

部署项目

1.将nginx和php关联起来
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; }
2.探测文件
rm -rf /usr/share/nginx/html/*

cd /usr/share/nginx/html

vim index.php

<?php

phpinfo();

?>
3.修改php配置文件
vim /etc/php.ini

short_open_tag=on

systemctl restart php-fpm
4.部署项目
yum -y install unzip

rz 项目

unzip farm-ucenter1.5.zip

rm -rf  /usr/share/nginx/html/*

cp -r upload/*  /usr/share/nginx/html/

chomd -R 777 *
5.导入数据库
方法一: mysql -p1 -e "create database qqfarm default charset 'utf8'"

方法二: mysql -p1 qqfarm

mysql> sourcce /root/upload/qqfarm.sql;

浏览器试验

  • 25
    点赞
  • 10
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值