Nginx 미들웨어 웹 서비스 설치

  pcre 
[root@lnmp01 ~]# rpm -qa pcre pcre-devel
[root@lnmp01 ~]# yum install -y openssl openssl-devel
[root@lnmp01 ~]# rpm -qa pcre pcre-devel  
pcre-devel-7.8-7.el6.x86_64
pcre-7.8-7.el6.x86_64




    nginx-1.6.3
[root@lnmp01 ~]# rpm -qa nginx
[root@lnmp01 ~]# mkdir /home/lufeng/tools -p
[root@lnmp01 ~]# cd /home/lufeng/tools/
[root@lnmp01 tools]# wget -q http://nginx.org/download/nginx-1.6.3.tar.gz
[root@lnmp01 tools]# tar xf nginx-1.6.3.tar.gz 
[root@lnmp01 tools]# cd nginx-1.6.3

[root@lnmp01 nginx-1.6.3]# useradd nginx -s /sbin/nologin -M

[root@lnmp01 nginx-1.6.3]# ./configure --prefix=/application/nginx-1.6.3 --user=nginx --group=nginx --with-http_ssl_module --with-http_stub_status_module

[root@lnmp01 nginx-1.6.3]# make
[root@lnmp01 nginx-1.6.3]# make install
[root@lnmp01 tools]# ln -s /application/nginx-1.6.3/ /application/nginx


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

[root@lnmp01 tools]# /application/nginx/sbin/nginx
[root@lnmp01 tools]# netstat -lntup|grep nginx

[root@lnmp01 tools]# wget 127.0.0.1
[root@lnmp01 tools]# curl 127.0.0.1


            
    :

[root@lnmp01 conf]# cat nginx.conf
worker_processes  1;
events {
    worker_connections  1024;
}
http {
    include       mime.types;
    default_type  application/octet-stream;
    sendfile        on;
    keepalive_timeout  65;
include extra/www.conf;
include extra/blog.conf;
include extra/bbs.conf;
}


[root@lnmp01 conf]# cat ./extra/www.conf 
server {
       listen         80;
       server_name    www.lufeng.com;
       location / {
            root      html/www;
            index     index.html index.html;
        }
}
[root@lnmp01 conf]# cat ./extra/bbs.conf 
server {
       listen         80;
       server_name    bbs.lufeng.com;
       location / {
            root      html/bbs;
            index     index.html index.html;
        }
}
[root@lnmp01 conf]# cat ./extra/blog.conf 
    server {
       listen         80;
       server_name    blog.lufeng.com;
       location / {
            root      html/blog;
            index     index.html index.html;
        }
}

좋은 웹페이지 즐겨찾기