File tree Expand file tree Collapse file tree 1 file changed +86
-0
lines changed
Expand file tree Collapse file tree 1 file changed +86
-0
lines changed Original file line number Diff line number Diff line change 1+ #! /bin/sh
2+ # version
3+
4+ tengine_ver=1.4.6
5+ pid_file=/usr/local/data/nginx.pid
6+ # environment
7+ yum -y install pcre pcre-devel zlib zlib-devel
8+
9+ # install
10+ temp_dir=$( mktemp -d)
11+ clean (){
12+ rm -rf $temp_dir
13+ }
14+ trap clean EXIT INT
15+
16+ cd $temp_dir
17+ if [ ! -f tengine-$tengine_ver .tar.gz ]; then
18+ wget http://tengine.taobao.org/download/tengine-$tengine_ver .tar.gz
19+ fi
20+ tar zxvf tengine-$tengine_ver .tar.gz
21+ cd tengine-$tengine_ver
22+ ./configure --prefix=/usr/local/softwares/tengine --without-select_module --without-poll_module --without-procs --without-syslog --without-http_ssi_module --without-http_ssl_module --without-http_userid_module --without-http_footer_filter_module --without-http_access_module --without-http_auth_basic_module --without-http_autoindex_module --without-http_geo_module --without-http_map_module --without-http_split_clients_module --without-http_referer_module --without-http_rewrite_module --without-http_proxy_module --without-http_fastcgi_module --without-http_uwsgi_module --without-http_scgi_module --without-http_memcached_module --without-http_empty_gif_module --without-http_browser_module --without-http_upstream_check_module --without-http_upstream_least_conn_module --without-http_upstream_session_sticky_module --without-http_upstream_keepalive_module --without-http_upstream_ip_hash_module --without-http_upstream_consistent_hash_module --without-http_user_agent_module --without-http_stub_status_module --without-http --without-http-cache --without-mail_pop3_module --without-mail_imap_module --without-mail_smtp_module --without-pcre
23+ make install clean
24+
25+ mkdir -p /usr/local/logs/vm_tengine
26+ # config
27+ cat > /usr/local/softwares/tengine/conf/nginx.conf << EOF
28+
29+ user root root;
30+
31+ worker_processes 8;
32+
33+ error_log /usr/local/logs/vm_tengine/error.log crit;
34+
35+ pid $pid_file ;
36+
37+ worker_rlimit_nofile 65535;
38+
39+ events
40+ {
41+ use epoll;
42+ worker_connections 65535;
43+ }
44+
45+ http
46+ {
47+ include mime.types;
48+ default_type application/octet-stream;
49+
50+ server_names_hash_bucket_size 128;
51+ client_header_buffer_size 32k;
52+ large_client_header_buffers 4 32k;
53+ client_max_body_size 8m;
54+
55+ limit_zone lzone $binary_remote_addr 20m;
56+ limit_req_zone $binary_remote_addr zone=rzone:20m rate=200r/s;
57+
58+ sendfile on;
59+ tcp_nopush on;
60+
61+ keepalive_timeout 60;
62+
63+ tcp_nodelay on;
64+
65+ gzip on;
66+ gzip_min_length 1k;
67+ gzip_buffers 4 16k;
68+ gzip_http_version 1.0;
69+ gzip_comp_level 2;
70+ gzip_types text/plain application/x-javascript text/css application/xml;
71+ gzip_vary on;
72+
73+ include /usr/local/conf/vm_tengine/*.conf;
74+ }
75+
76+ EOF
77+
78+ cd /usr/local/conf
79+ mkdir -p vm_tengine
80+ if [ -f $pid_file ]; then
81+ pid=$( cat $pid_file )
82+ kill -s SIGUSR2 $pid
83+ fi
84+
85+ /usr/local/softwares/tengine/sbin/nginx
86+
You can’t perform that action at this time.
0 commit comments