CentOS 6.5 下 Tengine 安装记录
2016-05-20 15:59
507 查看
Tengine是由淘宝网发起的Web服务器项目。它在Nginx的基础上,针对大访问量网站的需求,添加了很多高级功能和特性。Tengine的性能和稳定性已经在大型的网站如淘宝网,天猫商城等得到了很好的检验。它的最终目标是打造一个高效、稳定、安全、易用的Web平台。
cd tengine-2.1.2
./configure
执行配置命令时,由于我的环境原因遇到以下几个错误,点击链接可查看解决方法:
checking for C compiler ... not found
./configure: error: the HTTP rewrite module requires the PCRE library.
You can either disable the module by using --without-http_rewrite_module
option, or install the PCRE library into the system, or build the PCRE library
statically from the source with nginx by using --with-pcre=<path> option.
./configure: error: SSL modules require the OpenSSL library.
You can either do not enable the modules, or install the OpenSSL library
into the system, or build the OpenSSL library statically from the source
with nginx by using --with-openssl=<path> option.
test -f 'src/http/ngx_http_request.h' && cp 'src/http/ngx_http_request.h' '/usr/local/nginx/include'
test -f 'src/http/ngx_http_config.h' && cp 'src/http/ngx_http_config.h' '/usr/local/nginx/include'
test -f 'src/http/ngx_http_core_module.h' && cp 'src/http/ngx_http_core_module.h' '/usr/local/nginx/include'
test -f 'src/http/ngx_http_cache.h' && cp 'src/http/ngx_http_cache.h' '/usr/local/nginx/include'
test -f 'src/http/ngx_http_variables.h' && cp 'src/http/ngx_http_variables.h' '/usr/local/nginx/include'
test -f 'src/http/ngx_http_script.h' && cp 'src/http/ngx_http_script.h' '/usr/local/nginx/include'
test -f 'src/http/ngx_http_upstream.h' && cp 'src/http/ngx_http_upstream.h' '/usr/local/nginx/include'
test -f 'src/http/ngx_http_upstream_round_robin.h' && cp 'src/http/ngx_http_upstream_round_robin.h' '/usr/local/nginx/include'
test -f 'src/http/ngx_http_busy_lock.h' && cp 'src/http/ngx_http_busy_lock.h' '/usr/local/nginx/include'
test -f 'src/http/modules/ngx_http_ssi_filter_module.h' && cp 'src/http/modules/ngx_http_ssi_filter_module.h' '/usr/local/nginx/include'
test -f 'src/http/modules/ngx_http_ssl_module.h' && cp 'src/http/modules/ngx_http_ssl_module.h' '/usr/local/nginx/include'
test -f 'src/http/modules/ngx_http_reqstat.h' && cp 'src/http/modules/ngx_http_reqstat.h' '/usr/local/nginx/include'
test -f 'objs/ngx_auto_headers.h' && cp 'objs/ngx_auto_headers.h' '/usr/local/nginx/include'
test -f 'objs/ngx_auto_config.h' && cp 'objs/ngx_auto_config.h' '/usr/local/nginx/include'
make[1]: Leaving directory `/opt/tengine-2.1.2'
/sbin/iptables -I INPUT -p tcp --dport 80 -j ACCEPT
/etc/init.d/iptables save
再次访问,看到了吗?
在文件末尾添加“/usr/local/nginx/sbin/nginx”
停止服务:/usr/local/nginx/sbin/nginx -s stop
其它命令:
/usr/local/nginx/sbin/nginx -h
nginx version: nginx/1.7.5
Usage: nginx [-?hvVtq] [-s signal] [-c filename] [-p prefix] [-g directives]
Options:
-?,-h : this help
-v : show version and exit
-V : show version and configure options then exit
-t : test configuration and exit
-q : suppress non-error messages during configuration testing
-s signal : send signal to a master process: stop, quit, reopen, reload
-p prefix : set prefix path (default: /usr/local/nginx/)
-c filename : set configuration file (default: conf/nginx.conf)
-g directives : set global directives out of configuration file 文件权限问题:
有可能因为目录、文件权限过高,导致无权访问文件,可以通过以下命令修改权限:
chmod -R 777 ./uploadfile
同样,你按照这个来安装Nginx也没有问题。
相关阅读:
CentOS6.5下Nginx1.7.4安装记录
使用nginx的rewrite实现代理指定目录命令方法
MacOS 下 Nginx 安装记录
官网:
http://tengine.taobao.org/index_cn.html下载源码
wget http://tengine.taobao.org/download/tengine-2.1.2.tar.gz解压
tar -zxvf tengine-2.1.2.tar.gz配置
进入目录cd tengine-2.1.2
./configure
执行配置命令时,由于我的环境原因遇到以下几个错误,点击链接可查看解决方法:
checking for C compiler ... not found
./configure: error: the HTTP rewrite module requires the PCRE library.
You can either disable the module by using --without-http_rewrite_module
option, or install the PCRE library into the system, or build the PCRE library
statically from the source with nginx by using --with-pcre=<path> option.
./configure: error: SSL modules require the OpenSSL library.
You can either do not enable the modules, or install the OpenSSL library
into the system, or build the OpenSSL library statically from the source
with nginx by using --with-openssl=<path> option.
安装
make && make install最后部分输出:test -f 'src/http/ngx_http_request.h' && cp 'src/http/ngx_http_request.h' '/usr/local/nginx/include'
test -f 'src/http/ngx_http_config.h' && cp 'src/http/ngx_http_config.h' '/usr/local/nginx/include'
test -f 'src/http/ngx_http_core_module.h' && cp 'src/http/ngx_http_core_module.h' '/usr/local/nginx/include'
test -f 'src/http/ngx_http_cache.h' && cp 'src/http/ngx_http_cache.h' '/usr/local/nginx/include'
test -f 'src/http/ngx_http_variables.h' && cp 'src/http/ngx_http_variables.h' '/usr/local/nginx/include'
test -f 'src/http/ngx_http_script.h' && cp 'src/http/ngx_http_script.h' '/usr/local/nginx/include'
test -f 'src/http/ngx_http_upstream.h' && cp 'src/http/ngx_http_upstream.h' '/usr/local/nginx/include'
test -f 'src/http/ngx_http_upstream_round_robin.h' && cp 'src/http/ngx_http_upstream_round_robin.h' '/usr/local/nginx/include'
test -f 'src/http/ngx_http_busy_lock.h' && cp 'src/http/ngx_http_busy_lock.h' '/usr/local/nginx/include'
test -f 'src/http/modules/ngx_http_ssi_filter_module.h' && cp 'src/http/modules/ngx_http_ssi_filter_module.h' '/usr/local/nginx/include'
test -f 'src/http/modules/ngx_http_ssl_module.h' && cp 'src/http/modules/ngx_http_ssl_module.h' '/usr/local/nginx/include'
test -f 'src/http/modules/ngx_http_reqstat.h' && cp 'src/http/modules/ngx_http_reqstat.h' '/usr/local/nginx/include'
test -f 'objs/ngx_auto_headers.h' && cp 'objs/ngx_auto_headers.h' '/usr/local/nginx/include'
test -f 'objs/ngx_auto_config.h' && cp 'objs/ngx_auto_config.h' '/usr/local/nginx/include'
make[1]: Leaving directory `/opt/tengine-2.1.2'
修改配置文件:
vi /usr/local/nginx/conf/nginx.conf启动服务:
/usr/local/nginx/sbin/nginx访问:
打开浏览器,输入以下地址访问吧: http://你的服务器IP/ 如果你修改了端口号,记得在后面加上端口 http://你的服务器IP:88/开放防火墙端口
如果你通过以上地址访问不了的话,通常是防火墙的原因!/sbin/iptables -I INPUT -p tcp --dport 80 -j ACCEPT
/etc/init.d/iptables save
再次访问,看到了吗?
配置开机启动
vi /etc/rc.d/rc.local在文件末尾添加“/usr/local/nginx/sbin/nginx”
常用命令:
重新加载配置文件:/usr/local/nginx/sbin/nginx -s reload停止服务:/usr/local/nginx/sbin/nginx -s stop
其它命令:
/usr/local/nginx/sbin/nginx -h
nginx version: nginx/1.7.5
Usage: nginx [-?hvVtq] [-s signal] [-c filename] [-p prefix] [-g directives]
Options:
-?,-h : this help
-v : show version and exit
-V : show version and configure options then exit
-t : test configuration and exit
-q : suppress non-error messages during configuration testing
-s signal : send signal to a master process: stop, quit, reopen, reload
-p prefix : set prefix path (default: /usr/local/nginx/)
-c filename : set configuration file (default: conf/nginx.conf)
-g directives : set global directives out of configuration file 文件权限问题:
有可能因为目录、文件权限过高,导致无权访问文件,可以通过以下命令修改权限:
chmod -R 777 ./uploadfile
结束语
一路装下来发现,就是外表的名字变了,内部还都是Nginx,可以完全按照Nginx的安装方式来安装。同样,你按照这个来安装Nginx也没有问题。
相关阅读:
CentOS6.5下Nginx1.7.4安装记录
使用nginx的rewrite实现代理指定目录命令方法
MacOS 下 Nginx 安装记录
相关文章推荐
- linux下安装配置svn独立服务器
- Linux 磁盘分区、格式化、目录挂载
- linux有名管道的一点理解
- 通用java程序linux启动脚本精简版
- NODEJS 在Centos下面的自动启动
- php7在centos上源码安装
- 【随笔】Linux文件的三个时间属性
- CentOS 7 时区修改及时间同步实例
- Linux命令统计源码行数
- Linux 静态库和动态库的区别
- MyEclipse 2016 Windows/Linux/Mac 版下载地址
- centos 下面修改mysql的root密码
- 在linux中使用mingw为64位windows交叉编译程序
- linux cron计划任务
- Centos7下LNMP安装log4php,phpunit
- linux定时任务crontab设置
- linux
- Linux日常维护命令
- linux下对文件的读写操作
- 每天一个Linux命令(22)find命令_命令详解