安装nginx
首先需要下载nginx安装tar包,地址为:http://nginx.org/download/,并将其上传至机器,对其进行解压
> tar -zxvf nginx-1.2.6.tar.gz
> yum -y install pcre pcre-devel zlib zlib-devel
创建nginx用户:#useradd -s /sbin/nologin -M nginx
开始安装:
#./configure --prefix=/usr/local/nginx --user=nginx --group=nginx --with-http_stub_status_module
#make && make install
测试是否安装成功:
echo "hadoop" >>/usr/local/nginx/html/index.html
/usr/local/nginx/sbin/nginx
curl localhost
修改vi /usr/local/nginx/conf/nginx.conf配置文件
检测语法是否正常:/usr/local/nginx/sbin/nginx -t
重载:kill -H