diff --git a/README.md b/README.md index 1f90048..fe74368 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,67 @@ # Cloud_Computing -云计算课程大作业 \ No newline at end of file +云计算课程大作业 + +代码部署: + CentOS8 安装apache+mysql+php,将代码部署到Apache HTTP Server网页服务器上 + +(1)安装apache + + 1、更新 + yum update + 2、安装必备的包 + yum -y install gcc gcc-c++ make + 3、安装apache + yum install httpd + 4、apache 服务开启 + systemctl start httpd + 5、设置apache开机启动 + systemctl enable httpd + +(2)安装mysql + + 1、安装mariadb + yum install -y mariadb-server + 2、mariadb开启 + systemctl start mariadb + 3、设置mariadb开机启动 + systemctl enable mariadb + 4、验证是否装好,无密码直接回车 + mysql -u root -p + 5、退出 + exit + +(3)安装php + + 1.安装php + yum install php + 2、安装php扩展 + yum install php-mysqlnd php-gd libjpeg* php-ldap php-odbc php-pear php-xml php-xmlrpc php-mbstring php-bcmath php-mhash + +(4)重启apache服务器 + + systemctl restart httpd.service + +(5)部署代码到服务器 + + 1、上传代码,此命令本地运行 + scp -r 代码文件夹路径 root@云主机ip:/var/www/ + 2、替换html文件夹为代码文件夹 + cd /var/www/ #进入html文件夹同级目录 + rm -rf html/ #删除原html文件夹 + mv 代码文件夹原名称/ html #将代码文件夹名称更改为html + +(6)部署mysql + + 1、进入.sql文件目录 + cd /var/www/html/ + 2、进入mysql,无密码直接回车 + mysql -u root -p + 3、运行sql脚本 + source attendance.sql + 4、退出 + exit + +到此代码部署完毕,已经能够访问云服务 + +浏览器输入云主机ip地址进行访问 \ No newline at end of file