分类: 系统运维
2012-07-21 18:08:34
闲来无事把nginx服务器升级了,因为没有经常玩linux,写在这以免以后再升级的时候又去查资料。
下载:
[root@liuawblizfpws~]#wget *.*.tar.gz (版本号已修改)
解压:
[root@liuawblizfpws ~]#tar zxvf nginx-0.*.*.tar.gz (版本号已修改)
这里顺便把nginx的版本号修改了,起到一定的安全作用。
修改源码文件:
[root@liuawblizfpws ~]#vim nginx-0.*.*/src/core/nginx.h#define NGINX_VERSION "*.$.&" (版本号)#define NGINX_VER "net/" NGINX_VERSION (服务器名字)
[root@liuawblizfpws ~]#/usr/local/nginx/sbin/nginx -V
nginx: configure arguments: --user=www --group=www --prefix=/usr/local/nginx --with-http_stub_status_module --with-http_ssl_module
[root@liuawblizfpws nginx-0.*.*]#./configure --user=www --group=www --prefix=/usr/local/nginx --with-http_stub_status_module --with-http_ssl_module[root@liuawblizfpws nginx-0.*.*]#make
[root@liuawblizfpws ~]#mv /usr/local/nginx/sbin/nginx /usr/local/nginx/sbin/nginx.old
cp ~/nginx-0.*.*/objs/nginx /usr/local/nginx/sbin/nginx
[root@liuawblizfpws ~]#/usr/local/nginx/sbin/nginx -tnginx: the configuration file /usr/local/nginx/conf/nginx.conf syntax is oknginx: configuration file /usr/local/nginx/conf/nginx.conf test is successful
[root@liuawblizfpws ~]#kill -USR2 `cat /usr/local/nginx/logs/nginx.pid`
[root@liuawblizfpws ~]#kill -QUIT `cat /usr/loca/nginx/logs/nginx.pid.oldbin`
[root@liuawblizfpws ~]#curl -I netonline.meHTTP/1.1 200 OKServer: net/*.$.&Date: Thu, 09 Dec 2010 05:13:36 GMT