1,http://nginx.org/en/download.html下载http://nginx.org/download/nginx-1.2.0.tar.gz
2,tar -xf nginx-1.2.0.tar.gz
3,进入解压目录 chmod a+rwx *
4,./configure --without-http_rewrite_module
5,make && make install
6,替换安装目录下的config.conf文件,见附件
7,sudo /usr/local/nginx/sbin/nginx
浏览器访问 localhost
启动nginx ,sudo nginx ;访问localhost:8080 发现已出现nginx的欢迎页面了。
备注: ln -s /usr/local/sbin/nginx /usr/bin/nginx 做了个软连接。
常用的指令有:
nginx -V 查看版本,以及配置文件地址
nginx -v 查看版本
nginx -c filename 指定配置文件
nginx -h 帮助
nginx -s [reload\reopen\stop\quit]