90807 发表于 2016-11-3 08:36:12

LNMP之 nginx 安装&启动

# cd /usr/local/src/

# wget http://nginx.org/download/nginx-1.10.2.tar.gz

# tar zxvf nginx-1.10.2.tar.gz

# cd nginx-1.10.2/

# ./configure   --prefix=/usr/local/nginx   --with-http_realip_module   --with-http_sub_module--with-http_gzip_static_module   --with-http_stub_status_module--with-pcre

checking for PCRE library in /usr/include/pcre/ ... not found
编译完成后,提示 pcre 不存在

# yum install -y pcre-devel#安装即可
再次重新配置即可。
# echo $?
0(每配置或编译要用此命令检查)
# make
# make install

# cd /usr/local/nginx/
# ls   # 查看到nginx 文件夹下生了四个目录
confhtmllogssbin

# ls sbin/nginx   #这是一个可执行文件
sbin/nginx
# /usr/local/nginx/sbin/nginx#启动 nginx


页: [1]
查看完整版本: LNMP之 nginx 安装&启动