Bash脚本:下载编译安装nginx

下载nginx-1.8.1.tar.gz, 安装到目录/usr/local/nginx

#!/bin/bash
yum -y install wget pcre-devel openssl openssl-devel libtool gcc automake autoconf libtool make
wget http://nginx.org/download/nginx-1.8.1.tar.gz
tar -zxvf nginx-1.8.1.tar.gz -C /usr/local
cd /usr/local/nginx-1.8.1 
./configure --prefix=/usr/local/nginx --with-http_stub_status_module --with-http_ssl_module
make && make install

如果在编译过程出现如下图错误


请安装: yum -y install pcre-devel 或 yum -y install openssl openssl-devel

 

启动Nginx并查看端口号:


 

打开网址校验

http://ip:80

猜你喜欢

转载自oracle-api.iteye.com/blog/2372439