在CentOS上简单安装tengine

centos上tengine的一个简易安装流程

环境描述

CentOS release 5.5 (Final)

Kernel \r on an \m

安装基础环境

gcc安装

yum -y install gcc

yum -y install gcc-c++

安装pcre

yum -y install pcre-devel

安装openssl

yum -y install openssl openssl-devel

二、下载proxy_cache插件

cd /opt/tools/tengine/plugins/proxy_cache

wget http://labs.frickle.com/files/ngx_cache_purge-2.1.tar.gz

tar zxvf ngx_cache_purge-2.1.tar.gz

下载最新的tengine安装包

不指定目录方式安装,默认安装在url/local/nginx

$ ./configure

$ make

$ sudo make install

指定目录方式安装,安装在/opt

./configure --prefix=/opt/tengine/nginx

make

make install

指定目录方式安装并安装缓存模式,安装在/opt

./configure --add-module=/opt/tools/tengine/plugins/proxy_cache/ngx_cache_purge-2.1 --prefix=/opt/servers/tengine/nginx --with-http_stub_status_module

make

make install

配置tengine为服务启动项,然后通过服务启动项管理tengine

vim /etc/rc.d/init.d/nginx  #编辑启动文件添加下面内容

#!/bin/bash

# nginx Startup script for the Nginx HTTP Server

# it is v.0.0.2 version.

# chkconfig: - 85 15

# description: Nginx is a high-performance web and proxy server.

# It has a lot of features, but it‘s not for everyone.

# processname: nginx

# pidfile: /var/run/nginx.pid

# config: /usr/local/nginx/conf/nginx.conf

nginxd=/opt/servers/tengine/nginx/sbin/nginx

nginx_config=/opt/servers/tengine/nginx/conf/nginx.conf

nginx_pid=/opt/servers/tengine/nginx/logs/nginx.pid

RETVAL=0

prog="nginx"

# Source function library.

. /etc/rc.d/init.d/functions

# Source networking configuration.

. /etc/sysconfig/network

# Check that networking is up.

[ ${NETWORKING} = "no" ] && exit 0

[ -x $nginxd ] || exit 0

# Start nginx daemons functions.

start() {

if [ -e $nginx_pid ];then

echo "nginx already running...."

exit 1

fi

echo -n $"Starting $prog: "

daemon $nginxd -c ${nginx_config}

RETVAL=$?

echo

[ $RETVAL = 0 ] && touch /var/lock/subsys/nginx

return $RETVAL

}

# Stop nginx daemons functions.

stop() {

echo -n $"Stopping $prog: "

killproc $nginxd

RETVAL=$?

echo

[ $RETVAL = 0 ] && rm -f /var/lock/subsys/nginx /opt/servers/tengine/nginx/logs/nginx.pid

}

reload() {

echo -n $"Reloading $prog: "

#kill -HUP `cat ${nginx_pid}`

killproc $nginxd -HUP

RETVAL=$?

echo

}

# See how we were called.

case "$1" in

start)

start

;;

stop)

stop

;;

reload)

reload

;;

restart)

stop

start

;;

status)

status $prog

RETVAL=$?

;;

*)

echo $"Usage: $prog {start|stop|restart|reload|status|help}"

exit 1

esac

exit $RETVAL

保存退出

# chmod 775 /etc/rc.d/init.d/nginx   #赋予文件执行权限# chkconfig nginx on   #设置开机启动# /etc/rc.d/init.d/nginx restart

# service nginx restart

时间: 2024-08-09 02:19:40

在CentOS上简单安装tengine的相关文章

MongoDB 3.2 在CentOS 上的安装和配置

MongoDB 3.2 在CentOS 上的安装和配置 2016-01-06 14:41:41 发布 您的评价:       0.0   收藏     0收藏 一.安装 编辑/etc/yum.repos.d/mongodb-org-3.2.repo [mongodb-org-3.2] name=MongoDB Repository baseurl=https://repo.mongodb.org/yum/redhat/$releasever/mongodb-org/3.2/x86_64/ gpg

Cacti中文版在Centos上的安装

最近老有人问Cacti中文版在哪下载啊怎么安装啊,我在这里一遍给大家讲解了:Cacti中文版在Centos上的安装 1.基本安装 cacti是运作在apache+php+mysql+net-snmp工具集+rrdtool这样的一个工作环境之下,所以我们先要做一个基本的工作的环境 记的安装前先安装rpm的扩展包,安装方法见我的另外一个文章"rpm的高级管理" #yum -y install mysql mysql-server php-mysql httpd php 上面完成一个php,

【apache http server安装】CentOS上编译安装Aapche Http Server详细过程

下载apache httpd # wget http://mirrors.cnnic.cn/apache//httpd/httpd-2.4.10.tar.gz 2. 解压 apache httpd # tar xzvf httpd-2.4.10.tar.gz 编译apache httpd [[email protected]]# ./configure checkingfor chosen layout... Apache checkingfor working mkdir -p... yes

CentOS上编译安装OpenCV-2.3.1与ffmpeg-2.1.2

已测试环境: CentOS 6.3 32bit CentOS 6.5 64bit 曾经在CentOS 6.3 32bit安装过OpenCV,参见CentOS 6.3中安装OpenCV2.3.1,如今换了64bit系统,大刀阔斧,重新来一遍. 检查并安装相关程序,确保gtk安装成功,否则无法显示图片 yum install gcc-c++ # g++编译 yum install gtk-devel # 反正是gtk神马的,不一定就是gtk-devel,可以使用*gtk-devel*匹配 yum i

在CentOS上编译安装MySQL+安装问题解决+安全优化

0.说明 当然,MySQL的安装方法多种多样,在CentOS上,你可以采用YUM的方式安装,这样的好处是:快速方便.基本上,它会帮你解决所有的函数库依赖问题,正常情况下,只要YUM执行完成,那么MySQL也就可以使用了. 但我更倾向于使用编译的方式来安装MySQL,原因也很简单:除了有详细的官方文档外,你还可以非常清楚地知道你自己在做什么,这点在以后MySQL运行出现问题时将会有很大的帮助! 但即便是按照官方文档来安装,你也会遇到各种各样的问题,这里,我将呈现一个完整的过程给大家,直到完成下面的

在CentOS上yum安装phpMyAdmin的教程

篇文章主要介绍了在CentOS上安装phpMyAdmin的教程,phpMyAdmin是一款借助PHP脚本来操作MySQL的工具,非常具有人气,需要的朋友可以参考下 前提 在CentOS上安装phpMyAdmin,你第一步需要架设一台Web服务器(如Apache或nginx),安装好MySQL/MariaDB数据库和PHP.根据你的偏好和需求,你可以从LAMP和LEMP中选择一种安装. 另一个要求是允许在你的CentOS上安装EPEL库.如果你还没设置过请猛戳这里.在CentOS6或7上安装php

在CentOS上编译安装Nginx+实验环境搭建+测试

0.说明 Nginx作为一款优秀的Web Server软件同时也是一款优秀的负载均衡或前端反向代理.缓存服务软件,很有必要搭建实验环境来对其进行学习. 1.实验环境 本次实验的测试环境使用的宿主机操作系统为Windows 7,在Vmware虚拟机安装CentOS 6.5,说明如下: 宿主机操作系统Windows 7 虚拟机安装的操作系统CentOS 6.5 虚拟机操作系统上网方式NAT 而当使用NAT的方式进行上网时虚拟机.宿主机之间的网络连接关系可如下所示: 关于为什么网络拓扑结构是这样的,这

Nginx在CentOS上进行安装

Nginx在CentOS下进行安装的一些总结,从官网先将源码包wget到服务器,通过一些nginx的配置.编译,最后进行服务的注册,将脚本放入/etc/init.d,可以使用System V,service指令来控制nginx. 下载源码包 到nginx官网进行下载,可以直接在服务器上wget拉取,http://nginx.org/en/download.html,选择Stable version的版本 先决条件 nginx的编译需要几个先决条件,GCC, PCRE, zlib, OpenSSL

centos上如何安装mysql

centos可以使用yum安装mysql 但是版本很低,且不灵活. 本文将介绍如何使用安装包安装mysql http://dev.mysql.com/downloads/mysql/ 下载mysql 将下载文件放在/opt/mysoft文件夹中 解压文件 tar -xf MySQL-5.6.22-1.linux_glibc2.5.x86_64.rpm-bundle.tar 这里我们要安装mysql的服务端和客服端,所以使用下面两个文件: MySQL数据库: MySQL-server-5.6.22