大佬教程收集整理的这篇文章主要介绍了Linux7 自动化编译安装nginx-1.17.1,大佬教程大佬觉得挺不错的,现在分享给大家,也给大家做个参考。
#!/bin/bash [ -f /etc/init.d/functions ] && . /etc/init.d/functions Install_path=/home/applications Code_path=/home/usr echo "------------------------start install Nginx------------------------" sleep 3 for soft in "gcc-c++" "zlib" "zlib-devel" "pcre" "pcre-devel" "openssl" "openssl-devel" do if [[ ! `rpm -qa $soft|wc -l` -eq 1 ]];then yum install $soft -y else rpm -e $soft -y yum install $soft -y fi done if [ ! `grep Nginx /etc/passwd|wc -l` -eq 1 ];then echo "adding user Nginx....." useradd Nginx -s /sbin/nologin -M else echo "user Nginx exsits" fi echo "------------environment installation c``ompleted------------" sleep 2 echo "--------------------------download Nginx-------------------------" sleep 3 [ -d $Code_path ] && cd $Code_path||mkdir $Code_path && cd $Code_path wget http://Nginx.org/download/Nginx-1.17.1.tar.gz tar -xf Nginx-1.17.1.tar.gz cd Nginx-1.17.1 echo "--------------------download completed-----------------------" sleep 2 echo "-------------------------- install Nginx----------------------------" sleep 3 [ -d $Install_path ]||mkdir $Install_path ./configure --prefix=$Install_path/Nginx --user=Nginx --group=Nginx --with-http_stub_status_module --with-http_ssl_module if [ $? -ne 0 ];then echo "configure Failed,please check it out!" exit 2 else echo "make Nginx,please wait for 20 minutes" make fi if [ $? -ne 0 ];then echo "make Failed,please check it out!" exit 3 else echo "install Nginx,please wait for 20 minutes" make install if [ $? -ne 0 ];then echo "make install error,please check it out" exit 4 else echo "make install succeed!!!" fi fi chown -R Nginx.Nginx $Install_path/Nginx ln -s $Install_path/Nginx/sbin/Nginx /usr/local/sbin/ /usr/local/sbin/Nginx sleep 3 echo "-----------------Nginx install succeed---------------------"
以上是大佬教程为你收集整理的Linux7 自动化编译安装nginx-1.17.1全部内容,希望文章能够帮你解决Linux7 自动化编译安装nginx-1.17.1所遇到的程序开发问题。
如果觉得大佬教程网站内容还不错,欢迎将大佬教程推荐给程序员好友。
本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。