`

nginx在centos中的安装方法(tar.gz格式)

阅读更多
从nginx的官方网站下载稳定版本,这里下载的版本号是nginx-1.0.2。在默认情况下,经过编译安装的Nginx包含了大部分可用模块,可以通过“./configure  --help”选项设置各个模块的使用情况,例如对不需要的http_ssi模块,可通过“--without-http_ssi_module”参数关闭此模块;如果需要“http_perl”模块,则可以通过“--with-http_perl_module”参数安装此模块。执行以下操作进行安装


1.[root@localhost home]# tar zxvf nginx-1.0.2.tar.gz   
2.[root@localhost home]#cd nginx-1.0.2   
3.[root@localhostnginx-1.0.2]#./configure --with- > http_stub_status_module --prefix=/usr/local/nginx   
4.[root@localhost nginx-1.0.2]#make   
5.[root@localhost nginx-1.0.2]#make install 


安装完成后执行以下操作验证安装是否成功:


cd  /usr/local/nginx/sbin 
./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
至此,nginx的安装已成功完成。

启动nginx
cd /usr/local/nginx/sbin
./nginx //启动nginx
在浏览器中输入:http://localhost验证nginx是否成功启动
分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics