Last active
February 23, 2019 09:04
-
-
Save dimitardanailov/39df012d281e0b617513 to your computer and use it in GitHub Desktop.
CentOS: How To Compile Nginx from Source
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Source: https://www.digitalocean.com/community/tutorials/how-to-compile-nginx-from-source-on-a-centos-6-4-x64-vps | |
| # Step 1 | |
| # We have few pre-requisites to be installed to compile which include development libraries along with source code compilers. | |
| yum -y install gcc gcc-c++ make zlib-devel pcre-devel openssl-devel | |
| # Step 2 | |
| mkdir -p ~/src && cd ~/src | |
| # Step 3 | |
| # You need to change version of nginx. | |
| nginxVersion="1.9.5" | |
| rm nginx-$nginxVersion.tar.gz | |
| wget http://nginx.org/download/nginx-$nginxVersion.tar.gz | |
| tar -xzf nginx-$nginxVersion.tar.gz --overwrite | |
| ln -sf nginx-$nginxVersion nginx | |
| cd nginx | |
| ./configure \ | |
| --user=nginx \ | |
| --group=nginx \ | |
| --prefix=/etc/nginx \ | |
| --sbin-path=/usr/sbin/nginx \ | |
| --conf-path=/etc/nginx/nginx.conf \ | |
| --pid-path=/var/run/nginx.pid \ | |
| --lock-path=/var/run/nginx.lock \ | |
| --error-log-path=/var/log/nginx/error.log \ | |
| --http-log-path=/var/log/nginx/access.log \ | |
| --with-http_gzip_static_module \ | |
| --with-http_stub_status_module \ | |
| --with-http_ssl_module \ | |
| --with-pcre \ | |
| --with-file-aio \ | |
| --with-http_realip_module | |
| make | |
| make install |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
why my 测试失败了 再试试吧 多谢贡献!!!