替换默认版本为tengine-2.3.2,下载地址变更为https

Signed-off-by: HITSword <admin@huayizhiyun.com>
master HYProxy1.0
HITSword 2020-01-07 18:08:07 +08:00
parent c4fdc71f36
commit 600193c53a
2 changed files with 27 additions and 15 deletions

View File

@ -20,6 +20,7 @@ function amh_module_install()
if amh_module_status ; then
exit;
else
#Delete other version
for module_name in `ls /root/amh/modules/ | grep 'HYProxy' | grep -v 'HYProxy-1.0'`; do
#amh module $module_name uninstall force;
#amh module $module_name delete y;
@ -33,33 +34,43 @@ function amh_module_install()
Cpunum=`cat /proc/cpuinfo |grep 'processor'|wc -l`;
nginx_configure=`/usr/local/nginx/sbin/nginx -V 2> /tmp/nginx_configure && cat /tmp/nginx_configure | grep 'configure arguments' | cut -d: -f2 && rm -f /tmp/nginx_configure`;
new_nginx_configure=$nginx_configure;
#if ! echo "$new_nginx_configure" | grep 'with-ipv6' > /dev/null; then
#new_nginx_configure="${new_nginx_configure} --with-ipv6";
#fi;
if ! echo "$new_nginx_configure" | grep 'with-http_stub_status_module' > /dev/null; then
new_nginx_configure="${new_nginx_configure} --with-http_stub_status_module";
fi;
if ! echo "$new_nginx_configure" | grep 'add-module=/usr/local/ngx_cache_purge-2.3' > /dev/null; then
new_nginx_configure="${new_nginx_configure} --add-module=/usr/local/ngx_cache_purge-2.3";
fi;
if ! echo "$new_nginx_configure" | grep 'with-stream' > /dev/null; then
new_nginx_configure="${new_nginx_configure} --with-stream";
fi;
if ! echo "$new_nginx_configure" | grep 'ngx_http_upstream_check_module' > /dev/null; then
new_nginx_configure="${new_nginx_configure} --add-module=modules/ngx_http_upstream_check_module";
fi;
if [ "$nginx_configure" != "$new_nginx_configure" ]; then
cd /usr/local/;
wget http://soft.huayizhiyun.com/manage/amh/nginx/nginx-1.14.0.tar.gz;
tar -zxf nginx-1.14.0.tar.gz;
wget http://soft.huayizhiyun.com/manage/amh/nginx/ngx_cache_purge-2.3.tar.gz;
wget https://soft.huayizhiyun.com/manage/amh/nginx/tengine-2.3.2.tar.gz;
tar -zxf tengine-2.3.2.tar.gz;
wget https://soft.huayizhiyun.com/manage/amh/nginx/ngx_cache_purge-2.3.tar.gz;
tar -zxf ngx_cache_purge-2.3.tar.gz;
cd nginx-1.14.0;
cd tengine-2.3.2;
./configure $new_nginx_configure;
make -j $Cpunum;
mv /usr/local/nginx/sbin/nginx /usr/local/nginx/sbin/nginx-old;
\cp -a ./objs/nginx /usr/local/nginx/sbin/;
kill -USR2 `cat /usr/local/nginx/logs/nginx.pid`;
cd /usr/local/;
rm -rf nginx-1.14.0 nginx-1.14.0.tar.gz /usr/local/nginx/sbin/nginx-old;
rm -rf tengine-2.3.2 tengine-2.3.2.tar.gz;
rm -rf ngx_cache_purge-2.3 ngx_cache_purge-2.3.tar.gz;
#rm -rf /usr/local/nginx/sbin/nginx-old;
kill -QUIT `cat /usr/local/nginx/logs/nginx.pid.oldbin`;
sed -i "s|Nginx.*<br />|Nginx 1.14.0 <br />|" /home/wwwroot/index/web/View/index.php;
if grep -q -e "Tengine.*<br />" /home/wwwroot/index/web/View/index.php; then
sed -i "s|Tengine.*<br />|Tengine 2.3.2 <br />|" /home/wwwroot/index/web/View/index.php;
fi
if grep -q -e "Nginx.*<br />" /home/wwwroot/index/web/View/index.php; then
sed -i "s|Nginx.*<br />|Tengine 2.3.2 <br />|" /home/wwwroot/index/web/View/index.php;
fi
fi;
MysqlPass=`cat /home/wwwroot/index/web/Amysql/Config.php | awk '{ FS="\047Password\047] = \047"; RS="\047;" } { print $2}' | sed '/^$/d'`;
@ -69,7 +80,6 @@ function amh_module_install()
\cp View/{hyproxy_category.php,hyproxy_list.php,hyproxy_cache.php,hyproxy_cache_index.php,hyproxy_cache_del.php} /home/wwwroot/index/web/View/;
mkdir -p /usr/local/nginx/conf/hyproxy;
sed -i "/include hyproxy/d" /usr/local/nginx/conf/nginx.conf;
sed -i "s/server_names_hash_bucket_size 128/server_names_hash_bucket_size 512/g" /usr/local/nginx/conf/nginx.conf;
sed -i "/include hyproxy/d" /usr/local/nginx/conf/nginx.conf;
sed -i "/include vhost/a\ \tinclude hyproxy/*.conf;" /usr/local/nginx/conf/nginx.conf;
@ -270,16 +280,18 @@ function amh_module_uninstall()
if [ "$nginx_configure" != "$new_nginx_configure" ]; then
cd /usr/local/;
wget http://soft.huayizhiyun.com/manage/amh/nginx/nginx-1.14.0.tar.gz;
tar -zxf nginx-1.14.0.tar.gz;
cd nginx-1.14.0;
wget https://soft.huayizhiyun.com/manage/amh/nginx/tengine-2.3.2.tar.gz;
tar -zxf tengine-2.3.2.tar.gz;
cd tengine-2.3.2;
./configure $new_nginx_configure;
make -j $Cpunum;
rm -rf /usr/local/nginx/sbin/nginx-old;
mv /usr/local/nginx/sbin/nginx /usr/local/nginx/sbin/nginx-old;
\cp -a ./objs/nginx /usr/local/nginx/sbin/;
kill -USR2 `cat /usr/local/nginx/logs/nginx.pid`;
cd /usr/local/;
rm -rf nginx-1.14.0 nginx-1.14.0.tar.gz /usr/local/nginx/sbin/nginx-old;
rm -rf tengine-2.3.2 tengine-2.3.2.tar.gz;
#rm -rf /usr/local/nginx/sbin/nginx-old;
kill -QUIT `cat /usr/local/nginx/logs/nginx.pid.oldbin`;
fi;

View File

@ -11,7 +11,7 @@ echo $nginx_version;
if [ "$nginx_version" != "nginx version: nginx/1.14.0" ]; then
cd /usr/local/;
wget http://soft.huayizhiyun.com/manage/amh/nginx/nginx-1.14.0.tar.gz;
wget https://soft.huayizhiyun.com/manage/amh/nginx/nginx-1.14.0.tar.gz;
tar -zxf nginx-1.14.0.tar.gz;
cd nginx-1.14.0;
./configure $new_nginx_configure;