linux下搭建nginx
step1 准备
a.nginx的tar文件
b.pcre的tar文件
c.安装gcc-c++ yum install gcc-c++
step2 解压 nginx和pcre
step3 进入pcre文件下
输入命令
配置 ./configure
编译 make
安装 make install
step4 安装zlib-devel yum install zlib_devel
判断是否安装过的命令 rpm -qa | grep zlib-devel
step5 进入nginx目录下
配置 ./configure --user=www --group=www --prefix=(nginx的目录) --with-http_stub_status_module --with-http_ssl_module --with-http_realip_module
编译 make
安装 make install
step6 验证是否安装成功
./nginx -t
成功显示
nginx: the configuration file /usr/local/nginx/conf/nginx.conf syntax is ok
nginx: configuration file /usr/local/nginx/conf/nginx.conf test is successful
安装ngin的时候可能遇到错误
cp: `conf/koi-win' and `/usr/local/nginx/conf/koi-win' are the same file
解决
./configure --prefix=/usr/local/nginx --conf-path=/usr/local/nginx/nginx.conf

浙公网安备 33010602011771号