centos6.6編譯安裝nginx-1.8.0

來源:互聯網
上載者:User

1. 建立放置安裝包的目錄:

    mkdir nginx-install

    cd nginx-install


2. 下載相關安裝包:

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

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

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

3. 執行以下安裝指令碼:

#!/bin/bashuser=buser           # change to user who run nginxdir_prefix=/home/$user/nginx       # change to your prefered install dirscript_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-develtar zxvf $script_dir/zlib-1.2.8.tar.gz -C $script_dirtar zxvf $script_dir/openssl-1.0.1m.tar.gz -C $script_dirtar zxvf $script_dir/nginx-1.8.0.tar.gz -C $script_dircd $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.1mmakemake installmkdir -p $dir_prefix/sites-enabledmkdir -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.confchown -R $user: $dir_prefixservice nginx-$user startchkconfig nginx-$user onrm -Rf $script_dir/zlib-1.2.8rm -Rf $script_dir/openssl-1.0.1mrm -Rf $script_dir/nginx-1.8.0cd $opath

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.