CentOS Üzerinde Nginx'i güncelleme

Katılım
12 Haziran 2011
Mesajlar
14.298
Makaleler
3
Çözümler
6
Yer
Nebuchadnezzar
Daha fazla  
Meslek
Judge Dredd
Siteniz çalışırken de NginX'i güncelleyebilirsiniz.

Adım adım NginX 1.0.12 sürümünü 1.2.0 sürümüne güncleleyelim.

İlk olarak güncel NginX sürümünü indiriyoruz:

Kod:
cd /usr/src
wget http://nginx.org/download/nginx-1.2.0.tar.gz

Şimdi indirdiğimiz sürümü klasöre çıkartıp yüklüyoruz:

Kod:
tar xvzf nginx-1.2.0.tar.gz
cd nginx-1.2.0
./configure --with-http_ssl_module --with-http_realip_module --with-http_dav_module --with-http_flv_module --with-http_gzip_static_module
make
make install

Şimdi yüklediğimiz yeni Nginx'i eskisini sonlandırmadan çalıştırmak için şu komutu giriyoruz:

Kod:
kill -USR2 `cat /var/run/nginx.pid`

Bakalım her iki işlem birden çalışıyor mu:

Kod:
ps aux | grep nginx

Sonuç, ikisi de çalışıyor:

Kod:
root@tp1 [/usr/src/nginx-1.2.0]# ps aux | grep nginx
root       752  0.0  0.0  40888  1012 ?        Ss   21:48   0:00 nginx: master process /usr/local/sbin/nginx -c /etc/nginx/nginx.conf
nobody     753  0.0  0.0  43020  3592 ?        S    21:48   0:00 nginx: worker process
nobody     754  0.1  0.0  43020  3564 ?        S    21:48   0:00 nginx: worker process
root      3838  0.0  0.0  40888  2476 ?        S    21:52   0:00 nginx: master process /usr/local/sbin/nginx -c /etc/nginx/nginx.conf
nobody    3839  0.1  0.0  43276  3512 ?        S    21:52   0:00 nginx: worker process
nobody    3840  0.0  0.0  42900  3124 ?        S    21:52   0:00 nginx: worker process
root      3949  0.0  0.0  61228   772 pts/1    S+   21:53   0:00 grep nginx

Görüldüğü üzere eskisinin işlem kimliği 752. Şimdi eskisini kapatalım:

Kod:
kill -WINCH 752

Komutumuz işlendi mi kontrol edelim:

Kod:
root@tp1 [/usr/src/nginx-1.2.0]# kill -WINCH 752
root@tp1 [/usr/src/nginx-1.2.0]# ps aux | grep nginx
root       752  0.0  0.0  40888  1020 ?        Ss   21:48   0:00 nginx: master process /usr/local/sbin/nginx -c /etc/nginx/nginx.conf
root      3838  0.0  0.0  40888  2476 ?        S    21:52   0:00 nginx: master process /usr/local/sbin/nginx -c /etc/nginx/nginx.conf
nobody    3839  0.1  0.0  43276  3536 ?        S    21:52   0:00 nginx: worker process
nobody    3840  0.0  0.0  42900  3124 ?        S    21:52   0:00 nginx: worker process
root      4043  0.0  0.0  61228   768 pts/1    S+   21:53   0:00 grep nginx

Evet, alttaki "worker process"ler artık yok.

Şimdi sitenizi kontrol etmenizde fayda var. Siteniz sorunsuz çalışıyorsa eski işlemi komple sonlanduracağız.

Kod:
kill -QUIT 752

Bakalım oldu mu:

Kod:
root@tp1 [/usr/src/nginx-1.2.0]# ps aux | grep nginx
root      3838  0.0  0.0  40888  2476 ?        S    21:52   0:00 nginx: master process /usr/local/sbin/nginx -c /etc/nginx/nginx.conf
nobody    3839  0.2  0.0  43944  4128 ?        S    21:52   0:00 nginx: worker process
nobody    3840  0.0  0.0  42900  3124 ?        S    21:52   0:00 nginx: worker process
root      4260  0.0  0.0  61228   772 pts/1    S+   21:54   0:00 grep nginx

Evet, artık tek işlem var ve site de çalışmaya devam ediyor :) Tebrikler, nginx başarıyla güncellendi.
 
Uyarı! Bu konu 12 yıl önce açıldı.
Muhtemelen daha fazla tartışma gerekli değildir ki bu durumda yeni bir konu başlatmayı öneririz. Eğer yine de cevabınızın gerekli olduğunu düşünüyorsanız buna rağmen cevap verebilirsiniz.

Yeni konular

Geri
Yukarı