首页 > 系统相关 >使用Nginx服务部署一个表白的网站

使用Nginx服务部署一个表白的网站

时间:2024-03-28 23:01:38浏览次数:22  
标签:10 00 x86 nginx 部署 表白 Nginx 64 el7

表白网站源码链接: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地址即可进入你部署的表白网站啦!

标签:10,00,x86,nginx,部署,表白,Nginx,64,el7
From: https://blog.csdn.net/Lzcsfg/article/details/137124099

相关文章

  • yolov部署到app
    今天把模型部署到app上        ......
  • 云服务器ubuntu下nginx和php-fpm环境配置
    云服务器ubuntu下nginx和php-fpm环境配置1.首先更新源apt-getupdate2.安装nginx服务apt-getinstall-ynginx3.查看nginx状态,如果显示中有active(running),表示已经安装成功servicenginxstatus4.寻找可安装的php-fpm中间件apt-cachesearchphp-fpm5.安装可安装......
  • 云计算笔记03--配置yum源及下载nginx并上传项目至服务器(常用命令 lrzsz cat head tail
    配置yum源首先将系统自带的yum源进行备份cd/etc/yum.repos.d///进入到yum配置目录mkdirbackup//创建一个备份目录mv*.repobackup///将所有以.repo结尾的文件移动到备份目录中#阿里云的yum源网站:https://developer.aliyun.com/......
  • 【腾讯云HAI】基于腾讯云HAI部署Stable Diffusion进行图像创作
    toc一、前言在深度学习领域,稳定扩散(StableDiffusion)是一种强大的生成模型,近年来备受关注。稳定扩散模型通过逐步将噪声信号转化为目标图像,实现了高质量图像生成的突破性进展。相较于传统的生成对抗网络(GAN)等模型,稳定扩散技术在生成图像时展现出更加稳定和可控的特性,为图......
  • 使用 Nginx Proxy Manager反向代理开启SSL
    今天又看到有人在推荐NginxProxyManger(太长了,下文NPM指代),于是我也在局域网的机器内装了一个,发现确实简单好用完全的界面操作非常便捷而且支持使用CloudflareDNS验证申请Let’sEncrypt的通配符证书,也很方便设置访问限制。安装部署使用Docker安装是非常的简单首先创建nginx-p......
  • docker创建nginx
    操作系统Linuxversion5.15.0-86-generic(buildd@lcy02-amd64-086)(gcc(Ubuntu11.4.0-1ubuntu1~22.04)11.4.0,GNUld(GNUBinutilsforUbuntu)2.38)#96-UbuntuSMPWedSep2008:23:49UTC2023查找nginx1.24sudodockersearchnginx:1.24拉nginx1.24sudodock......
  • jenkins进行自动化部署
      jenkins自动化部署 hello,大家好,前文我们已经下载好我们的jenkins了,下面我们用jenkins来实现自动化部署啦!一、下载插件我们选择插件管理一个是MavenIntegrationplugin,一个是PublishOverSSH这里因为作者已经下载好了,所以在Installed可以查找到二、设置全局工......
  • Nginx日志统计分析
    Nginx日志统计分析1.统计IP访问量(独立ip访问数量)​awk'{print$1}'access.log|sort-n|uniq|wc-l​2.查看某一时间段的IP访问量(4-5点)​grep"07/Apr/2017:0[4-5]"access.log|awk'{print$1}'|sort|uniq-c|sort-nr|wc-l​3.查看访问最频繁的前100个......
  • hbase - [02] 分布式安装部署
      一、角色规划主机名node01node02node03node04Zookeeper○○○ NameNode○○  JournalNode○○○ DataNode○○○○ResourceManager○○  NodeManager○○○○Master○○○ RegionServer○○○○......
  • [Python]-基础-1.环境部署
    [Python]基础——环境部署&知识补充一、环境部署1.1软件下载1.1.1版本选择内置函数是Python自带的函数,不同版本的Python,其内置函数在数量和使用上大不相同,尤其是Python2和Python3大版本之间的迭代,教程全程采用Python3.8.3进行代码演示,为了避免版本兼容冲突,希望......