要點,先安裝編譯器、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; }