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

    一、

    wget http://nginx.org/download/nginx-1.5.9.tar.gz直接在Linux上用命令下载

    二、

    解压 tar -zxvf nginx-1.5.9.tar.gz 

    三、

    设置一下配置信息 ./configure --prefix=/usr/local/nginx 

    四、

    make 编译

    五、

    make install 安装

    在配置信息的时候,也就是在第三步,出现了一下错误:

    错误为:./configure: error: the HTTP rewrite module requires the PCRE library.
    
    安装pcre-devel解决问题
    yum -y install pcre-devel
    错误提示:./configure: error: the HTTP cache module requires md5 functions
    from OpenSSL library.   You can either disable the module by using
    --without-http-cache option, or install the OpenSSL library into the system,
    or build the OpenSSL library statically from the source with nginx by using
    --with-http_ssl_module --with-openssl=<path> options.
    
    解决办法:
    
    yum -y install openssl openssl-devel


    ./nginx -v 先打开/usr/local/nginx/sbin 再执行命令

    安装成功后,只能本地访问,还需要设置防火墙

    vim /etc/sysconfig/iptables 编辑防火墙文件
    新增
    -A INPUT -m state --state NEW -m tcp -p tcp --dport 80 -j ACCEPT //--防火墙不拦截80端口 保存退出 :wq service iptables restart 重启防火墙

    卸载方式:

    直接删除安装目录

    //启动
    ./nginx
    
    //关闭
    pkill  nginx

    还有些其他方式关闭启动,网上搜就可以

  • 相关阅读:
    Markdown语法
    简易银行管理系统
    登录sql sever
    MainActivity中R为红色
    PLC STL any数据类型
    Oracle ORA-12541,ORA-12514错误
    Myeclispe下struts-config.xml文件无法图形界面打开
    SSH报错
    Myeclispe 代码自动补全
    Mac下多个jdk自由切换
  • 原文地址:https://www.cnblogs.com/bruce-gou/p/5712893.html
Copyright © 2011-2022 走看看