编译安装 ngixn
一、安装缺少的依赖包
yum -y install gcc gcc-c++ make libtool zlib zlib-devel openssl openssl-devel pcre pcre-devel
二、创建安装目录
mkdir -p /data1/nginx
mkdir -p /data1/nginx/logs
mkdir -p /data1/nginx/sbin
mkdir -p /data1/nginx/conf
mkdir -p /data1/nginx/pid
三、编译配置
./configure --prefix=/data1/nginx --sbin-path=/data1/nginx/sbin/nginx --conf-path=/data1/nginx/conf/nginx.conf --error-log-path=/data1/nginx/logs/error.log --pid-path=/data1/nginx/pid/nginx.pid --with-http_ssl_module
./configure \
--prefix=/data2/nginx \ #安装目录
--sbin-path=/data2/nginx/sbin/nginx \ #启动文件路径
--conf-path=/data2/nginx/conf/nginx.conf \ #配置文件路径
--error-log-path=/data2/nginx/logs/error.log \ #日子路径
--pid-path=/data2/nginx/pid/nginx.pid \ #pid 路径
--with-http_ssl_module \ #启用ssl
三、安装
make && make install
四、启动
/data1/nginx/sbin/nginx