lj2007331 9 anni fa
parent
commit
31deb510a8
9 ha cambiato i file con 26 aggiunte e 19 eliminazioni
  1. 1 1
      backup.sh
  2. 1 1
      backup_setup.sh
  3. 7 7
      include/get_ipaddr_state.py
  4. 4 3
      include/nginx.sh
  5. 4 3
      include/tengine.sh
  6. 1 1
      include/tomcat-7.sh
  7. 1 1
      include/tomcat-8.sh
  8. 6 1
      options.conf
  9. 1 1
      vhost.sh

+ 1 - 1
backup.sh

@@ -45,7 +45,7 @@ WEB_Remote_BK() {
 
 if [ "$backup_destination" == 'local' ];then
     [ -n "`echo $backup_content | grep -ow db`" ] && DB_Local_BK
-    [ -n "`echo $backup_content| grep -ow web`" ] && WEB_Local_BK
+    [ -n "`echo $backup_content | grep -ow web`" ] && WEB_Local_BK
 elif [ "$backup_destination" == 'remote' ];then
     echo "com:::[ ! -e "$backup_dir" ] && mkdir -p $backup_dir" > config_bakcup.txt
     [ -n "`echo $backup_content | grep -ow db`" ] && DB_Remote_BK

+ 1 - 1
backup_setup.sh

@@ -53,7 +53,7 @@ do
     echo -e "\t${CMSG}3${CEND}. Database and Website"
     read -p "Please input a number:(Default 1 press Enter) " CONTENT_BK
     [ -z "$CONTENT_BK" ] && CONTENT_BK=1
-    if [ $DESC_BK != 1 -a $DESC_BK != 2 -a $DESC_BK != 3 ];then
+    if [ $CONTENT_BK != 1 -a $CONTENT_BK != 2 -a $CONTENT_BK != 3 ];then
         echo "${CWARNING}input error! Please only input number 1,2,3${CEND}"
     else
         break

+ 7 - 7
include/get_ipaddr_state.py

@@ -2,13 +2,13 @@
 #coding:utf-8
 try:
     import sys,urllib2
-    apiurl = "http://int.dpool.sina.com.cn/iplookup/iplookup.php?format=json&ip=%s" % sys.argv[1]
+    apiurl = "http://ip.taobao.com/service/getIpInfo.php?ip=%s" % sys.argv[1] 
     content = urllib2.urlopen(apiurl).read()
-    content=eval(content)
-    ret = content['ret']
-    country = content['country']
-    if ret == 1:
-        #print country.decode('unicode_escape')
-        print country
+    data = eval(content)['data']
+    code = eval(content)['code']
+    if code == 0:
+        print data['country']
+    else:
+        print data
 except:
     print "Usage:%s IP" % sys.argv[0]

+ 4 - 3
include/nginx.sh

@@ -79,15 +79,16 @@ proxy_connect_timeout 300s;
 proxy_send_timeout 900;
 proxy_read_timeout 900;
 proxy_buffer_size 32k;
-proxy_buffers 4 32k;
-proxy_busy_buffers_size 64k;
+proxy_buffers 4 64k;
+proxy_busy_buffers_size 128k;
 proxy_redirect off;
 proxy_hide_header Vary;
 proxy_set_header Accept-Encoding '';
-proxy_set_header Host \$host;
 proxy_set_header Referer \$http_referer;
 proxy_set_header Cookie \$http_cookie;
+proxy_set_header Host \$host;
 proxy_set_header X-Real-IP \$remote_addr;
+proxy_set_header X-Forwarded-For \$proxy_add_x_forwarded_for;
 EOF
 sed -i "s@/home/wwwroot/default@$wwwroot_dir/default@" $nginx_install_dir/conf/nginx.conf
 sed -i "s@/home/wwwlogs@$wwwlogs_dir@g" $nginx_install_dir/conf/nginx.conf

+ 4 - 3
include/tengine.sh

@@ -77,15 +77,16 @@ proxy_connect_timeout 300s;
 proxy_send_timeout 900;
 proxy_read_timeout 900;
 proxy_buffer_size 32k;
-proxy_buffers 4 32k;
-proxy_busy_buffers_size 64k;
+proxy_buffers 4 64k;
+proxy_busy_buffers_size 128k;
 proxy_redirect off;
 proxy_hide_header Vary;
 proxy_set_header Accept-Encoding '';
-proxy_set_header Host \$host;
 proxy_set_header Referer \$http_referer;
 proxy_set_header Cookie \$http_cookie;
+proxy_set_header Host \$host;
 proxy_set_header X-Real-IP \$remote_addr;
+proxy_set_header X-Forwarded-For \$proxy_add_x_forwarded_for;
 EOF
 sed -i "s@/home/wwwroot/default@$wwwroot_dir/default@" $tengine_install_dir/conf/nginx.conf
 sed -i "s@/home/wwwlogs@$wwwlogs_dir@g" $tengine_install_dir/conf/nginx.conf

+ 1 - 1
include/tomcat-7.sh

@@ -62,7 +62,7 @@ EOF
         [ ! -d "$tomcat_install_dir/conf/vhost" ] && mkdir $tomcat_install_dir/conf/vhost
         cat > $tomcat_install_dir/conf/vhost/localhost.xml << EOF
 <Host name="localhost" appBase="webapps" unpackWARs="true" autoDeploy="true">
-  <Context path="" docBase="$wwwroot_dir/default" debug="0" reloadable="true" crossContext="true"/>
+  <Context path="" docBase="$wwwroot_dir/default" debug="0" reloadable="false" crossContext="true"/>
   <Valve className="org.apache.catalina.valves.AccessLogValve" directory="logs"
          prefix="localhost_access_log." suffix=".txt" pattern="%h %l %u %t &quot;%r&quot; %s %b" />
 </Host>

+ 1 - 1
include/tomcat-8.sh

@@ -62,7 +62,7 @@ EOF
         [ ! -d "$tomcat_install_dir/conf/vhost" ] && mkdir $tomcat_install_dir/conf/vhost
         cat > $tomcat_install_dir/conf/vhost/localhost.xml << EOF
 <Host name="localhost" appBase="webapps" unpackWARs="true" autoDeploy="true">
-  <Context path="" docBase="$wwwroot_dir/default" debug="0" reloadable="true" crossContext="true"/>
+  <Context path="" docBase="$wwwroot_dir/default" debug="0" reloadable="false" crossContext="true"/>
   <Valve className="org.apache.catalina.valves.AccessLogValve" directory="logs" 
          prefix="localhost_access_log." suffix=".txt" pattern="%h %l %u %t &quot;%r&quot; %s %b" />
 </Host>

+ 6 - 1
options.conf

@@ -48,9 +48,14 @@ expired_days=5
 # local ; remote ; local,remote
 backup_destination=
 
-# db ; web
+# db ; web, You can't change
 backup_content=
 
+# aliyun OSS Bucket, You can't change
+oss_bucket=
+
+# The backup of the database, You can't change 
 db_name=
 
+# The backup of the website, You can't change 
 website_name=

+ 1 - 1
vhost.sh

@@ -300,7 +300,7 @@ EOF
 
 cat > $tomcat_install_dir/conf/vhost/$domain.xml << EOF
 <Host name="$domain" appBase="webapps" unpackWARs="true" autoDeploy="true"> $Tomcat_Domain_alias
-  <Context path="" docBase="$vhostdir" debug="0" reloadable="true" crossContext="true"/>
+  <Context path="" docBase="$vhostdir" debug="0" reloadable="false" crossContext="true"/>
   <Valve className="org.apache.catalina.valves.AccessLogValve" directory="logs"
          prefix="${domain}_access_log." suffix=".txt" pattern="%h %l %u %t &quot;%r&quot; %s %b" />
 </Host>