zoukankan      html  css  js  c++  java
  • Nginx服务安装指南

    rpm -qa|grep pcre*
    pcre-7.8-7.el6.x86_64
    pcre-devel-7.8-7.el6.x86_64
    
    如果缺少,可以用yum来安装,也是建议用yum方式安装。
    yum install pcre pcre-devel -y
    
    rpm -qa|grep openssl*
    rpm -qa|grep openssl*
    openssh-5.3p1-122.el6.x86_64
    openssh-clients-5.3p1-122.el6.x86_64
    openssl-devel-1.0.1e-57.el6.x86_64
    openssl-1.0.1e-57.el6.x86_64
    openssh-server-5.3p1-122.el6.x86_64
    
    yum install openssl openssl-devel -y
    yum install lsof -y
    useradd nginx -s /sbin/nologin -M
    scp /Users/vincent/Downloads/nginx-1.12.0.tar.gz root@10.199.199.89:/root/
    tar xf nginx-1.12.0.tar.gz
    cd nginx-1.12.0
    ./configure --user=nginx --group=nginx --prefix=/application/nginx --with-http_stub_status_module --with-http_ssl_module
    make 
    make install
    ls -l /application/nginx/
    ls -l /application/nginx/
    总用量 16
    drwxr-xr-x. 2 root  root 4096 5月  22 08:49 conf
    drwxr-xr-x. 2 root  root 4096 5月  22 08:49 html
    drwxr-xr-x. 2 root  root 4096 5月  22 08:50 logs
    drwxr-xr-x. 2 root  root 4096 5月  22 08:49 sbin
    /application/nginx/sbin/nginx -t
    nginx: the configuration file /application/nginx/conf/nginx.conf syntax is ok
    nginx: configuration file /application/nginx/conf/nginx.conf test is successful
    启动命令
    /application/nginx/sbin/nginx
    
    lsof -i :80
    COMMAND  PID  USER   FD   TYPE DEVICE SIZE/OFF NODE NAME
    nginx   4352  root    6u  IPv4  16423      0t0  TCP *:http (LISTEN)
    nginx   4353 nginx    6u  IPv4  16423      0t0  TCP *:http (LISTEN)
    
    netstat -lnt|grep 80
    tcp        0      0 0.0.0.0:80                  0.0.0.0:*                   LISTEN
    
    wget 127.0.0.1 
    
    curl 127.0.0.1
    
    vim /etc/sysconfig/iptables
    -A INPUT -m state --state NEW -m tcp -p tcp --dport 80 -j ACCEPT
    :wq!
    service iptables restart
    
    http://10.199.199.89
    
    Welcome to nginx!
  • 相关阅读:
    监听本机tcp和udp的端口
    sysstat-----获取服务器负载历史记录
    inode索引详解
    tcpdump详解
    Windws Server 2008 R2 WEB环境配置之IIS7/IIS7.5+FastCGI+PHP 5.6.4+MYSQL+phpMyAdmin
    echo 命令
    带宽、流量、下载速度之间的换算
    windows 下解决 Time_Wait 和 CLOSE_WAIT 方法
    LNMP环境部署
    关于旅行
  • 原文地址:https://www.cnblogs.com/vincent-liang/p/6887060.html
Copyright © 2011-2022 走看看