Tengine源码编译安装

发布 : 2016-03-27 分类 : 大数据 浏览 :

1.上传压缩文件

1.1.创建文件夹目录

1.2.移动文件夹

1.3.解压压缩文件


1.安装tengine依赖

1
[root@node1 tengine-2.1.0]# yum install -y gcc openssl-devel pcre-devel zlib-devel


2.配置

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
[root@node1 tengine-2.1.0]# ./configure \
--prefix=/opt/modules/tengine-2.1.0/ \
--error-log-path=/var/log/nginx/error.log \
--http-log-path=/var/log/nginx/access.log \
--pid-path=/var/run/nginx/nginx.pid \
--lock-path=/var/lock/nginx.lock \
--with-http_ssl_module \
--with-http_flv_module \
--with-http_stub_status_module \
--with-http_gzip_static_module \
--http-client-body-temp-path=/var/tmp/nginx/client/ \
--http-proxy-temp-path=/var/tmp/nginx/proxy/ \
--http-fastcgi-temp-path=/var/tmp/nginx/fcgi/ \
--http-uwsgi-temp-path=/var/tmp/nginx/uwsgi \
--http-scgi-temp-path=/var/tmp/nginx/scgi \
--with-pcre

1
预编译成功

3.安装tengine

1
[root@node1 tengine-2.1.0]# make && make install

4.添加服务

4.1.在/etc/init.d下面创建nginx

1
2
3
进入/etc/init.d目录
[root@node1 tengine-2.1.0]# cd /etc/init.d
[root@node1 init.d]# vi nginx

4.2.修改nginx文件内容的路径,从window拷贝到linux

1
2
3
复制文本的注意事项:

在Linux主机中输入vi nginx 再输入i才进行复制,这样在复制的时候就不会有代码丢失

4.3.修改nginx文件权限755

1
[root@node1 init.d]# chmod 755 nginx

4.3.1.启动nginx,出现如下错误,原因:没有创建该目录

4.4.创建目录

1
2
[root@node1 tengine-2.1.0]# cd /var/tmp/
[root@node1 tmp]# mkdir -p /var/tmp/nginx/

4.5.关闭防火墙

1
[root@node1 sbin]# service iptables stop

4.6.启动tengine

1
2
3
4
5
6
7
[root@node1 modules]# cd tengine-2.1.0
[root@node1 tengine-2.1.0]# cd sbin
[root@node1 sbin]# ll
total 6224
-rwxr-xr-x 1 root root 18983 Feb 29 03:20 dso_tool
-rwxr-xr-x 1 root root 6348971 Feb 29 03:20 nginx
[root@node1 sbin]# ./nginx

4.6.1.安装成功

1
在浏览器地址栏输入:http://192.168.230.10/

4.6.2.查看nginx服务状态

1
2
[root@node1 sbin]# service nginx status
nginx (pid 14254 14253) is running...

4.7.2.查找nginx进程

1
2
3
4
5
[root@node1 tengine-2.1.0]# ps -aux | grep 'nginx'
Warning: bad syntax, perhaps a bogus '-'? See /usr/share/doc/procps-3.2.8/FAQ
root 14253 0.0 0.1 45296 1212 ? Ss 03:42 0:00 nginx: master process ./nginx
nobody 14254 0.0 0.2 45756 2204 ? S 03:42 0:00 nginx: worker process
root 14316 0.0 0.0 103248 876 pts/2 S+ 05:59 0:00 grep nginx

4.7.3.添加nginx文件到系统服务中去

1
2
[root@node1 init.d]# chkconfig --add nginx
service nginx does not support chkconfig

4.7.4.查看是否添加成功

1
2
[root@node1 init.d]# chkconfig --list nginx
service nginx does not support chkconfig
本文作者 : Matrix
原文链接 : https://matrixsparse.github.io/2016/03/27/Tengine源码编译安装/
版权声明 : 本博客所有文章除特别声明外,均采用 CC BY-NC-SA 4.0 许可协议。转载请注明出处!

知识 & 情怀 | 二者兼得

微信扫一扫, 向我投食

微信扫一扫, 向我投食

支付宝扫一扫, 向我投食

支付宝扫一扫, 向我投食

留下足迹