升级ssh脚本如下:
- #!/bin/bash
- #for update nginx and update openssh
- # for install telnet
- yum install -y telnet-server telnet
- chkconfig telnet on
- /etc/init.d/xinetd restart
- netstat -tnlp
- useradd sshinstall
- echo "123456@sshinstall" | passwd --stdin sshinstall
- echo "sshinstall ALL=(ALL) NOPASSWD:ALL" >> /etc/sudoers
- # for install openssl
- tar -xzf openssl-1.0.1c.tar.gz
- cd openssl-1.0.1c
- ./config enable-tl***t --prefix=/usr/local/openssl-1.0.0c
- make && make test && make install
- echo /usr/local/openssl-1.0.0c/lib/ >> /etc/ld.so.conf
- ln -s /usr/local/openssl-1.0.0c/ /usr/local/openssl
- echo 'PATH=/usr/local/openssl/bin:$PATH
- export PATH' >> /etc/profile
- source /etc/profile
- openssl version -a
- # delete old openssh
- rpm -e openssh-server-4.3p2-41.el5 --nodeps
- rpm -e openssh-4.3p2-41.el5 --nodeps
- rpm -e openssh-askpass-4.3p2-41.el5 --nodeps
- rpm -e openssh-clients-4.3p2-41.el5 --nodeps
- rm -rf /etc/ssh/
- # intall openssh
- yum install pam-devel
- cd ..
- tar -xzf openssh-6.1p1.tar.gz
- cd openssh-6.1p1
- ./configure --prefix=/usr --sysconfdir=/etc/ssh --with-pam --with-ssl-dir=/usr/local/openssl-1.0.0c --with-md5-passwords --mandir=/usr/share/man
- make && make install
- cp ./contrib/redhat/sshd.init /etc/init.d/sshd
- chmod u+x /etc/init.d/sshd
- chkconfig --add sshd
- chkconfig sshd on
- service sshd start
- ssh -v
- chkconfig telnet off
- /etc/init.d/xinetd restart
- userdel -r sshinstall
升级nginx脚本如下:
- #!/bin/bash
- #for update nginx and update openssh
- yum install -y zlib-devel zlib gcc gcc-c++
- yum install pam-devel
- # update nginx
- tar zxvf libunwind-0.99.tar.gz
- cd libunwind-0.99/
- CFLAGS=-fPIC ./configure && make CFLAGS=-fPIC
- make CFLAGS=-fPIC install
- cd ..
- tar xzf google-perftools-1.6.tar.gz
- cd google-perftools-1.6
- ./configure
- make && make install
- cd ..
- tar -xzf pcre-8.12.tar.gz
- cd pcre-8.12
- ./configure && make && make install
- # for install geoip
- cd ..
- tar -xzf GeoIP.tar.gz
- cd GeoIP-1.4.8/
- ./configure && make && make install
- cd ..
- gunzip GeoIP.dat.gz
- echo '/usr/local/lib' > /etc/ld.so.conf.d/geoip.conf
- ldconfig
- unzip nginx_upstream_jvm_route.zip
- unzip master.zip
- tar -xzf nginx-sticky-module-1.1.tar.gz
- tar -xzf nginx-1.2.6.tar.gz
- cd nginx-1.2.6
- patch -p0 < /root/upgrade/nginx-upstream-jvm-route/nginx_upstream_jvm_route/jvm_route.patch
- patch -p1 < /root/upgrade/nginx_upstream_check_module-master/check_1.2.6+.patch
- ./configure --prefix=/usr/local/nginx --user=nobody --group=nobody --with-http_stub_status_module --with-http_gzip_static_module --with-http_realip_module --with-http_sub_module --with-http_geoip_module --with-http_ssl_module --with-http_ssl_module --with-openssl=/root/upgrade/openssl-1.0.1c --with-pcre=/root/upgrade/pcre-8.12 --add-module=/root/upgrade/nginx-upstream-jvm-route/nginx_upstream_jvm_route/ --add-module=/root/upgrade/nginx_upstream_check_module-master/ --add-module=/root/upgrade/nginx-sticky-module-1.1/ --with-google_perftools_module
- make && make install
- /usr/local/nginx/sbin/nginx -v
转载于:https://blog.51cto.com/online0904/1129417