热门标签 | HotTags
当前位置:  开发笔记 > 编程语言 > 正文

tengine全自动安装

tengine官方:tengine.taobao.org#!binbashPATHbin:sbin:usrbin:usrsbin:usrlocalbin:usrlocalsbin:~bin#QQ:917611exportPATHif[$(id-u)!0];thenechoError:Youmustberoottorunthisscript,pleaseuser

tengine官方: http://tengine.taobao.org/ #!/bin/bash PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:~/bin #QQ:917611 export PATH if [ $(id -u) != "0" ]; then echo "Error: You must be root to run this script, please use r

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


#!/bin/bash

PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:~/bin

#QQ:917611

export PATH

if [ $(id -u) != "0" ]; then

echo "Error: You must be root to run this script, please use root to install lnmp"

exit 1

else

printf "............................................\n"

printf "............................................\n"

printf "................welcome to tengine...........\n"

printf "............................................\n"

printf "............................................\n"

fi

sleep 3

if [ -s /etc/selinux/config ]; then

sed -i 's/SELINUX=enforcing/SELINUX=disabled/g' /etc/selinux/config

setenforce 0

fi

/etc/init.d/iptables save

iptables -F;iptables -X;iptables -Z;iptables -t nat -F;iptables -t nat -X;iptables -t nat -Z;

cat >>/etc/security/limits.conf<

* soft nproc 65535

* hard nproc 65535

* soft nofile 65535

* hard nofile 65535

eof

cat >>/etc/sysctl.conf<

fs.file-max=65535

eof

yum install gcc gcc-c++ autoconf automake make wget openssl openssl-devel zlib vim zlib-devel -y

tengine="tengine-1.4.2.tar.gz"

PCRE="pcre-8.31.tar.gz"

NGINX="/usr/local/nginx"

NGINX_COnFIG="/usr/local/nginx/conf/nginx.conf"

USER="www"

GROUP="www"

DATE=$(date +%Y%m%d)

VHOST="/usr/local/nginx/conf/vhost"

if [ -d /usr/local/nginx ];then

echo "Nginx already exists:/usr/local/nginx"

exit 0

fi

if [ ! -f ${tengine} ];then

wget http://tengine.taobao.org/download/${tengine}

fi

if [ ! -f ${PCRE} ];then

wget http://sourceforge.net/projects/pcre/files/pcre/8.31/${PCRE}

fi

tar xvf ${tengine};tar xvf ${PCRE} -C /usr/local

cd `echo ${tengine}|sed 's/.tar.gz//g'`

useradd -M -s /sbin/nologin ${USER}

./configure --user=${USER} --group=${GROUP} --prefix=/usr/local/nginx --with-http_concat_module --with-pcre=/usr/local/pcre-8.31/ --with-http_gzip_static_module --with-http_stub_status_module

make;make install

cat > ${NGINX_CONFIG} <

user www;

worker_processes 2;

pid logs/nginx.pid;

events {

worker_connections 51200;

}

http {

include mime.types;

default_type application/octet-stream;

sendfile on;

tcp_nopush on;

keepalive_timeout 65;

gzip on;

gzip_disable "MSIE [1-6]\.(?!.*SV1)";

gzip_buffers 4 8k;

gzip_http_version 1.0;

gzip_types text/plain application/x-Javascript text/Javascript text/css;

include vhost/*.conf;

}

eof

read -p "please input domain :" domain

read -p "please input webdir :" webdir

if [ ! -d ${VHOST} ];then

mkdir ${VHOST} -p

fi

cat > ${VHOST}/${domain}.conf <

log_format ${domain} '$remote_addr - $remote_user [$time_local] "$request" '

'$status $body_bytes_sent "$http_referer" '

'"$http_user_agent" "$http_x_forwarded_for"';

access_log /usr/local/nginx/logs/access.log ${domain};

server {

charset utf-8;

listen 80;

server_name ${domain};

location / {

root ${webdir};

concat on;

index index.html index.htm;

}

}

eof

/usr/local/nginx/sbin/nginx

netstat -lnpt |grep nginx

运维随笔” 博客,谢绝转载!

推荐阅读
  • 构建LNMP架构平台
    LNMP架构的组成:Linux、Nginx、MySQL、PHP关于NginxNginx与apache的作用一样,都是为了搭建网站服务器,由俄罗斯人lgorsysoev开发,其特点是 ... [详细]
  • 程序员如何选择机械键盘轴体?红轴和茶轴对比
    本文介绍了程序员如何选择机械键盘轴体,特别是红轴和茶轴的对比。同时还介绍了U盘安装Linux镜像的步骤,以及在Linux系统中安装软件的命令行操作。此外,还介绍了nodejs和npm的安装方法,以及在VSCode中安装和配置常用插件的方法。最后,还介绍了如何在GitHub上配置SSH密钥和git的基本配置。 ... [详细]
  • 本文详细介绍了Linux中进程控制块PCBtask_struct结构体的结构和作用,包括进程状态、进程号、待处理信号、进程地址空间、调度标志、锁深度、基本时间片、调度策略以及内存管理信息等方面的内容。阅读本文可以更加深入地了解Linux进程管理的原理和机制。 ... [详细]
  • 成功安装Sabayon Linux在thinkpad X60上的经验分享
    本文分享了作者在国庆期间在thinkpad X60上成功安装Sabayon Linux的经验。通过修改CHOST和执行emerge命令,作者顺利完成了安装过程。Sabayon Linux是一个基于Gentoo Linux的发行版,可以将电脑快速转变为一个功能强大的系统。除了作为一个live DVD使用外,Sabayon Linux还可以被安装在硬盘上,方便用户使用。 ... [详细]
  • CentOS 7部署KVM虚拟化环境之一架构介绍
    本文介绍了CentOS 7部署KVM虚拟化环境的架构,详细解释了虚拟化技术的概念和原理,包括全虚拟化和半虚拟化。同时介绍了虚拟机的概念和虚拟化软件的作用。 ... [详细]
  • 一句话解决高并发的核心原则
    本文介绍了解决高并发的核心原则,即将用户访问请求尽量往前推,避免访问CDN、静态服务器、动态服务器、数据库和存储,从而实现高性能、高并发、高可扩展的网站架构。同时提到了Google的成功案例,以及适用于千万级别PV站和亿级PV网站的架构层次。 ... [详细]
  • 本文介绍了在无法联网的情况下,通过下载rpm包离线安装zip和unzip的方法。详细介绍了如何搜索并下载合适的rpm包,以及如何使用rpm命令进行安装。 ... [详细]
  • Linux下部署Symfoy2对app/cache和app/logs目录的权限设置,symfoy2logs
    php教程|php手册xml文件php教程-php手册Linux下部署Symfoy2对appcache和applogs目录的权限设置,symfoy2logs黑色记事本源码,vsco ... [详细]
  • nginx+多个tomcat
    学习nginx的时候遇到的问题:nginx怎么部署两台tomcat?upstream在网上找的资源,我在nginx配置文件(nginx.conf)中添加了两个server。结果只显 ... [详细]
  • ZABBIX 3.0 配置监控NGINX性能【OK】
    1.在agent端查看配置:nginx-V查看编辑时是否加入状态监控模块:--with-http_stub_status_module--with-http_gzip_stat ... [详细]
  • 本文主要介绍关于linux文件描述符设置,centos7设置文件句柄数,centos7查看进程数的知识点,对【Linux之进程数和句柄数】和【linux句柄数含义】有兴趣的朋友可以看下由【东城绝神】投 ... [详细]
  • 对于一般的扩展包,我们一般直接pipinstallxxx即可安装,但是unrar直接安装后,发现并不能通过Python程序实现解压的功能& ... [详细]
  • nginx 反向代理proxy参数讲解
    ![](http:i2.51cto.comimagesblog20180805c32a728954d93ee2a4e4fb59c150a15b.png?x-oss-processi ... [详细]
  • LVS-DR直接路由实现负载均衡示例
    nsitionalENhttp:www.w3.orgTRxhtml1DTDxhtml1-transitional.dtd ... [详细]
  • buildah是用来修改和改造镜像的工具,和podman同源,很多参数相似!只是podman用来纯粹运行容器,一个纯粹建造容器!1.获取容器并赋名buildah--nametest ... [详细]
author-avatar
汽车之家马甲小宝宝_457
这个家伙很懒,什么也没留下!
PHP1.CN | 中国最专业的PHP中文社区 | DevBox开发工具箱 | json解析格式化 |PHP资讯 | PHP教程 | 数据库技术 | 服务器技术 | 前端开发技术 | PHP框架 | 开发工具 | 在线工具
Copyright © 1998 - 2020 PHP1.CN. All Rights Reserved | 京公网安备 11010802041100号 | 京ICP备19059560号-4 | PHP1.CN 第一PHP社区 版权所有