java 单机接口限流处理方案
229
2022-11-02
Shell centos7.4整合安装Nginx+Mysql+php脚本
这个脚本在centos.7.4环境下面使用 ,先安装nginx再安装php,因为php进程拥有者是nginx用户,所以先安装nginx再安装php,最后安装mysql。
[root@localhost ~]# cat test.sh #!/bin/bash#mysql define variablesmysql_ver="5.5.60"mysql_soft="mysql-${mysql_ver}.tar.gz"mysql_dir="mysql-5.5.60"mysql_url="database wordpress charset utf8;"mysql_grant_sql="grant all on wordpress.* to 'wordpress'@'192.168.179.99' identified by '123456';"mysql_exec="/usr/local/mysql55/bin/mysql" #php define variablesphp_ver="5.6.8"php_dir="/usr/local/php"php_url=" #nginx wordpress define variablesnginx_src="/usr/src"nginx_dir="/usr/local/nginx"nginx_url="--user=nginx --group=nginx --with-word_press_name="blog.wordpress.com"word_press_conf="blog.wordpress.com.conf"word_press_dir="wordpress" if [ $(id -u) -ne 0 ];then ###只有root才可以运行该脚本 echo -e "\033[32myou must run scripts as root Sorry exit!!" exit 1fi ###########################换汤不换药和上面一样只能root用户可以运行该脚本,两种方法一样#if [ `whoami` != "root" ];then#echo " only root can run it"#exit 1#fi function nginx_install(){yum install gcc pcre pcre-devel zlib zlib-devel wget make openssl-devel net-tools -ysed -i 's/enforcing/disabled/g' /etc/selinux/configsystemctl stop firewalld.service cd $nginx_srcwget -c $nginx_url/$nginx_softtar xf $nginx_softcd nginx-${nginx_ver} useradd -s /sbin/nologin nginx./configure $nginx_args make&&make install$nginx_dir/sbin/nginxps -ef | grep nginx | grep -v grep echo -e "\033[32m-----------------config Nginx vhost now------------------------------\033[0m"sleep 3s #config Nginx vhost cd $nginx_dir/conf\cp nginx.conf nginx.conf.bak\cp $nginx_src/nginx-${nginx_ver}/conf/nginx.conf $nginx_dir/conf sed -i -e '/#/d' -e '/^$/d' -e '/server/,$d' nginx.confecho -e "include /usr/local/nginx/conf/vhosts/*.conf; \n}" >>nginx.conf tar -xf $nginx_src/wordpress-4.9.4-zh_CN.tar.gz -C $nginx_dir/htmlchown -R nginx:nginx $nginx_dir/html/$word_press_dir mkdir -p vhostscd vhosts cat >$word_press_conf<
版权声明:本文内容由网络用户投稿,版权归原作者所有,本站不拥有其著作权,亦不承担相应法律责任。如果您发现本站中有涉嫌抄袭或描述失实的内容,请联系我们jiasou666@gmail.com 处理,核实后本网站将在24小时内删除侵权内容。
发表评论
暂时没有评论,来抢沙发吧~