首先下载tengine包,我这里提示tengine-1.4.2.tar.gz 地址http://down.51cto.com/data/1891386
安装过程中可能常见的两种错误提示:
./configure:error:the HTTP rewrite module requires the PCRE library.
./configure:error:SSL modules require the OpenSSL library.
#tar xf tengine-1.4.2.tar.gz
#cd tengine
#./configure --help|less 分列看下帮助,这里不是像常用的--sysconfdir指定安装目录
#./configure --prefix=/usr/local/tengine --conf-path=/etc/tengine/tengine.conf
可能会有下面这种提示
./configure:error:the HTTP rewrite module requires the PCRE library.
解决方式 找到pcre-devel 包,安装 #yum install pcre-devel
可是#./configure --prefix=/usr/local/tengine --conf-path=/etc/tengine/tengine.conf --without-http_rewrite_module
如果再有下面出错提示
./configure:error:SSL modules require the OpenSSL library.
解决方式 找到openssl-devel 包,(#yum install openssl-devel)安装至到没有错误提示
即可继续向下安装。
#make
#make install
在/etc/profile 里面export PATH USER LOGNAME MAIL HOSTNAME前加一条
PATH=$PATH:/usr/local/tengine/sbin
读一下这个脚本
可重新登记下也可以。
#nginx
#netstat -tnlp 查看程序对应的端口号80
或是用其它电脑浏览器打开该机器对应的ip。可以看到nginx 的首页