Nginx安装时Warning: File `src/core/nginx.h' has modification time 1.2e+07 s in the future问题的解决方法

问题场景:

解压文件:tar -zxvf nginx-1.7.4.tar.gz

nginx-1.7.4/
nginx-1.7.4/auto/
nginx-1.7.4/conf/
tar: nginx-1.7.4/auto: time stamp 2014-08-05 19:13:10 is 12165186.025866769 s in the future
nginx-1.7.4/contrib/
tar: nginx-1.7.4/conf: time stamp 2014-08-05 19:13:06 is 12165182.024958914 s in the future
nginx-1.7.4/src/
tar: nginx-1.7.4/contrib: time stamp 2014-08-05 19:13:06 is 12165182.020185855 s in the future
nginx-1.7.4/configure
tar: nginx-1.7.4/src: time stamp 2014-08-05 19:13:10 is 12165186.019670919 s in the future
tar: nginx-1.7.4/configure: time stamp 2014-08-05 19:13:05 is 12165181.018314486 s in the future
nginx-1.7.4/LICENSE
tar: nginx-1.7.4/LICENSE: time stamp 2014-08-05 19:13:06 is 12165182.018083727 s in the future
nginx-1.7.4/README
tar: nginx-1.7.4/README: time stamp 2014-08-05 19:13:06 is 12165182.017770715 s in the future
nginx-1.7.4/html/
nginx-1.7.4/man/
tar: nginx-1.7.4/html: time stamp 2014-08-05 19:13:10 is 12165186.017546593 s in the future
nginx-1.7.4/CHANGES.ru
tar: nginx-1.7.4/man: time stamp 2014-08-05 19:13:10 is 12165186.017422397 s in the future
tar: nginx-1.7.4/CHANGES.ru: time stamp 2014-08-05 19:13:14 is 12165190.01206064 s in the future
nginx-1.7.4/CHANGES
tar: nginx-1.7.4/CHANGES: time stamp 2014-08-05 19:13:17 is 12165193.007600125 s in the future
nginx-1.7.4/man/nginx.8
tar: nginx-1.7.4/man/nginx.8: time stamp 2014-08-05 19:13:06 is 12165182.007250707 s in the future
nginx-1.7.4/html/50x.html
tar: nginx-1.7.4/html/50x.html: time stamp 2014-08-05 19:13:06 is 12165182.007094338 s in the future
nginx-1.7.4/html/index.html
tar: nginx-1.7.4/html/index.html: time stamp 2014-08-05 19:13:06 is 12165182.006936145 s in the future

这里已经显示问题。但我没有在意。

配置:./configure

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

依赖PCRE(PCRE(Perl Compatible Regular Expressions)是一个Perl库。包含 perl 兼容的正則表達式库。这些在运行正规表达式模式匹配时用与Perl 5相同的语法和语义是非常实用的。Boost太庞大了,使用boost regex后,程序的编译速度明显变慢。

測试了一下,相同一个程序,使用boost::regex编译时须要3秒,而使用pcre不到1秒。因此改用pcre来解决C语言中使用正則表達式的问题)库,下载地址:www.pcre.org/
指定库的位置:./configure --with-pare=/opt/pcre

Configuration summary
+ using PCRE library: /opt/pcre
+ OpenSSL library is not used
+ md5: using system crypto library
+ sha1: using system crypto library
+ using system zlib library nginx path prefix: "/usr/local/nginx"
nginx binary file: "/usr/local/nginx/sbin/nginx"
nginx configuration prefix: "/usr/local/nginx/conf"
nginx configuration file: "/usr/local/nginx/conf/nginx.conf"
nginx pid file: "/usr/local/nginx/logs/nginx.pid"
nginx error log file: "/usr/local/nginx/logs/error.log"
nginx http access log file: "/usr/local/nginx/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"

编译:make

make -f objs/Makefile
make[1]: Entering directory `/opt/nginx-1.7.4'
make[1]: Warning: File `src/core/nginx.h' has modification time 1.2e+07 s in the future
cd /opt/pcre \
&& if [ -f Makefile ]; then make distclean; fi \
&& CC="cc" CFLAGS="-O2 -fomit-frame-pointer -pipe " \
./configure --disable-shared
/bin/sh: line 2: ./configure: No such file or directory
make[1]: *** [/opt/pcre/Makefile] Error 127
make[1]: Leaving directory `/opt/nginx-1.7.4'
make: *** [build] Error 2

查看系统时区:date -R

中国应该是+0800才对,但是显示的却是-0800

改动时区:

cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime  
时区的信息存在/usr/share/zoneinfo/以下。本机的时区信息存在/etc/localtime

查看系统日期:date

发现日期也不正确,

改动日期:date -s 20141118

改动时间:date -s 19:16:55

把之前的文件删除:rm -rf nginx-1.7.4

再次解压:tar -zxvf nginx-1.7.4.tar.gz

nginx-1.7.4/
nginx-1.7.4/auto/
nginx-1.7.4/conf/
nginx-1.7.4/contrib/
nginx-1.7.4/src/
nginx-1.7.4/configure
nginx-1.7.4/LICENSE
nginx-1.7.4/README
nginx-1.7.4/html/
nginx-1.7.4/man/
nginx-1.7.4/CHANGES.ru
nginx-1.7.4/CHANGES
nginx-1.7.4/man/nginx.8
nginx-1.7.4/html/50x.html
nginx-1.7.4/html/index.html
nginx-1.7.4/src/core/
nginx-1.7.4/src/event/
nginx-1.7.4/src/http/
nginx-1.7.4/src/mail/
nginx-1.7.4/src/misc/
nginx-1.7.4/src/os/
nginx-1.7.4/src/os/unix/

这时显示结果就没问题了。

但这仅仅是攻克了警告的问题,但错误并没有解决。

最新文章

  1. 排序之----插入排序(C#实现)
  2. Select loop
  3. bios中只有windows boot manager下用U盘启动
  4. Leetcode: Graph Valid Tree &amp;&amp; Summary: Detect cycle in undirected graph
  5. AngularJS与RequireJS集成方案
  6. hadoop自动安装的脚本与步骤
  7. fresco的源码学习自我总结
  8. 【SSH2(实用文章)】--Struts2文件上传和下载的例子
  9. Scala编程快速入门系列(二)
  10. Android的ToggleButton和Switch以及AnalogColok和DigitalColok的用法-android学习之旅(二十)
  11. Qt4项目迁移到Qt5问题:greaterThan(QT_MAJOR_VERSION, 4): QT += widgets .
  12. 【一天一道LeetCode】#73. Set Matrix Zeroes
  13. pyspider爬取tourism management 所有文章的标题 作者 摘要 关键词等等所有你想要的信息
  14. open-falcon详解
  15. js数组条件筛选——map()
  16. Windows的cmd窗口显示utf8字符
  17. 使用Golang编写优化算法 (1)
  18. 通过Stetho在Chrome上调试Android App
  19. Java如何查看线程的优先级?
  20. 7 -- Spring的基本用法 -- 12... Spring 3.0 提供的表达式语言(SpEL)

热门文章

  1. Codeforces 609D 被二分教做人
  2. 35个jquery小技巧
  3. Java算法——求出两个字符串的最长公共字符串
  4. HTML学习(2018.1.18)
  5. C#异步Async、Task、Await
  6. nginx_安装测试
  7. 怎么在阿里云搭建一个WordPress博客(超详细教程)
  8. Java中面向对象三大特性之——继承
  9. javaee IO流作业
  10. 初识 Django