zoukankan      html  css  js  c++  java
  • nginx安装

    切换到进入的解压缩目录

    [root@iz2zecue91mx9mhsl26o1fz nginx-1.14.0]# pwd
    /root/test/nginx-1.14.0
    [root@iz2zecue91mx9mhsl26o1fz nginx-1.14.0]#


    useradd -s /sbin/nologin -M www
    ./configure --prefix=/app/nginx-1.14.0 --user=www --group=www --with-http_stub_status_module --with-http_ssl_module 

    make make install
    复制代码
    启动nginx (端口号80)
    [root@iz2zecue91mx9mhsl26o1fz nginx-1.14.0]# /app/nginx-1.14.0/sbin/nginx 查看端口号是否开启 lsof -i:80


     #关闭防火墙 
    ##临时 
    /etc/init.d/iptables stop
    /etc/init.d/iptables stop

    ##永久-关闭(开机自启动)
    chkconfig iptables off 
     
     
    关闭selinux
     vim /etc/selinux/config 
     
     ##临时修改生效 (临时生效用,重启不方便)
    setenforce 0 
     
    永久生效是重启服务器
    
    
    复制代码

    报错解决:

    复制代码
    需要XX library
    那么 就 yum install 库小写 +-devel  
    
    #报错1 
    #./configure: error: the HTTP rewrite module requires the PCRE library.
    yum install pcre-devel  -y 
    
    #报错2
    #./configure: error: SSL modules require the OpenSSL library.
    yum install openssl-devel  -y 


    清空空行与#

    egrep -v "^$|#" /app/nginx-1.14.0/conf/nginx.conf.default >/app/nginx-1.14.0/conf/nginx.conf

    创建软连接

     ln -s /app/nginx-1.14.0/sbin/nginx  /sbin/ 
     
    重启
    [root@py-fullstack-10 ~]# nginx -s reload (修改完nginx.conf后需要重启否则不生效)
     

     

     mkdir -p /app/nginx-1.14.0/html/{www,blog}

    echo 'www.pythonav.com' > /app/nginx-1.14.0/html/www/index.html

    复制代码

     

    学习的命令

     

    vimdiff nginx.conf nginx.conf.bak

    比较两个文件差异

  • 相关阅读:
    如何使用博客园页面自定义编辑功能之----打赏
    bootstrap table 分页后,重新搜索的问题
    jquery.ajax 跨域请求webapi,设置headers
    玩世不恭----进阶篇
    玩世不恭----准备篇
    数据结构学习(一)单链表
    华人十二年实现“软件工程”革命
    IntelliJ IDEA中自定义方法注释模板
    log
    日常环境构建记录
  • 原文地址:https://www.cnblogs.com/xyhh/p/10855549.html
Copyright © 2011-2022 走看看