Nginx安装配置

 

第一步: 先装三大依赖

  • openssl :


       tar zxvf openssl-1.1.0f.tar.gz

      cd openssl-1.1.0f

      ./config && make && make install

  • pcre:

      tar zxvf pcre-8.40.tar.gz

      cd pcre-8.40

     ./configure && make && make install

  • zlib:

      tar zxvf zlib-1.2.11.tar.gz

      cd zlib-1.2.11

      ./configure && make && make install
      
第二步: 再装Nginx

      tar -zxvf nginx-1.4.2.tar.gz
    
       cd nginx-1.4.2
      
       ./configure && make && make install
      
      
第三步: 启动nginx

      whereis nginx         /*找到nginx的安装目录*/
      
       启动:/usr/local/nginx/sbin/nginx        /*默认安装的话一般存在这个目录下*/
    
       再查nginx进程
      
       ps aux | grep nginx
      
       显示如下的结果:
      
       root      22374  0.0  0.0  28900   556 ?        Ss   22:35   0:00 nginx: master process /usr/local/nginx/sbin/nginx
       nobody    22376  0.0  0.1  29300  2520 ?        S    22:35   0:00 nginx: worker process
       root      22646  0.0  0.0  12928   960 pts/1    S+   22:46   0:00 grep --color=auto nginx
      
第四步: 启动成功!!

 


在RedHat 6上编译安装openssl后,运行openssl version出现如下错误:


[html] view plain copy
openssl: error while loading shared libraries: libssl.so.1.1: cannot open shared object file: No such file or directory 

这是由于openssl库的位置不正确造成的。

解决方法:

在root用户下执行:

[html] view plain copy
ln -s /usr/local/lib64/libssl.so.1.1 /usr/lib64/libssl.so.1.1 
ln -s /usr/local/lib64/libcrypto.so.1.1 /usr/lib64/libcrypto.so.1.1 

 


附上

pcre-8.40.tar.gz

pcre-8.37.tar.gz

zlib-1.2.11.tar.gz

openssl-1.1.0f.tar.gz

nginx-1.4.2.tar.gz

 

过滤nginx日志

 

过滤2018年10月15号的出来
sed -n '/15\/Oct\/2018/p' access.log

过滤2018年10月14号-15号(时间段)
sed -n '/14\/Oct\/2018/,/15\/Oct\/2018/p' access.log

 

  

 

 

 


posted @ 2017-07-13 17:08  扶苏公子x  阅读(139)  评论(0编辑  收藏  举报