要点,先安装编译器、pcre库、openssl库javascript
1.安装编译器,输入命令css
yum install gcc
yum install gcc-c++html
2.安装pcre库java
yum install pcre-develnginx
3.安装openssl库c++
yum install openssl-develjson
1.下载TEngine,tengine-1.5.2.tar.gz,放到目录/home/tengine下浏览器
2.输入命令tar zxvf tengine-1.5.2.tar.gzapp
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; }