centos66编译安装nginx-180

php中文网
发布: 2016-08-08 09:23:12
原创
995人浏览过

1. 创建放置安装包的目录:

    mkdir nginx-install

    cd nginx-install

2. 下载相关安装包:

    wget http://nginx.org/download/nginx-1.8.0.tar.gz

会译·对照式翻译
会译·对照式翻译

会译是一款AI智能翻译浏览器插件,支持多语种对照式翻译

会译·对照式翻译 0
查看详情 会译·对照式翻译

    wget http://www.openssl.org/source/openssl-1.0.1m.tar.gz

    wget http://zlib.net/zlib-1.2.8.tar.gz


3. 执行以下安装脚本:

#!/bin/bash

user=buser           # change to user who run nginx
dir_prefix=/home/$user/nginx       # change to your prefered install dir
script_path=`readlink -f $0`
script_dir=`dirname $script_path`
opath=`pwd`

yum install -y gd-devel pcre-devel libgcrypt-devel libxml2-devel libxslt-devel GeoIP-devel

tar zxvf $script_dir/zlib-1.2.8.tar.gz -C $script_dir
tar zxvf $script_dir/openssl-1.0.1m.tar.gz -C $script_dir
tar zxvf $script_dir/nginx-1.8.0.tar.gz -C $script_dir

cd $script_dir/nginx-1.8.0
./configure --prefix=$dir_prefix --user=$user --group=$user --http-log-path=$dir_prefix/log/access.log --error-log-path=$dir_prefix/log/error.log --pid-path=$dir_prefix/pid/nginx.pid --lock-path=$dir_prefix/lock/nginx.lock --with-http_ssl_module --with-http_spdy_module --with-http_realip_module --with-http_xslt_module --with-http_image_filter_module --with-http_geoip_module --with-http_sub_module --with-http_dav_module --with-http_flv_module --with-http_mp4_module --with-http_gunzip_module --with-http_gzip_static_module --with-http_auth_request_module --with-http_random_index_module --with-http_secure_link_module --with-http_degradation_module --with-http_stub_status_module --with-pcre --with-libatomic --with-zlib=$script_dir/zlib-1.2.8 --with-openssl=$script_dir/openssl-1.0.1m

make

make install

mkdir -p $dir_prefix/sites-enabled
mkdir -p $dir_prefix/lock

\cp -f $script_dir/etc.initd.nginx-$user /etc/init.d/nginx-$user
\cp -f $script_dir/conf.nginx.conf $dir_prefix/conf/nginx.conf
\cp -f $script_dir/sites-enabled.$user.conf $dir_prefix/sites-enabled/$user.conf

chown -R $user: $dir_prefix

service nginx-$user start
chkconfig nginx-$user on

rm -Rf $script_dir/zlib-1.2.8
rm -Rf $script_dir/openssl-1.0.1m
rm -Rf $script_dir/nginx-1.8.0

cd $opath

登录后复制

以上就介绍了centos66编译安装nginx-180,包括了方面的内容,希望对PHP教程有兴趣的朋友有所帮助。

最佳 Windows 性能的顶级免费优化软件
最佳 Windows 性能的顶级免费优化软件

每个人都需要一台速度更快、更稳定的 PC。随着时间的推移,垃圾文件、旧注册表数据和不必要的后台进程会占用资源并降低性能。幸运的是,许多工具可以让 Windows 保持平稳运行。

下载
来源:php中文网
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系admin@php.cn
最新问题
开源免费商场系统广告
热门教程
更多>
最新下载
更多>
网站特效
网站源码
网站素材
前端模板
关于我们 免责申明 举报中心 意见反馈 讲师合作 广告合作 最新更新 English
php中文网:公益在线php培训,帮助PHP学习者快速成长!
关注服务号 技术交流群
PHP中文网订阅号
每天精选资源文章推送
PHP中文网APP
随时随地碎片化学习

Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号