阿里云-云小站(无限量代金券发放中)
【腾讯云】云服务器、云数据库、COS、CDN、短信等热卖云产品特惠抢购

利用Nginx打造个人简历网页

505次阅读
没有评论

共计 5621 个字符,预计需要花费 15 分钟才能阅读完成。

1. 下载 nginx

nginx 官方网址:http://nginx.org/

2. 下载和解压

# 下载:
[root@iZwz9cl4i8oy1reej7o8pmZ soft]# wget http://nginx.org/download/nginx-1.10.3.tar.gz
[root@iZwz9cl4i8oy1reej7o8pmZ soft]# tar xf nginx-1.10.3.tar.gz 
[root@iZwz9cl4i8oy1reej7o8pmZ soft]# 

3. 安装

[root@iZwz9cl4i8oy1reej7o8pmZ nginx-1.10.3]# ./configure --prefix=/usr/local/nginx-1.10

4. 出现的错误

./configure: error: the HTTP rewrite module requires the PCRE library.
You can either disable the module by using --without-http_rewrite_module
option, or install the PCRE library into the system, or build the PCRE library
statically from the source with nginx by using --with-pcre=<path> option.

5. 安装必要的插件

[root@iZwz9cl4i8oy1reej7o8pmZ nginx-1.10.3]# yum install -y pcre pcre-devel
# 安装完 pcre and pcre-devel 后继续编译
[root@iZwz9cl4i8oy1reej7o8pmZ nginx-1.10.3]# ./configure --prefix=/usr/local/nginx-1.10
# 出现以下问题
./configure: error: the HTTP gzip module requires the zlib library.
You can either disable the module by using --without-http_gzip_module
option, or install the zlib library into the system, or build the zlib library
statically from the source with nginx by using --with-zlib=<path> option.
# 再次安装必要插件
[root@iZwz9cl4i8oy1reej7o8pmZ nginx-1.10.3]# yum install -y zlib zlib-devel

6. 再次编译

# 再次编译
[root@iZwz9cl4i8oy1reej7o8pmZ nginx-1.10.3]# ./configure --prefix=/usr/local/nginx-1.10


#出现如下,则 OK
Configuration summary
  + using system PCRE library
  + OpenSSL library is not used
  + using builtin md5 code
  + sha1 library is not found
  + using system zlib library

  nginx path prefix: "/usr/local/nginx-1.10"
  nginx binary file: "/usr/local/nginx-1.10/sbin/nginx"
  nginx modules path: "/usr/local/nginx-1.10/modules"
  nginx configuration prefix: "/usr/local/nginx-1.10/conf"
  nginx configuration file: "/usr/local/nginx-1.10/conf/nginx.conf"
  nginx pid file: "/usr/local/nginx-1.10/logs/nginx.pid"
  nginx error log file: "/usr/local/nginx-1.10/logs/error.log"
  nginx http access log file: "/usr/local/nginx-1.10/logs/access.log"
  nginx http client request body temporary files: "client_body_temp"
  nginx http proxy temporary files: "proxy_temp"
  nginx http fastcgi temporary files: "fastcgi_temp"
  nginx http uwsgi temporary files: "uwsgi_temp"
  nginx http scgi temporary files: "scgi_temp"
 

7. 执行 make and make install

[root@iZwz9cl4i8oy1reej7o8pmZ nginx-1.10.3]# make && make install && echo $?
# 如果最后一行是 0 的话,那么安装完成
test -d '/usr/local/nginx-1.10/logs' \
        || mkdir -p '/usr/local/nginx-1.10/logs'
make[1]: Leaving directory `/root/soft/nginx-1.10.3'0

8. 搭建个人简历网页

8.1 修改配置文件如下

 
# 进入已经编安装完成的 nginx 服务器下
[root@iZwz9cl4i8oy1reej7o8pmZ ~]# cd /usr/local/nginx-1.10/

#进入安装后的 nginx 下的 conf 配置文件下
[root@iZwz9cl4i8oy1reej7o8pmZ nginx-1.10]# cd conf/;ls
fastcgi.conf          fastcgi_params          koi-utf  mime.types          nginx.conf          scgi_params          uwsgi_params          win-utf
fastcgi.conf.default  fastcgi_params.default  koi-win  mime.types.default  nginx.conf.default  scgi_params.default  uwsgi_params.default
[root@iZwz9cl4i8oy1reej7o8pmZ conf]# 
 
# 修改配置
[root@iZwz9cl4i8oy1reej7o8pmZ conf]# vim nginx.conf
 
#修改 nginx.conf 如下:
# 其中:listen 是监听的端口
#server_name 是虚拟机的名称 server {listen 你需要监听的端口
; server_name 网址; #charset koi8-r; #access_log logs/host.access.log main; location / { root html; index index.html index.htm; } #error_page 404 /404.html; # redirect server error pages to the static page /50x.html # error_page 500 502 503 504 /50x.html; location = /50x.html {root html;}
 

8.2 上传 html 文档

 
# 进入到 html 文件夹下上传 html 文件
[root@iZwz9cl4i8oy1reej7o8pmZ html]# pwd
/usr/local/nginx-1.10/html
[root@iZwz9cl4i8oy1reej7o8pmZ html]# ls
50x.html  index.html  li.tar.gz
[root@iZwz9cl4i8oy1reej7o8pmZ html]# 
 
 
# 解压 li.tar.gz 文件
[root@iZwz9cl4i8oy1reej7o8pmZ html]# tar xf li.tar.gz 
#删除 html 目录下的 index.html 文件,否则待会可能会出错
[root@iZwz9cl4i8oy1reej7o8pmZ html]# rm -f index.html 
#查看��前目录下的文件
[root@iZwz9cl4i8oy1reej7o8pmZ html]# ls
50x.html  li.tar.gz  www
#进入到 www 文件夹
[root@iZwz9cl4i8oy1reej7o8pmZ html]# cd www
#移动 www 下所有文件至上一层目录
[root@iZwz9cl4i8oy1reej7o8pmZ www]# mv * ../
#返回上一层目录
[root@iZwz9cl4i8oy1reej7o8pmZ www]# cd ..
#查看文件
[root@iZwz9cl4i8oy1reej7o8pmZ html]# ls
50x.html  html  index.html  li.tar.gz  LiWang1.docx  LiWang1.pdf  LiWang.jpg  trash  www
 

9.. 检测 nginx 软件,开启服务

# 检测 nginx 语法
[root@iZwz9cl4i8oy1reej7o8pmZ html]# /usr/local/nginx-1.10/sbin/nginx -t
nginx: the configuration file /usr/local/nginx-1.10/conf/nginx.conf syntax is ok
nginx: configuration file /usr/local/nginx-1.10/conf/nginx.conf test is successful
[root@iZwz9cl4i8oy1reej7o8pmZ html]# 
 
# 启动 nginx 服务器
[root@iZwz9cl4i8oy1reej7o8pmZ html]# /usr/local/nginx-1.10/sbin/nginx 
#查看是否有进程启动
[root@iZwz9cl4i8oy1reej7o8pmZ html]# ps aux | grep nginx
root     18577  0.0  0.0  19984   648 ?        Ss   16:20   0:00 nginx: master process /usr/local/nginx-1.10/sbin/nginx
nobody   18578  0.0  0.1  20404  1240 ?        S    16:20   0:00 nginx: worker process           
root     18580  0.0  0.0 103312   876 pts/0    S+   16:20   0:00 grep nginx
[root@iZwz9cl4i8oy1reej7o8pmZ html]# 
 
 
# 利用 curl 命令查看服务器是否正常工作
[root@iZwz9cl4i8oy1reej7o8pmZ html]# curl -I 网址
HTTP/1.1 200 OK
Server: nginx/1.10.3
Date: Mon, 10 Apr 2017 08:22:13 GMT
Content-Type: text/html
Content-Length: 560
Last-Modified: Sun, 26 Mar 2017 13:51:24 GMT
Connection: keep-alive
ETag: "58d7c75c-230"
Accept-Ranges: bytes

[root@iZwz9cl4i8oy1reej7o8pmZ html]# 
# 其中:200 OK 代表正常访问
 

通过域名加端口的形式进行访问,OK

利用 Nginx 打造个人简历网页

下面关于 Nginx 的文章您也可能喜欢,不妨参考下:

Nginx 403 forbidden 的解决办法  http://www.linuxidc.com/Linux/2017-08/146084.htm

CentOS 7 下 Nginx 服务器的安装配置  http://www.linuxidc.com/Linux/2017-04/142986.htm

CentOS 上安装 Nginx 服务器实现虚拟主机和域名重定向  http://www.linuxidc.com/Linux/2017-04/142642.htm

CentOS 6.8 安装 LNMP 环境(Linux+Nginx+MySQL+PHP)http://www.linuxidc.com/Linux/2017-04/142880.htm

Linux 下安装 PHP 环境并配置 Nginx 支持 php-fpm 模块  http://www.linuxidc.com/Linux/2017-05/144333.htm

Nginx 服务的 SSL 认证和 htpasswd 认证  http://www.linuxidc.com/Linux/2017-04/142478.htm

Ubuntu 16.04 上启用加密安全的 Nginx Web 服务器  http://www.linuxidc.com/Linux/2017-07/145522.htm

Linux 中安装配置 Nginx 及参数详解  http://www.linuxidc.com/Linux/2017-05/143853.htm

Nginx 日志过滤 使用 ngx_log_if 不记录特定日志 http://www.linuxidc.com/Linux/2014-07/104686.htm

CentOS 7.2 下 Nginx+PHP+MySQL+Memcache 缓存服务器安装配置  http://www.linuxidc.com/Linux/2017-03/142168.htm

CentOS6.9 编译安装 Nginx1.4.7  http://www.linuxidc.com/Linux/2017-06/144473.htm

Nginx 的详细介绍:请点这里
Nginx 的下载地址:请点这里

本文永久更新链接地址:http://www.linuxidc.com/Linux/2017-10/147892.htm

正文完
星哥玩云-微信公众号
post-qrcode
 0
星锅
版权声明:本站原创文章,由 星锅 于2022-01-21发表,共计5621字。
转载说明:除特殊说明外本站文章皆由CC-4.0协议发布,转载请注明出处。
【腾讯云】推广者专属福利,新客户无门槛领取总价值高达2860元代金券,每种代金券限量500张,先到先得。
阿里云-最新活动爆款每日限量供应
评论(没有评论)
验证码
【腾讯云】云服务器、云数据库、COS、CDN、短信等云产品特惠热卖中

星哥玩云

星哥玩云
星哥玩云
分享互联网知识
用户数
4
文章数
19350
评论数
4
阅读量
7963581
文章搜索
热门文章
星哥带你玩飞牛NAS-6:抖音视频同步工具,视频下载自动下载保存

星哥带你玩飞牛NAS-6:抖音视频同步工具,视频下载自动下载保存

星哥带你玩飞牛 NAS-6:抖音视频同步工具,视频下载自动下载保存 前言 各位玩 NAS 的朋友好,我是星哥!...
星哥带你玩飞牛NAS-3:安装飞牛NAS后的很有必要的操作

星哥带你玩飞牛NAS-3:安装飞牛NAS后的很有必要的操作

星哥带你玩飞牛 NAS-3:安装飞牛 NAS 后的很有必要的操作 前言 如果你已经有了飞牛 NAS 系统,之前...
我把用了20年的360安全卫士卸载了

我把用了20年的360安全卫士卸载了

我把用了 20 年的 360 安全卫士卸载了 是的,正如标题你看到的。 原因 偷摸安装自家的软件 莫名其妙安装...
再见zabbix!轻量级自建服务器监控神器在Linux 的完整部署指南

再见zabbix!轻量级自建服务器监控神器在Linux 的完整部署指南

再见 zabbix!轻量级自建服务器监控神器在 Linux 的完整部署指南 在日常运维中,服务器监控是绕不开的...
飞牛NAS中安装Navidrome音乐文件中文标签乱码问题解决、安装FntermX终端

飞牛NAS中安装Navidrome音乐文件中文标签乱码问题解决、安装FntermX终端

飞牛 NAS 中安装 Navidrome 音乐文件中文标签乱码问题解决、安装 FntermX 终端 问题背景 ...
阿里云CDN
阿里云CDN-提高用户访问的响应速度和成功率
随机文章
我用AI做了一个1978年至2019年中国大陆企业注册的查询网站

我用AI做了一个1978年至2019年中国大陆企业注册的查询网站

我用 AI 做了一个 1978 年至 2019 年中国大陆企业注册的查询网站 最近星哥在 GitHub 上偶然...
亚马逊云崩完,微软云崩!当全球第二大云“摔了一跤”:Azure 宕机背后的配置风险与警示

亚马逊云崩完,微软云崩!当全球第二大云“摔了一跤”:Azure 宕机背后的配置风险与警示

亚马逊云崩完,微软云崩!当全球第二大云“摔了一跤”:Azure 宕机背后的配置风险与警示 首先来回顾一下 10...
【1024程序员】我劝你赶紧去免费领一个AWS、华为云等的主机

【1024程序员】我劝你赶紧去免费领一个AWS、华为云等的主机

【1024 程序员】我劝你赶紧去免费领一个 AWS、华为云等的主机 每年 10 月 24 日,程序员们都会迎来...
浏览器自动化工具!开源 AI 浏览器助手让你效率翻倍

浏览器自动化工具!开源 AI 浏览器助手让你效率翻倍

浏览器自动化工具!开源 AI 浏览器助手让你效率翻倍 前言 在 AI 自动化快速发展的当下,浏览器早已不再只是...
240 元左右!五盘位 NAS主机,7 代U硬解4K稳如狗,拓展性碾压同价位

240 元左右!五盘位 NAS主机,7 代U硬解4K稳如狗,拓展性碾压同价位

  240 元左右!五盘位 NAS 主机,7 代 U 硬解 4K 稳如狗,拓展性碾压同价位 在 NA...

免费图片视频管理工具让灵感库告别混乱

一言一句话
-「
手气不错
你的云服务器到底有多强?宝塔跑分告诉你

你的云服务器到底有多强?宝塔跑分告诉你

你的云服务器到底有多强?宝塔跑分告诉你 为什么要用宝塔跑分? 宝塔跑分其实就是对 CPU、内存、磁盘、IO 做...
一句话生成拓扑图!AI+Draw.io 封神开源组合,工具让你的效率爆炸

一句话生成拓扑图!AI+Draw.io 封神开源组合,工具让你的效率爆炸

一句话生成拓扑图!AI+Draw.io 封神开源组合,工具让你的效率爆炸 前言 作为天天跟架构图、拓扑图死磕的...
星哥带你玩飞牛NAS-12:开源笔记的进化之路,效率玩家的新选择

星哥带你玩飞牛NAS-12:开源笔记的进化之路,效率玩家的新选择

星哥带你玩飞牛 NAS-12:开源笔记的进化之路,效率玩家的新选择 前言 如何高效管理知识与笔记,已经成为技术...
Prometheus:监控系统的部署与指标收集

Prometheus:监控系统的部署与指标收集

Prometheus:监控系统的部署与指标收集 在云原生体系中,Prometheus 已成为最主流的监控与报警...
告别Notion焦虑!这款全平台开源加密笔记神器,让你的隐私真正“上锁”

告别Notion焦虑!这款全平台开源加密笔记神器,让你的隐私真正“上锁”

  告别 Notion 焦虑!这款全平台开源加密笔记神器,让你的隐私真正“上锁” 引言 在数字笔记工...