编译安装 Centos 7 x64 + tengine.2.0.3 (实测+笔记)
系统硬件:vmware vsphere (CPU:2*4核,内存2G)
系统版本:CentOS Linux release 7.0.1406
安装步骤:
1.系统环境
1.1 更新系统
[root@centos ~]# yum update -y
2.安装tengine
2.1.下载文件准备安装
[root@centos ~]# cd /usr/local/src/
[root@centos ~]# wget ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/pcre-8.35.tar.gz
[root@centos ~]# wget http://zlib.net/zlib-1.2.8.tar.gz
[root@centos ~]# wget http://www.openssl.org/source/openssl-1.0.1h.tar.gz
[root@centos ~]# wget http://www.canonware.com/download/jemalloc/jemalloc-3.6.0.tar.bz2
[root@centos ~]# wget http://tengine.taobao.org/download/tengine-2.0.3.tar.gz
2.2 更新包
[root@centos ~]# yum install zlib-devel openssl-devel -y
2.3 安装Pcre
cd /usr/local/src
mkdir /usr/local/pcre
tar zxvf pcre-8.35.tar.gz
cd pcre-8.35
./configure --prefix=/usr/local/pcre
make && make install
2.4 安装openssl
cd /usr/local/src
mkdir /usr/local/openssl
tar zxvf openssl-1.0.1h.tar.gz
cd openssl-1.0.1h
./config --prefix=/usr/local/openssl
make && make install
vi /etc/profile
export PATH=$PATH:/usr/local/openssl/bin
:wq!
source /etc/profile
2.5 安装zlib
cd /usr/local/src
mkdir /usr/local/zlib
tar zxvf zlib-1.2.8.tar.gz
cd zlib-1.2.8
./configure --prefix=/usr/local/zlib
make && make install
2.6 安装jemalloc
cd /usr/local/src
mkdir /usr/local/jemalloc
tar xvf jemalloc-3.6.0.tar.bz2
cd jemalloc-3.6.0
./configure --prefix=/usr/local/jemalloc
make && make install
4.4 创建www用户和组,创建www虚拟主机使用的目录,以及Nginx使用的日志目录,并且赋予他们适当的权限
groupadd www
useradd -g www www -s /bin/false
4.5 安装tengine
[root@centos ~]# cd /usr/local/src/
[root@centos ~]# tar zxvf tengine-2.1.2.tar.gz
[root@centos ~]# cd tengine-2.1.2
伪装服务器信息(可以不修改)
[root@centos ~]# vim ./src/core/nginx.h
修改NGINX_VERSION为你希望显示的版号
修改NGINX_VER为你希望显示的名称
修改NGINX_VAR 为你希望显示的名称
保存
开始安装NGINX
./configure --prefix=/usr/local/nginx --user=www --group=www --with-http_stub_status_module --with-http_ssl_module --with-http_gzip_static_module --with-openssl=/usr/local/src/openssl-1.0.1h --with-zlib=/usr/local/src/zlib-1.2.8 --with-pcre=/usr/local/src/pcre-8.35 --with-jemalloc=/usr/local/src/jemalloc-3.6.0
[root@centos ~]# make && make install
4.6 修改 nginx.conf
[root@centos ~]# vi /usr/local/nginx/conf/nginx.conf
修改前面几行为:
user www www;
worker_processes 4;
error_log logs/error.log crit;
pid logs/nginx.pid;
events{
  use epoll;
  worker_connections 65535;
}
4.7 测试和运行
[root@centos ~]# ldconfig
[root@centos ~]# cd /usr/local/nginx
[root@centos ~]# ./sbin/nginx -t
如果显示下面信息,即表示配置没问题
nginx: the configuration file /usr/local/nginx/conf/nginx.conf syntax is ok
nginx: configuration file /usr/local/nginx/conf/nginx.conf test is successful
输入代码运行nginx服务
[root@centos ~]# /usr/local/nginx/sbin/nginx
[root@centos ~]# ps au|grep nginx ps aux | grep tengine
如果显以类似下面的信息,即表示nginx已经启动
root 2013 0.0 0.0 103156 856 pts/0 S+ 03:22 0:00 grep nginx
输入代码检测是否支持加速
查看是否生效
[root@centos ~]# lsof -n | grep jemalloc
ginx 2346 root mem REG 253,1 1824470 51571788 /usr/local/lib/libjemalloc.so.1
nginx     2347          www  mem       REG              253,1   1824470   51571788 /usr/local/lib/libjemalloc.so.1
nginx     2348          www  mem       REG              253,1   1824470   51571788 /usr/local/lib/libjemalloc.so.1
nginx     2349          www  mem       REG              253,1   1824470   51571788 /usr/local/lib/libjemalloc.so.1
nginx     2350          www  mem       REG              253,1   1824470   51571788 /usr/local/lib/libjemalloc.so.1
[root@centos ~]# curl http://localhost
4.8 iptables防火墙开放80端口
4.9 作为服务,开机后启动
[root@centos ~]# vi /usr/lib/systemd/system/tengine.service
增加以下内容
[Unit]
Description=The nginx HTTP and reverse proxy server
After=syslog.target network.target remote-fs.target nss-lookup.target
[Service]
Type=forking
PIDFile=/usr/local/nginx/logs/nginx.pid
ExecStartPre=/usr/local/nginx/sbin/nginx -t
ExecStart=/usr/local/nginx/sbin/nginx
ExecReload=/bin/kill -s HUP $MAINPID
ExecStop=/bin/kill -s QUIT $MAINPID
PrivateTmp=true
[Install]
WantedBy=multi-user.target
:wq 保存退出
chkconfig tengine on
[root@centos ~]# systemctl stop tengine
[root@centos ~]# systemctl start tengine
[root@centos ~]# systemctl reload tengine
[root@centos ~]# reboot
[root@centos ~]# mkdir -p /_htdocs
[root@centos ~]# chmod +w /_htdocs
[root@centos ~]# chown -R www:www /_htdocs
编译安装 Centos 7 x64 + tengine.2.0.3 (实测+笔记)的更多相关文章
- Centos7 编译安装 Nginx PHP Mariadb Memcached 扩展 ZendOpcache扩展 (实测 笔记 Centos 7.3 + Mariadb 10.1.20 + Nginx 1.10.2 + PHP 7.1.0 + Laravel 5.3 )
		
环境: 系统硬件:vmware vsphere (CPU:2*4核,内存2G,双网卡) 系统版本:CentOS-7-x86_64-Minimal-1611.iso 安装步骤: 1.准备 1.0 查看硬 ...
 - Centos7 编译安装 Nginx PHP Mariadb Memcached 扩展 ZendOpcache扩展 (实测 笔记 Centos 7.3 + Openssl 1.1.0e + Mariadb 10.1.22 + Nginx 1.12.0 + PHP 7.1.4 + Laravel 5.4 )
		
环境: 系统硬件:vmware vsphere (CPU:2*4核,内存2G,双网卡) 系统版本:CentOS-7-x86_64-Minimal-1611.iso 安装步骤: 1.准备 1.0 查看硬 ...
 - Centos7 编译安装 Nginx PHP Mariadb Memcache扩展 ZendOpcache扩展 (实测 笔记 Centos 7.0 + Mariadb 10.1.9 + Nginx 1.9.9 + PHP 5.5.30)
		
环境: 系统硬件:vmware vsphere (CPU:2*4核,内存2G,双网卡) 系统版本:CentOS-7-x86_64-Minimal-1503-01.iso 安装步骤: 1.准备 1.1 ...
 - CentOS7 编译安装 Git 服务器  Centos 7.0 + Git 2.2.0 + gitosis (实测 笔记)
		
环境: 系统硬件:vmware vsphere (CPU:2*4核,内存2G,双网卡) 系统版本:CentOS-7.0-1406-x86_64-DVD.iso 服务器IP:192.168.1.31 域 ...
 - python3 安装 #zlib zlibmodule.c -I$(prefix)/include -L$(exec_prefix)/lib -lz  RHEL 8 install Python 3 or Python 2 using yum  编译安装 python3.7.4 .  OpenSSL 1.0.2 or 1.1. Consequently, OpenSSL 0.9.8 and 1.0
		
#zlib zlibmodule.c -I$(prefix)/include -L$(exec_prefix)/lib -lz Modules/Setup.dist https://askubuntu ...
 - 不重新编译PHP文件的情况下php GD库扩展库的编译安装(centos)
		
gd-2.0.33.tar.gz http://www.boutell.com/gd/ jpegsrc.v6b.tar.gz http://www.ijg.org/ libpng-1.2.7.tar. ...
 - PHP7 学习笔记(一)Ubuntu 16.04 编译安装Nginx-1.10.3、 PHP7.0.9、Redis3.0 扩展、Phalcon3.1 扩展、Swoole1.9.8 扩展、ssh2扩展(全程编译安装)
		
==================== PHP 7.0 编译安装================== wget http://cn2.php.net/get/php-7.0.9.tar.bz2/fr ...
 - 使用自建Git服务器管理私有项目  Centos 7.3 + Git 2.11.0 + gitosis (实测 笔记)
		
环境: 系统硬件:vmware vsphere (CPU:2*4核,内存2G,双网卡) 系统版本:CentOS-7-x86_64-Minimal-1611.iso GIT服务器IP:192.168.1 ...
 - 虚拟机安装centos发现inet为127.0.0.1,导致Xshell连接不上
		
问题如标题所示: 设置网卡开机自动启动: 实质linux是看一个网卡文件的配置,就是/etc/sysconfig/network-scripts/ifcfg-eth0 (这个文件名看你网卡名称而异,具 ...
 
随机推荐
- Database first with EntityFramework (Migration)安装和升级
			
最近看了国外几个项目,发现用EntityFramework做Code First的项目现在很流行. 最让我有兴趣的一个功能则是,EntityFramework对于数据库的安装和升级的无缝完美支持,且很 ...
 - 【Bootstrap-插件使用】Jcrop+fileinput组合实现头像上传功能
			
作者:Dreawer链接:https://zhuanlan.zhihu.com/p/24465742来源:知乎著作权归作者所有.商业转载请联系作者获得授权,非商业转载请注明出处. 作者:梦游的龙猫(转 ...
 - SQL删除语句同时向备份表插入数据
			
从这里摘抄下来的,觉得很不错,http://www.cnblogs.com/ljhdo/p/5792886.html#3503524 ,以后就用这种方式删除,再也不用担心删除错数据啦!!!
 - Mysql Join
			
在前面的博文中,我们已经学会了如果在一张表中读取数据,这是相对简单的,但是在真正的应用中经常需要从多个数据表中读取数据. 本章节我们将向大家介绍如何使用 MySQL 的 JOIN 在两个或多个表中查询 ...
 - 【转】前端工程师必须了解的 谷歌 HTML/CSS 规范
			
背景 这篇文章定义了 HTML 和 CSS 的格式和代码规范,旨在提高代码质量和协作效率. 通用样式规范 协议 省略图片.样式.脚本以及其他媒体文件 URL 的协议部分(http:,https:),除 ...
 - 商城项目:装nginx时碰到的各种问题
			
因为项目需要,我们要在linux上nginx.碰到了各种问题.在这里一一记录下来. 首先我要开启我的两个虚拟机,开起来之后.用主机的SeureCRT去连接.都是好的. 但是我在虚拟机机上去ping I ...
 - [LeetCode] Design Phone Directory 设计电话目录
			
Design a Phone Directory which supports the following operations: get: Provide a number which is not ...
 - SQLite3源程序分析之查询处理及优化
			
前言 查询处理及优化是关系数据库得以流行的根本原因,也是关系数据库系统最核心的技术之一.SQLite的查询处理模块很精致,而且很容易移植到不支持SQL的存储引擎(Berkeley DB最新的版本已经将 ...
 - mysql函数大全
			
对于针对字符串位置的操作,第一个位置被标记为1. ASCII(str) 返回字符串str的最左面字符的ASCII代码值.如果str是空字符串,返回0.如果str是NULL,返回NULL. mysql& ...
 - 篇二:MySQL存储过程
			
目的:写一个存储过程,往数据库中插入几百条数据,作为识别码给别人用(这里我觉得和验证码的功能相似) BEGIN ); ); ) ; ); ); ; ; while count <= insert ...