CentOS6.5安装TEngine(Nginx)

对着背影说爱祢 提交于 2019-12-02 06:40:29

要点,先安装编译器、pcre库、openssl库

 

 

1.安装编译器,输入命令

yum install gcc
yum install gcc-c++

 

2.安装pcre库

yum  install pcre-devel

 

 

3.安装openssl库

yum install openssl-devel

 

 

1.下载TEngine,tengine-1.5.2.tar.gz,放到目录/home/tengine下

2.输入命令tar zxvf tengine-1.5.2.tar.gz

3.进入解压目录tengine-1.5.2,输入命令./configure --prefix=/home/tengine/tengine15 --with-http_ssl_module  (指定安装目录、安装ssl模块)

4.编译安装,输入命令,

make
make install

5.启动,进入tengine15,输入命令./sbin/nginx -s start(停止用stop)

6.测试是否成功,浏览器输入http://localhost,或者http://IP(注意要开放80端口)

 

chown root nginx 
chmod u+s nginx

 

user  apps;
worker_processes  auto;
worker_rlimit_nofile  65535;

 

events {
    worker_connections  65535;
}

 

    gzip on;
    gzip_min_length 1000;
    gzip_buffers 4 8k;
    gzip_types text/plain application/x-javascript text/css application/xml text/javascript application/json application/javascript;
    
    client_max_body_size 15M;
    proxy_next_upstream error timeout http_503;

    
    upstream mainwww{
        server   10.24.9.37:9000;
        server   10.24.9.38:9000;

 

        check interval=3000 rise=2 fall=1 timeout=1000 type=http;
        check_http_send "HEAD /xxxx HTTP/1.0\r\n\r\n";
        check_http_expect_alive http_2xx http_3xx http_4xx;
    }

 

       access_log off;

       # location / {
       #     root   html;
       #     index  index.html index.htm;
       # }

        proxy_read_timeout 1800;
        proxy_send_timeout 1800;
        
        location / {
        proxy_pass   http://mainwww;
            proxy_set_header Host $host;
            proxy_set_header X-Real-IP $remote_addr;
            proxy_set_header REMOTE-HOST $remote_addr;
            proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
            root   html;
            index  index.html index.htm;
        }

 

        location /status-admin {
            check_status;
            access_log off;
        }

 

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!