安裝依賴:yum install -y gcc gcc-c++ make zlib zlib-devel libtool opennssl openssl-devel pcre pcre-devel
html
nginx的下載連接:http://nginx.org/en/download.htmlnginx
下載tar解壓縮後,configure、make、make install三步走。c++
useradd -s /sbin/nologin -M nginx
./configure --user=nginx --prefix=/usr/local/nginx --with-http_stub_status_module --with-http_ssl_module
make
(能夠根據CPU核數,添加-j
選項加快編譯速度)make install
啓動:/usr/local/nginx/sbin/nginx
,或者指定配置文件:/usr/local/nginx/sbin/nginx -c /usr/local/nginx/conf/nginx.conf
web
使用yum、apt等包管理器安裝docker
/usr/local/nginx/sbin/nginx -t