表白网站源码链接:https://pan.baidu.com/s/1Y0xKhlCfThaQJkIQU4Zi9w?pwd=erlt
提取码:erlt
附上一张样例,这些可DIY修改:
下面开始部署吧!
一.注册云服务器,并在安全规则开放80端口
设置可访问ip为任意IP即 0:0:0:0.
这里不在赘述,详情可访问博主上篇详解:CSDN
二.配置yum源
# 配置阿里云的yum源
# 网站:https://developer.aliyun.com/mirror/
# 下载基础yum源
[root@iZ0jl9d7qwcm3cdw1t4uzmZ ~]# curl -o /etc/yum.repos.d/CentOS-Base.repo https://mirrors.aliyun.com/repo/Centos-7.repo
# 下载扩展yum源
[root@iZ0jl9d7qwcm3cdw1t4uzmZ ~]# curl -o /etc/yum.repos.d/epel.repo https://mirrors.aliyun.com/repo/epel-7.repo
# 清理yum源缓存
[root@iZ0jl9d7qwcm3cdw1t4uzmZ ~]# yum clean all
# 重新加载新的yum源缓存
[root@iZ0jl9d7qwcm3cdw1t4uzmZ ~]# yum makecache
# 显示当前系统中所有的yum源仓库
[root@iZ0jl9d7qwcm3cdw1t4uzmZ yum.repos.d]# yum repolist
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
* base: mirrors.aliyun.com
* extras: mirrors.aliyun.com
* updates: mirrors.aliyun.com
repo id repo name status
base/7/x86_64 CentOS-7 - Base - mirrors.aliyun.com 10,072
epel/x86_64 Extra Packages for Enterprise Linux 7 - x86_64 13,786
extras/7/x86_64 CentOS-7 - Extras - mirrors.aliyun.com 519
updates/7/x86_64 CentOS-7 - Updates - mirrors.aliyun.com 5,766
repolist: 30,143
三.安装Nginx服务
下载Nginx
[root@iZ0jl9d7qwcm3cdw1t4uzmZ ~]# yum install -y nginx
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
* base: mirrors.aliyun.com
* extras: mirrors.aliyun.com
* updates: mirrors.aliyun.com
Resolving Dependencies
--> Running transaction check
---> Package nginx.x86_64 1:1.20.1-10.el7 will be installed
--> Processing Dependency: nginx-filesystem = 1:1.20.1-10.el7 for package: 1:nginx-1.20.1-10.el7.x86_64
--> Processing Dependency: libcrypto.so.1.1(OPENSSL_1_1_0)(64bit) for package: 1:nginx-1.20.1-10.el7.x86_64
--> Processing Dependency: libssl.so.1.1(OPENSSL_1_1_0)(64bit) for package: 1:nginx-1.20.1-10.el7.x86_64
--> Processing Dependency: libssl.so.1.1(OPENSSL_1_1_1)(64bit) for package: 1:nginx-1.20.1-10.el7.x86_64
--> Processing Dependency: nginx-filesystem for package: 1:nginx-1.20.1-10.el7.x86_64
--> Processing Dependency: redhat-indexhtml for package: 1:nginx-1.20.1-10.el7.x86_64
--> Processing Dependency: libcrypto.so.1.1()(64bit) for package: 1:nginx-1.20.1-10.el7.x86_64
--> Processing Dependency: libprofiler.so.0()(64bit) for package: 1:nginx-1.20.1-10.el7.x86_64
--> Processing Dependency: libssl.so.1.1()(64bit) for package: 1:nginx-1.20.1-10.el7.x86_64
--> Running transaction check
---> Package centos-indexhtml.noarch 0:7-9.el7.centos will be installed
---> Package gperftools-libs.x86_64 0:2.6.1-1.el7 will be installed
---> Package nginx-filesystem.noarch 1:1.20.1-10.el7 will be installed
---> Package openssl11-libs.x86_64 1:1.1.1k-7.el7 will be installed
--> Finished Dependency Resolution
Dependencies Resolved
===========================================================================================================================================================
Package Arch Version Repository Size
===========================================================================================================================================================
Installing:
nginx x86_64 1:1.20.1-10.el7 epel 588 k
Installing for dependencies:
centos-indexhtml noarch 7-9.el7.centos base 92 k
gperftools-libs x86_64 2.6.1-1.el7 base 272 k
nginx-filesystem noarch 1:1.20.1-10.el7 epel 24 k
openssl11-libs x86_64 1:1.1.1k-7.el7 epel 1.5 M
Transaction Summary
===========================================================================================================================================================
Install 1 Package (+4 Dependent packages)
Total download size: 2.4 M
Installed size: 6.7 M
Downloading packages:
(1/5): centos-indexhtml-7-9.el7.centos.noarch.rpm | 92 kB 00:00:00
(2/5): nginx-filesystem-1.20.1-10.el7.noarch.rpm | 24 kB 00:00:00
(3/5): gperftools-libs-2.6.1-1.el7.x86_64.rpm | 272 kB 00:00:00
(4/5): nginx-1.20.1-10.el7.x86_64.rpm | 588 kB 00:00:01
(5/5): openssl11-libs-1.1.1k-7.el7.x86_64.rpm | 1.5 MB 00:00:03
-----------------------------------------------------------------------------------------------------------------------------------------------------------
Total 655 kB/s | 2.4 MB 00:00:03
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
Installing : 1:openssl11-libs-1.1.1k-7.el7.x86_64 1/5
Installing : 1:nginx-filesystem-1.20.1-10.el7.noarch 2/5
Installing : centos-indexhtml-7-9.el7.centos.noarch 3/5
Installing : gperftools-libs-2.6.1-1.el7.x86_64 4/5
Installing : 1:nginx-1.20.1-10.el7.x86_64 5/5
Verifying : gperftools-libs-2.6.1-1.el7.x86_64 1/5
Verifying : centos-indexhtml-7-9.el7.centos.noarch 2/5
Verifying : 1:nginx-filesystem-1.20.1-10.el7.noarch 3/5
Verifying : 1:nginx-1.20.1-10.el7.x86_64 4/5
Verifying : 1:openssl11-libs-1.1.1k-7.el7.x86_64 5/5
Installed:
nginx.x86_64 1:1.20.1-10.el7
Dependency Installed:
centos-indexhtml.noarch 0:7-9.el7.centos gperftools-libs.x86_64 0:2.6.1-1.el7 nginx-filesystem.noarch 1:1.20.1-10.el7
openssl11-libs.x86_64 1:1.1.1k-7.el7
Complete!
#关闭防火墙命令
systemctl stop firewalld
#临时关闭seliunx命令
setenforce 0
# 启动nginx
[root@iZ0jl9d7qwcm3cdw1t4uzmZ ~]# systemctl start nginx
# 验证nginx服务是否启动成功, 看到 LISTEN …… *:80,即可,或者是通过浏览器访问服务器ip地址
[root@bogon ~]# ss -tlnp
State Recv-Q Send-Q Local Address:Port Peer Address:Port
LISTEN 0 128 *:80 *:* users:(("nginx",pid=19035,fd=6),("nginx",pid=19034,fd=6),("nginx",pid=19033,fd=6))
LISTEN 0 128 [::]:80 [::]:* users:(("nginx",pid=19035,fd=7),("nginx",pid=19034,fd=7),("nginx",pid=19033,fd=7))
[root@iZ0jl9d7qwcm3cdw1t4uzmZ ~]# ps -ef |grep nginx
root 19033 1 0 14:44 ? 00:00:00 nginx: master process nginx
nginx 19034 19033 0 14:44 ? 00:00:00 nginx: worker process
nginx 19035 19033 0 14:44 ? 00:00:00 nginx: worker process
浏览器输入自己的云服务器IP地址即可打开上述图片的网页
四.将表白源码上传到服务器
[root@iZ0jl9d7qwcm3cdw1t4uzmZ ~]# yum install -y lrzsz
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
* base: mirrors.aliyun.com
* extras: mirrors.aliyun.com
* updates: mirrors.aliyun.com
Resolving Dependencies
--> Running transaction check
---> Package lrzsz.x86_64 0:0.12.20-36.el7 will be installed
--> Finished Dependency Resolution
Dependencies Resolved
===========================================================================================================================================================
Package Arch Version Repository Size
===========================================================================================================================================================
Installing:
lrzsz x86_64 0.12.20-36.el7 base 78 k
Transaction Summary
===========================================================================================================================================================
Install 1 Package
Total download size: 78 k
Installed size: 181 k
Downloading packages:
lrzsz-0.12.20-36.el7.x86_64.rpm | 78 kB 00:00:00
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
Installing : lrzsz-0.12.20-36.el7.x86_64 1/1
Verifying : lrzsz-0.12.20-36.el7.x86_64 1/1
Installed:
lrzsz.x86_64 0:0.12.20-36.el7
Complete!
# 解压zip的压缩包,需要解压工具unzip
[root@iZ0jl9d7qwcm3cdw1t4uzmZ ]# yum install -y unzip
#进入nginx目录下
cd /usr/share/nginx/
# rz 将本地文件上传至服务器,在弹出的窗口选择要上传的文件即可
[root@iZ0jl9d7qwcm3cdw1t4uzmZ nginx]# rz
#使用unzip解压上传的表白源码
[root@iZ0jl9d7qwcm3cdw1t4uzmZ nginx]# unzip love-master.zip
#将love-master 文件名改名为html
[root@iZ0jl9d7qwcm3cdw1t4uzmZ nginx]#mv love-master html
#删除多余的文件和文件夹
[root@iZ0jl9d7qwcm3cdw1t4uzmZ nginx]#rm -rf love-master.zip html
五.重启Nginx服务
[root@iZ0jl9d7qwcm3cdw1t4uzmZ nginx] systemctl restart nginx
最后在网站输入你的云服务的IP地址即可进入你部署的表白网站啦!