Nginx在linux下的编译安装

天远科技  发表于:2015-07-14  分类:Web Serve  阅读(4181)  赞同30

    nginx做为一个轻量级的web server已经被广泛的应用,同时,我们还使用nginx来做7层负载,已达到增加访问量的目的。

    以下介绍在linux中编译安装nginx,操作系统使用rhel、centos(反正是一家的嘻嘻)

    先安装pcre,zlib
./configure --prefix=/usr/local/nginx --user=www --group=www --pid-path=/usr/local/nginx/run/nginx.pid --lock-path=/usr/local/nginx/lock/nginx.lock --with-http_ssl_module --with-http_dav_module --with-http_flv_module --with-http_realip_module --with-http_gzip_static_module --with-http_stub_status_module --with-debug --http-client-body-temp-path=/usr/local/nginx/tmp/client --http-proxy-temp-path=/usr/local/nginx/tmp/proxy --http-fastcgi-temp-path=/usr/local/nginx/tmp/fastcgi --http-uwsgi-temp-path=/usr/local/nginx/tmp/uwsgi --http-scgi-temp-path=/usr/local/nginx/tmp/scgi

make && make install


编译完成即可使用 /usr/local/nginx/sbin/nginx 来启动nginx 注意如果开启iptables的,注意加入tcp端口号。

nginx 检查配置文件是否正确,使用 /usr/local/nginx/sbin/nginx -t

重启使用 /usr/local/nginx/sbin/nginx -s reload

博文分类

线

在线联系
点击这里给我发消息
点击这里给我发消息
关注我们