安装依赖: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