yum install git
yum -y install pcre-devel openssl openssl-devel
git clone https://github.com/alibaba/tengine.git
cd tengine
./configure
make
make install
运行
/usr/local/nginx/sbin/nginx -t 检查配置
服务运行 配置文件
/etc/rc.d/init.d/nginx
chmod 775 /etc/rc.d/init.d/nginx
chkconfig nginx on
/etc/rc.d/init.d/nginx restart
动态模块功能
./configure --with-http_geoip_module=shared --with-http_sub_module=shared --with-http_flv_module=shared --with-http_random_index_module=shared --with-http_access_module=shared --with-http_autoindex_module=shared --with-http_upstream_ip_hash_module=shared --with-http_upstream_least_conn_module=shared
make
make install
默认安装在/usr/local/nginx目录下,启动nginx,使用nginx -m并看不到动态模块,因为还没插入,所有的模块都是static的。
默认的动态模块在modules目录里面,这时候可动态插入的模块还没有被加入配置文件,我们可以手动加入nginx.conf中
dso {
load ngx_http_access_module.so;
load ngx_http_autoindex_module.so;
load ngx_http_flv_module.so;
load ngx_http_geoip_module.so;
load ngx_http_random_index_module.so;
load ngx_http_sub_filter_module.so;
load ngx_http_upstream_ip_hash_module.so;
load ngx_http_upstream_least_conn_module.so;
}
启动nginx后使用nginx -m就可以看到懂爱模块都被标记被shared
tengine启用日记
cd tengine-1.5.1
./configure --with-syslog
make
make install
#access_log logs/access.log combined;
access_log syslog:user:info:10.136.238.56:514 combined;
请求超时设置
proxy_connect_timeout 90;
proxy_send_timeout 180;
proxy_read_timeout 180;
proxy_buffer_size 128k;
proxy_buffers 4 256k;
proxy_busy_buffers_size 256k;
proxy_temp_file_write_size 256k;
Windows下编译
与编译nginx类似,先安装cygwin
git clone https://github.com/alibaba/tengine.git
cd tengine
find /home/Administrator/tengine -name "*" | xargs dos2unix
./configure --prefix=. --sbin-path=nginx --with-cc-opt="-D FD_SETSIZE=4096"
make
make install
拷贝nginx.exe和cgwin\bin下需要的dll