介绍
之前写过 CentOS 安装 PHP,MySQL,Nginx 的相关文章,具体介绍这里就不写了,直接上操作步骤.
安装 Tengine
1. 安装必要的编译环境
yum update yum install gcc gcc-c++ autoconf automake
2. 安装需要的组件 PCRE
PCRE(Perl Compatible Regular Expressions) http://www.pcre.org 是一个Perl库,包括 perl 兼容的正则表达式库。nginx rewrite依赖于PCRE库,所以在安装Tengine前一定要先安装PCRE,最新版本的PCRE可在官网获取。具体安装流程为:
cd /usr/local/src wget https://ftp.pcre.org/pub/pcre/pcre-8.43.tar.gz tar zxvf pcre-8.43.tar.gz cd pcre-8.43 ./configure --prefix=/usr/local/pcre make && make install
OpenSSL
OpenSSL http://www.openssl.org/source 是一个强大的安全套接字层密码库,囊括主要的密码算法、常用的密钥和证书封装管理功能及SSL协议,并提供丰富的应用程序供测试或其它目的使用。安装OpenSSL 主要是为了让tengine支持Https的访问请求。具体是否安装看需求。安装流程为:
cd /usr/local/src wget http://www.openssl.org/source/openssl-1.0.2s.tar.gz tar zxvf openssl-1.0.2s.tar.gz cd openssl-1.0.2s ./config --prefix=/usr/local/openssl make && make install
Zlib
Zlib http://www.zlib.net 是提供资料压缩之用的函式库,当Tengine想启用GZIP压缩的时候就需要使用到Zli。安装流程为:
cd /usr/local/src wget http://zlib.net/zlib-1.2.11.tar.gz tar zxvf zlib-1.2.11.tar.gz cd zlib-1.2.11 ./configure --prefix=/usr/local/zlib make && make install
jemalloc
jemalloc http://www.canonware.com/jemalloc 是一个更好的内存管理工具,使用jemalloc可以更好的优化Tengine的内存管理。安装流程为:
cd /usr/local/src wget https://src.fedoraproject.org/lookaside/pkgs/jemalloc/jemalloc-5.2.1.tar.bz2/sha512/0bbb77564d767cef0c6fe1b97b705d368ddb360d55596945aea8c3ba5889fbce10479d85ad492c91d987caacdbbdccc706aa3688e321460069f00c05814fae02/jemalloc-5.2.1.tar.bz2 tar jxvf jemalloc-5.2.1.tar.bz2 cd jemalloc-5.2.1 ./configure --prefix=/usr/local/jemalloc make && make install
3. 安装Tengine
在主要核心的组件安装完毕以后就可以安装Tegine了,最新版本的Tegine可从官网 http://tengine.taobao.org 获取。在编译安装前还需要做的一件事是添加一个专门的用户来执行Tengine。当然你也可以用root(不建议)。
添加用户及用户组:
# 添加www组 groupadd -r www # 创建www运行账户nginx并加入到www组,不允许www用户直接登录系统 useradd -s /sbin/nologin -g www -r www
编译安装Tengine TODO
cd /usr/local/src wget http://tengine.taobao.org/download/tengine-2.2.0.tar.gz tar -zxvf tengine-2.2.0.tar.gz cd tengine-2.2.0 ./configure --prefix=/usr/local/nginx --user=www --group=www --with-pcre=/usr/local/src/pcre-8.40 --with-openssl=/usr/local/src/openssl-1.0.2 --with-jemalloc=/usr/local/src/jemalloc-3.6.0 --with-http_gzip_static_module --with-http_realip_module --with-http_stub_status_module --with-http_concat_module --with-zlib=/usr/local/src/zlib-1.2.11 make && make install
注意配置的时候 –with-pcre 、–with-openssl、–with-jemalloc、–with-zlib的路径为源文件的路径。
4. CentOS 7 配置Tengine,设置tengine开机自启
# 系统用户登录系统后启动的服务的目录 /usr/lib/systemd/system # 如需要开机没有登陆情况下就能运行的程序在系统目录内 /usr/lib/systemd/system # 我希望系统开机就启动目录,所以我把文件放在系统目录内。 vim /lib/systemd/system/nginx.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 -c /usr/local/nginx/conf/nginx.conf ExecReload=/bin/kill -s HUP $MAINPID ExecStop=/bin/kill -s QUIT $MAINPID PrivateTmp=true [Install] WantedBy=multi-user.target
# 修改文件权限 chmod 745 nginx.service # 设置为开机启动 systemctl enable nginx.service # 其它命令 # 启动nginx服务 systemctl start nginx.service # 设置开机自启动 systemctl enable nginx.service # 停止开机自启动 systemctl disable nginx.service # 查看服务当前状态 systemctl status nginx.service # 重新启动服务 systemctl restart nginx.service # 查看所有已启动的服务 systemctl list-units --type=service
编辑Tengine操作脚本
vi /etc/rc.d/init.d/nginx #编辑启动文件添加下面内容
############################################################
#!/bin/sh
#
# nginx - this script starts and stops the nginx daemon
#
# chkconfig: - 85 15
# description: NGINX is an HTTP(S) server, HTTP(S) reverse # proxy and IMAP/POP3 proxy server
# processname: nginx
# config: /usr/local/nginx/conf/nginx.conf
# config: /etc/sysconfig/nginx
# pidfile: /usr/local/nginx/logs/nginx.pid
# Source function library.
. /etc/rc.d/init.d/functions
# Source networking configuration.
. /etc/sysconfig/network
# Check that networking is up.
[ "$NETWORKING" = "no" ] && exit 0
nginx="/usr/local/nginx/sbin/nginx"
prog=$(basename $nginx)
NGINX_CONF_FILE="/usr/local/nginx/conf/nginx.conf"
[ -f /etc/sysconfig/nginx ] && . /etc/sysconfig/nginx
lockfile=/var/lock/subsys/nginx
make_dirs() {
# make required directories
user=`$nginx -V 2>&1 | grep "configure arguments:.*--user=" | sed 's/[^*]*--user=\([^ ]*\).*/\1/g' -`
if [ -n "$user" ]; then
if [ -z "`grep $user /etc/passwd`" ]; then
useradd -M -s /bin/nologin $user
fi
options=`$nginx -V 2>&1 | grep 'configure arguments:'`
for opt in $options; do
if [ `echo $opt | grep '.*-temp-path'` ]; then
value=`echo $opt | cut -d "=" -f 2`
if [ ! -d "$value" ]; then
# echo "creating" $value
mkdir -p $value && chown -R $user $value
fi
fi
done
fi
}
start() {
[ -x $nginx ] || exit 5
[ -f $NGINX_CONF_FILE ] || exit 6
make_dirs
echo -n $"Starting $prog: "
daemon $nginx -c $NGINX_CONF_FILE
retval=$"Stopping $prog: "
killproc $prog -QUIT
retval=$"Reloading $prog: "
killproc $nginx -HUP
RETVAL=$"$1" in
start)
rh_status_q && exit 0
$1
;;
stop)
rh_status_q || exit 0
$1
;;
restart|configtest)
$1
;;
reload)
rh_status_q || exit 7
$1
;;
force-reload)
force_reload
;;
status)
rh_status
;;
condrestart|try-restart)
rh_status_q || exit 0
;;
*)
echo $"Usage: $0 {start|stop|status|restart|condrestart|try-restart|reload|force-reload|configtest}"
exit 2
esac
############################################################
配置权限及开机启动
chmod 745 /etc/rc.d/init.d/nginx # 设置权限 chkconfig nginx on # 开机启动
操作指令
# 开启服务 /etc/init.d/nginx start # 重启服务 /etc/init.d/nginx restart # 停止服务 /etc/init.d/nginx stop # 查看服务状态 /etc/init.d/nginx status
免责声明:本站文章均来自网站采集或用户投稿,网站不提供任何软件下载或自行开发的软件! 如有用户或公司发现本站内容信息存在侵权行为,请邮件告知! 858582#qq.com
《魔兽世界》大逃杀!60人新游玩模式《强袭风暴》3月21日上线
暴雪近日发布了《魔兽世界》10.2.6 更新内容,新游玩模式《强袭风暴》即将于3月21 日在亚服上线,届时玩家将前往阿拉希高地展开一场 60 人大逃杀对战。
艾泽拉斯的冒险者已经征服了艾泽拉斯的大地及遥远的彼岸。他们在对抗世界上最致命的敌人时展现出过人的手腕,并且成功阻止终结宇宙等级的威胁。当他们在为即将于《魔兽世界》资料片《地心之战》中来袭的萨拉塔斯势力做战斗准备时,他们还需要在熟悉的阿拉希高地面对一个全新的敌人──那就是彼此。在《巨龙崛起》10.2.6 更新的《强袭风暴》中,玩家将会进入一个全新的海盗主题大逃杀式限时活动,其中包含极高的风险和史诗级的奖励。
《强袭风暴》不是普通的战场,作为一个独立于主游戏之外的活动,玩家可以用大逃杀的风格来体验《魔兽世界》,不分职业、不分装备(除了你在赛局中捡到的),光是技巧和战略的强弱之分就能决定出谁才是能坚持到最后的赢家。本次活动将会开放单人和双人模式,玩家在加入海盗主题的预赛大厅区域前,可以从强袭风暴角色画面新增好友。游玩游戏将可以累计名望轨迹,《巨龙崛起》和《魔兽世界:巫妖王之怒 经典版》的玩家都可以获得奖励。
更新日志
- 小骆驼-《草原狼2(蓝光CD)》[原抓WAV+CUE]
- 群星《欢迎来到我身边 电影原声专辑》[320K/MP3][105.02MB]
- 群星《欢迎来到我身边 电影原声专辑》[FLAC/分轨][480.9MB]
- 雷婷《梦里蓝天HQⅡ》 2023头版限量编号低速原抓[WAV+CUE][463M]
- 群星《2024好听新歌42》AI调整音效【WAV分轨】
- 王思雨-《思念陪着鸿雁飞》WAV
- 王思雨《喜马拉雅HQ》头版限量编号[WAV+CUE]
- 李健《无时无刻》[WAV+CUE][590M]
- 陈奕迅《酝酿》[WAV分轨][502M]
- 卓依婷《化蝶》2CD[WAV+CUE][1.1G]
- 群星《吉他王(黑胶CD)》[WAV+CUE]
- 齐秦《穿乐(穿越)》[WAV+CUE]
- 发烧珍品《数位CD音响测试-动向效果(九)》【WAV+CUE】
- 邝美云《邝美云精装歌集》[DSF][1.6G]
- 吕方《爱一回伤一回》[WAV+CUE][454M]