shell脚本一键部署动态网页
#!/bin/bash $file="/usr/local/nginx/conf/nginx.conf" ??????????? #定义nginx配置文件为变量$file yum -y install gcc pcre-devel openssl-devel ??????????? #安装gcc与依赖包 ??????????? #下面的解包过程根据不同路径可进行调整 cd /root tar -xf lnmp_soft.tar.gz cd lnmp_soft tar -xf nginx-1.12.2.tar.gz cd nginx-1.12.2 ./configure ??????????? #nginx很多功能都默认不会安装,如有个人需求可以添加,只做动态网页直接configure即可 make && make install sed -i ‘65,71s/#//‘ $file ??????????? #打开配置文件65到71行 sed -i ‘/SCRIPT_FILENAME/d‘ $fie ??????????? #删除错误信息 sed -i ‘s/fastcgi_params/fastcgi.conf/‘ $file ?????????? #替换名称结尾为.conf systemctl restart mariadb systemctl restart php-fpm systemctl stop httpd ?????????? #关闭http否则端口会有冲突会报错 /usr/local/nginx/sbin/nginx ?????????? #启动数据库启动php和nginx (编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |