zoukankan      html  css  js  c++  java
  • LNMP

    [root@xzwserver tools]# cat /etc/centos-release
    CentOS release 6.7 (Final)

    [root@xzwserver tools]# uname -r
    2.6.32-573.el6.x86_64

    [root@xzwserver tools]# rpm -qa pcre pcre-devel gcc gcc-c++
    pcre-7.8-7.el6.x86_64


    [root@xzwserver tools]# yum -y install pcre-devel pcre

    [root@xzwserver tools]# rpm -qa openssl openssl-devel
    openssl-1.0.1e-42.el6.x86_64

    [root@xzwserver tools]# yum install -y openssl openssl-devel

     mkdir -p /home/tools
    cd /home/tools
    wget -q http://nginx.org/download/nginx-1.12.0.tar.gz

    [root@xzwserver tools]# useradd nginx -s /sbin/nologin -M
    [root@xzwserver tools]# tar xf nginx-1.12.0.tar.gz
     cd nginx-1.12.0
    [root@xzwserver nginx-1.12.0]# ./configure --user=nginx --group=nginx --prefix=/application/nginx-1.12.0/ --with-http_stub_status_module --with-http_ssl_module
    [root@xzwserver nginx-1.12.0]# ./configure --help
    make
    make install
    [root@xzwserver nginx-1.12.0]# ln -s /application/nginx-1.12.0/ /application/nginx
    [root@xzwserver nginx-1.12.0]# ll /application/nginx
    lrwxrwxrwx. 1 root root 26 May  8 16:31 /application/nginx -> /application/nginx-1.12.0/


    [root@xzwserver nginx-1.12.0]# /application/nginx/sbin/nginx -t
    nginx: the configuration file /application/nginx-1.12.0//conf/nginx.conf syntax is ok
    nginx: configuration file /application/nginx-1.12.0//conf/nginx.conf test is successful

    [root@xzwserver nginx-1.12.0]# /application/nginx/sbin/nginx

    [root@xzwserver nginx-1.12.0]# netstat -anptu | grep 80
    tcp        0      0 0.0.0.0:80                  0.0.0.0:*                   LISTEN      4359/nginx

    [root@xzwserver nginx-1.12.0]# wget 127.0.0.1 或者 [root@xzwserver nginx-1.12.0]# curl 127.0.0.1

    sed -i 's/SELINUX=enforcing/SELINUX=disabled/' /etc/selinux/config
     grep 'SELINUX=disabled' /etc/selinux/config
    setenforce 0
    getenforce



     vim /etc/rc.d/rc.local  开机自启

    mkdir html/www -p
      252  echo "http://www.etiantian.org" > html/www/index.html
      253  cat html/www/index.html


      257  egrep -v '#|^$' conf/nginx.conf.default > conf/nginx.conf
      258  vim conf/nginx.conf
      259  sbin/nginx -t
      260  sbin/nginx -s reload

    worker_processes  1;
    events {
        worker_connections  1024;
    }
    http {
        include       mime.types;
        default_type  application/octet-stream;
        sendfile        on;
        keepalive_timeout  65;
        server {
            listen       80;
            server_name  localhost;
            location / {
                root   html;
                index  index.html index.htm;
            }
            error_page   500 502 503 504  /50x.html;
            location = /50x.html {
                root   html;
            }
        }
        server {
            listen       80;
            server_name  www.etiantian.org;
            location / {
                root   html/www;
                index  index.html index.htm;
            }
        }
    }
    ~    

  • 相关阅读:
    tomcat配置环境变量
    Java实现简单的正则表达式匹配
    vi编辑器用法
    MyEclipse中自定义maven命令(添加maven 命令)
    dos窗口编译*.java文件 解决 java “错误:编码GBK 的不可映射字符”
    如何循环枚举类型
    Java枚举的小用法
    Java读取maven目录下的*.properties配置文件
    用MyEclipse将Maven Dependencies中的jar包导出
    MD5加密与base64编码
  • 原文地址:https://www.cnblogs.com/linux985/p/7221678.html
Copyright © 2011-2022 走看看