发现越来越多的站点都在用nginx,并且从相关的搜索指数来看,已经超过了lighttpd,最近发现能学的东西太多了,不想学的太多,想好好了解一下nginx。
任何东西学都是从用开始的,要用当然得从安装开始。
安装包
[编译参数]
./configure \--prefix=/home/robertaqi/lnmp/nginx\
--with-pcre=/home/robertaqi/download/pcre-8.01 \
--http-log-path=/home/robertaqi/lnmp/nginx/logs/access_log \
--error-log-path=/home/robertaqi/lnmp/nginx/logs/error_log \
--with-http_realip_module \
--with-http_stub_status_module \
--without-http_userid_module \
--http-client-body-temp-path=/home/robertaqi/lnmp/nginx/cache/client_body \
--http-proxy-temp-path=/home/robertaqi/lnmp/nginx/cache/proxy\
--http-fastcgi-temp-path=/home/robertaqi/lnmp/nginx/cache/fastcgi \
--http-uwsgi-temp-path=/home/robertaqi/lnmp/nginx/cache/uwsgi \
--http-scgi-temp-path=/home/robertaqi/lnmp/nginx/cache/scgi \
--add-module=/home/robertaqi/download/headers-more-nginx-module \
【设置别名】
在server节点中添加
server_tokens off;
more_set_headers 'Server:apache';
more_set_headers 'Server:apache';
【不用root方式启动nginx】
limit -n 1024 nginx/sbin