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.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-]# yum install -y pcre pcre-devel
#安装完pcre and pcre-devel后继续编译[root@iZwz9cl4i8oy1reej7o8pmZ nginx-]# ./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-]# yum install -y zlib zlib-devel

6.再次编译

#再次编译
[root@iZwz9cl4i8oy1reej7o8pmZ nginx-]# ./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-]# make && make install && echo $?
#如果最后一行是0的话,那么安装完成
test -d '/usr/local/nginx-1.10/logs' \
        || mkdir -p '/usr/local/nginx-1.10/logs'
]: Leaving directory `/root/soft/nginx-'

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                /.html;

        # redirect server error pages to the static page /50x.html
        #
        error_page        /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           ?        Ss   :   : nginx: master process /usr/local/nginx-1.10/sbin/nginx
nobody        ?        S    :   : nginx: worker process
root           pts/    S+   :   : grep nginx
[root@iZwz9cl4i8oy1reej7o8pmZ html]# 
#利用curl命令查看服务器是否正常工作
[root@iZwz9cl4i8oy1reej7o8pmZ html]# curl -I 网址
HTTP/ OK
Server: nginx/
Date: Mon,  Apr  :: GMT
Content-Type: text/html
Content-Length:
Last-Modified: Sun,  Mar  :: GMT
Connection: keep-alive
ETag: "58d7c75c-230"
Accept-Ranges: bytes

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

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

利用nginx打造个人简历网页的更多相关文章

  1. OFBIZ分享:利用Nginx +Memcached架设高性能的服务

    近年来利用Nginx和Memcached来提高站点的服务性能的作法,如一夜春风般的遍及大江南北,越来越多的门户站点和电子商务平台都採用它们来为自己的用户提供更好的服务体验.如:网易.淘宝.京东.凡客等 ...

  2. 利用 NGINX 最大化 Python 性能,第二部分:负载均衡和监控

    [编者按]本文主要介绍 NGINX 的主要功能以及如何通过 Nginx 优化 Python 应用性能.本文系国内 ITOM 管理平台 OneAPM 编译呈现. 本文上一篇系: 利用 NGINX 最大化 ...

  3. 使用 Docker 和 Nginx 打造高性能的二维码服务

    使用 Docker 和 Nginx 打造高性能的二维码服务 本文将演示如何使用 Docker 完整打造一个基于 Nginx 的高性能二维码服务,以及对整个服务镜像进行优化的方法.如果你的网络状况良好, ...

  4. 利用Nginx轻松实现Ajax的跨域请求(前后端分离开发调试必备神技)

    利用Nginx轻松实现浏览器中Ajax的跨域请求(前后端分离开发调试必备神技) 前言 为什么会出现跨域? 造成跨域问题的原因是因为浏览器受到同源策略的限制,也就是说js只能访问和操作自己域下的资源,不 ...

  5. 利用nginx泛域名解析配置二级域名和多域名

    利用nginx泛域名解析配置二级域名和多域名 网站的目录结构为 html ├── bbs └── www html为nginx的安装目录下默认的存放源代码的路径. bbs为论坛程序源代码路径 www为 ...

  6. 利用Nginx+Mono+Fastcgi代替IIS对Asp.Net进行反向代理

    Nginx的好处相信我不必多说了,它作为一个相当轻量级的开源Web 服务器以及反向代理服务器而深受欢迎.越来越多的公司已经对它产生兴趣,包括我们公司的许多部门,利用它进行负载均衡和资源管理,之前写过一 ...

  7. 怎样利用App打造自明星实现自盈利

    怎样利用App打造自明星实现自盈利 1.了解各个概念       为了大家都能看懂这篇文章,先说明几个概念.        App(Application):能够在移动设备上使用,满足人们咨询.购物. ...

  8. FMS+NGINX打造高带宽利用率的流媒体(音频+视频)环境

    fms自身已经拥有了httpd,用来给客户端访问用,例如通过http的音频播放.众所周知,非专业的httpd自然有不专业之处,例如我遇到的情况就是经常http服务假死,或者在访问量庞大的时候会无缘无故 ...

  9. 利用nginx实现负载均衡和动静分离

    1.Nginx介绍 Nginx ("engine x") 是一个高性能的 HTTP 和 反向代理 服务器,也是一个 IMAP/POP3/SMTP 代理服务器 . Nginx 是由 ...

随机推荐

  1. go语言处理文件上传和多个文件上传

    uploadOne.html代码如下: <!doctype html> <html lang="en"> <head> <meta cha ...

  2. const修饰符用法

    1. 将一个对象设置为不可修改 const int a = 100; 2. 指向const对象的指针 const int* p = 3;可以通过指针来修改指针所指向的值,但是不能通过指针*p修改对像的 ...

  3. Linux操作系统-系统安装与分区

    .磁盘分区 使用分区工具在磁盘上划分几个逻辑部分,一旦分成几个分区,不同类型的目录和文件可以存储进不同的分区2.分区类型主分区:最多只能有4个扩展分区:最多只能有1个:主分区加扩展分区最多有4个:扩展 ...

  4. c++中“箭头(->)”和“点号(.)”操作符的区别

    首先介绍一下C++中的结构.对于一个结构: struct MyStruct { int member_a; }; 如果有个变量MyStruct s,那么使用其中的成员元素时可以用: s.member_ ...

  5. andorid 计算器

    avtivity_main.xml <?xml version="1.0" encoding="utf-8"?> <GridLayout xm ...

  6. Android——Activity练习

    manifests里的AndroidManifest.xml <?xml version="1.0" encoding="utf-8"?> < ...

  7. poj 2886 (线段树+反素数打表) Who Gets the Most Candies?

    http://poj.org/problem?id=2886 一群孩子从编号1到n按顺时针的方向围成一个圆,每个孩子手中卡片上有一个数字,首先是编号为k的孩子出去,如果他手上的数字m是正数,那么从他左 ...

  8. docker 运行nginx并进入容器内部、端口映射

    一.docker运行容器 1.从网易蜂巢镜像仓库下载nginx镜像 : 2.拉取镜像到本地,并查看本地的镜像: $ docker pull hub.c..com/library/node:latest ...

  9. TortoiseSVN Project Monitor使用

    今天下载了TortoiseSVN Project Monitor,要把一个项目导入 name一直没有输入,一直导入不成功,点击了ok也不给提示,切记要写项目Name啊! 在使用svncheckout时 ...

  10. VB.NET中的DLL编写和调用的最简单示例

    DLL(动态链接库)是一个很有用的东西,在开发大项目的时候显得非常重要,因为多人合作开发时,可以给每个人分配一个任务,用DLL完成,最后组合起来,就不会出现互相冲突的问题.这里给出最简单的DLL编写与 ...