码迷,mamicode.com
首页 > 其他好文 > 详细

centos 6.5 x64安装Tengine

时间:2016-05-27 14:54:18      阅读:139      评论:0      收藏:0      [点我收藏+]

标签:tengine   tengine安装   

Tengine是由淘宝网发起的Web服务器项目。它在Nginx的基础上,针对大访问量网站的需求,添加了很多高级功能和特性。

据W3Techs统计,Tengine在全球用户量排名中位列第9。

官网: http://tengine.taobao.org/


线上服务器都是Tengine


在官网下载最新版本

目前最新版本是Tengine-2.1.2


解压软件包,其中openssl,pcre,zlib都是最新版

tar zxvf openssl-1.0.2h.tar.gz -C /usr/src/

tar zxvf pcre-8.38.tar.gz -C /usr/src/

tar zxvf zlib-1.2.8.tar.gz -C /usr/src/

tar zxvf tengine-2.1.2.tar.gz -C /usr/src/

cd /usr/src/tengine-2.1.2/

./configure --prefix=/usr/local/nginx --user=www --group=www --with-http_stub_status_module --with-http_ssl_module --with-http_gzip_static_module --with-http_realip_module --with-openssl=/usr/src/openssl-1.0.2h --with-zlib=/usr/src/zlib-1.2.8 --with-pcre=/usr/src/pcre-8.38

make && make install


编辑配置文件

cd /usr/local/nginx/conf

mv nginx.conf nginx.conf.bak

vi nginx.conf

内容如下:

user  www www;

worker_processes  4;


error_log  logs/error.log;

#error_log  logs/error.log  notice;

#error_log  logs/error.log  info;


pid        logs/nginx.pid;



events {

    worker_connections  60240;

}


# load modules compiled as Dynamic Shared Object (DSO)

#

#dso {

#    load ngx_http_fastcgi_module.so;

#    load ngx_http_rewrite_module.so;

#}


http {

    include       mime.types;

    default_type  application/octet-stream;

    

    keepalive_timeout 65;

    proxy_read_timeout 200;

    sendfile on;

    tcp_nopush on;

    tcp_nodelay on;

    gzip on;

    gzip_min_length 1000;

    gzip_proxied any;

    gzip_types text/plain text/css text/xml

               application/x-javascript application/xml

               application/atom+xml text/javascript;

    client_max_body_size 64M;

    log_format  main  ‘$remote_addr - $remote_user [$time_local] "$request" ‘

                      ‘$status $body_bytes_sent "$http_referer" ‘

                      ‘"$http_user_agent" "$http_x_forwarded_for"‘;

    

    access_log  logs/access.log  main;

    

    include vhosts/*;

}


上面的文件把默认的localhost给分离出来了

服务器是4核的


编辑配置文件

vi fastcgi_params

最后一行添加

fastcgi_param  SCRIPT_FILENAME    $document_root$fastcgi_script_name;


创建虚拟主机配置文件目录

mkdir vhosts

创建localhost.conf文件

内容如下:

server {

        listen   80;

        server_name localhost;

        root /usr/local/nginx/html;

        index index.php index.html index.htm;


        location / {


        }


        location ~ \.php$ {

                fastcgi_pass   127.0.0.1:9000;

                fastcgi_index  index.php;

                fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;

                include        fastcgi_params;

        }


}


检测配置文件是否ok

/usr/local/nginx/sbin/nginx -t

启动nginx

/usr/local/nginx/sbin/nginx -s start

查看端口是否存在

netstat -anpt | grep nginx


tcp        0      0 0.0.0.0:80                  0.0.0.0:*                   LISTEN      24435/nginx 


使用IP访问页面

http://192.168.1.110

本文出自 “陨落星空” 博客,请务必保留此出处http://xiao987334176.blog.51cto.com/2202382/1783810

centos 6.5 x64安装Tengine

标签:tengine   tengine安装   

原文地址:http://xiao987334176.blog.51cto.com/2202382/1783810

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!