Przeglądaj źródła

Update vhost.sh

lj2007331 9 lat temu
rodzic
commit
2f7bb122a3
5 zmienionych plików z 40 dodań i 30 usunięć
  1. 2 2
      config/index_cn.html
  2. 8 6
      config/nginx.conf
  3. 8 6
      config/nginx_apache.conf
  4. 12 12
      install.sh
  5. 10 4
      vhost.sh

+ 2 - 2
config/index_cn.html

@@ -29,8 +29,8 @@ font-family:微软雅黑,sans-serif;
 <p><b>创建WEB虚拟主机执行脚本:</b>&nbsp;&nbsp;<font color="#008000">./vhost.sh</font></p>
 <p><b>创建FTP虚拟账号执行脚本:</b>&nbsp;&nbsp;<font color="#008000">./pureftpd_vhost.sh</font></p>
 <p><b>Github项目地址:</b>&nbsp;&nbsp;<a target="_blank" class="links" href="https://github.com/lj2007331/oneinstack">https://github.com/lj2007331/oneinstack</a></p>
-<p><b>OneinStack问题反馈请访问:</b>&nbsp;&nbsp;<a target="_blank" class="links" href="http://oneinstack.com">http://oneinstack.com</a></p>
-<p><b>QQ群:</b>&nbsp;&nbsp;438311066(新) 235258658(满)</p>
+<p><b>OneinStack官网:</b>&nbsp;&nbsp;<a target="_blank" class="links" href="http://oneinstack.com">http://oneinstack.com</a></p>
+<p><b>QQ群:</b>&nbsp;&nbsp;486321919(新) 438311066 235258658(满)</p>
 <p><b>赞助我们:</b></p>
 <p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;支付宝:&nbsp;&nbsp;lj2007331@gmail.com</p>
 <p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;PayPal:&nbsp;&nbsp;lj2007331@gmail.com</p>

+ 8 - 6
config/nginx.conf

@@ -40,12 +40,12 @@ http {
     gzip_proxied any;
     gzip_vary on;
     gzip_types
-      text/xml application/xml application/atom+xml application/rss+xml application/xhtml+xml image/svg+xml
-      text/javascript application/javascript application/x-javascript
-      text/x-json application/json application/x-web-app-manifest+json
-      text/css text/plain text/x-component
-      font/opentype application/x-font-ttf application/vnd.ms-fontobject
-      image/x-icon;
+        text/xml application/xml application/atom+xml application/rss+xml application/xhtml+xml image/svg+xml
+        text/javascript application/javascript application/x-javascript
+        text/x-json application/json application/x-web-app-manifest+json
+        text/css text/plain text/x-component
+        font/opentype application/x-font-ttf application/vnd.ms-fontobject
+        image/x-icon;
     gzip_disable  "msie6";
 
     #If you have a lot of static files to serve through Nginx then caching of the files' metadata (not the actual files' contents) can save some latency.
@@ -69,9 +69,11 @@ http {
         }
     location ~ .*\.(gif|jpg|jpeg|png|bmp|swf|flv|ico)$ {
         expires 30d;
+        access_log off;
         }
     location ~ .*\.(js|css)?$ {
         expires 7d;
+        access_log off;
         }
     }
 

+ 8 - 6
config/nginx_apache.conf

@@ -40,12 +40,12 @@ http {
     gzip_proxied any;
     gzip_vary on;
     gzip_types
-      text/xml application/xml application/atom+xml application/rss+xml application/xhtml+xml image/svg+xml
-      text/javascript application/javascript application/x-javascript
-      text/x-json application/json application/x-web-app-manifest+json
-      text/css text/plain text/x-component
-      font/opentype application/x-font-ttf application/vnd.ms-fontobject
-      image/x-icon;
+        text/xml application/xml application/atom+xml application/rss+xml application/xhtml+xml image/svg+xml
+        text/javascript application/javascript application/x-javascript
+        text/x-json application/json application/x-web-app-manifest+json
+        text/css text/plain text/x-component
+        font/opentype application/x-font-ttf application/vnd.ms-fontobject
+        image/x-icon;
     gzip_disable  "msie6";
 
     #If you have a lot of static files to serve through Nginx then caching of the files' metadata (not the actual files' contents) can save some latency.
@@ -73,9 +73,11 @@ http {
         }
     location ~ .*\.(gif|jpg|jpeg|png|bmp|swf|flv|ico)$ {
         expires 30d;
+        access_log off;
         }
     location ~ .*\.(js|css)?$ {
         expires 7d;
+        access_log off;
         }
     }
 

+ 12 - 12
install.sh

@@ -40,17 +40,17 @@ PUBLIC_IPADDR=`./include/get_public_ipaddr.py`
 mkdir -p $wwwroot_dir/default $wwwlogs_dir
 
 # choice upgrade OS
-while :
-do
-    echo
-    read -p "Do you want to upgrade operating system? [y/n]: " upgrade_yn
-    if [ "$upgrade_yn" != 'y' -a "$upgrade_yn" != 'n' ];then
-        echo "${CWARNING}input error! Please only input 'y' or 'n'${CEND}"
-    else
-        #[ "$upgrade_status" == '0' ] && { echo "${CWARNING}Your system is already upgraded! ${CEND}" ; upgrade_yn=Other ; }
-        break
-    fi
-done
+#while :
+#do
+#    echo
+#    read -p "Do you want to upgrade operating system? [y/n]: " upgrade_yn
+#    if [ "$upgrade_yn" != 'y' -a "$upgrade_yn" != 'n' ];then
+#        echo "${CWARNING}input error! Please only input 'y' or 'n'${CEND}"
+#    else
+#        #[ "$upgrade_status" == '0' ] && { echo "${CWARNING}Your system is already upgraded! ${CEND}" ; upgrade_yn=Other ; }
+#        break
+#    fi
+#done
 
 # Use default SSH port 22. If you use another SSH port on your server
 [ -z "`grep ^Port /etc/ssh/sshd_config`" ] && ssh_port=22 || ssh_port=`grep ^Port /etc/ssh/sshd_config | awk '{print $2}'`
@@ -62,7 +62,7 @@ do
     if [ $SSH_PORT -eq 22 >/dev/null 2>&1 -o $SSH_PORT -gt 1024 >/dev/null 2>&1 -a $SSH_PORT -lt 65535 >/dev/null 2>&1 ];then
         break
     else
-        echo "${CWARNING}input error! Input range: 22,1024~65535${CEND}"
+        echo "${CWARNING}input error! Input range: 22,1025~65534${CEND}"
     fi
 done
 

+ 10 - 4
vhost.sh

@@ -156,7 +156,7 @@ fi
 
 while :
 do
-    echo ''
+    echo
     read -p "Do you want to add more domain name? [y/n]: " moredomainame_yn 
     if [ "$moredomainame_yn" != 'y' ] && [ "$moredomainame_yn" != 'n' ];then
         echo "${CWARNING}input error! Please only input 'y' or 'n'${CEND}"
@@ -200,7 +200,7 @@ Nginx_anti_hotlinking()
 {
 while :
 do
-    echo ''
+    echo
     read -p "Do you want to add hotlink protection? [y/n]: " anti_hotlinking_yn 
     if [ "$anti_hotlinking_yn" != 'y' ] && [ "$anti_hotlinking_yn" != 'n' ];then
         echo "${CWARNING}input error! Please only input 'y' or 'n'${CEND}"
@@ -294,9 +294,11 @@ root $vhostdir;
 $anti_hotlinking
 location ~ .*\.(gif|jpg|jpeg|png|bmp|swf|flv|ico)$ {
     expires 30d;
+    access_log off;
     }
 location ~ .*\.(js|css)?$ {
     expires 7d;
+    access_log off;
     }
 $NGX_CONF
 }
@@ -342,9 +344,11 @@ $anti_hotlinking
 $NGX_CONF
 location ~ .*\.(gif|jpg|jpeg|png|bmp|swf|flv|ico)$ {
     expires 30d;
+    access_log off;
     }
 location ~ .*\.(js|css)?$ {
     expires 7d;
+    access_log off;
     }
 }
 EOF
@@ -463,9 +467,11 @@ location ~ .*\.(php|php5)?$ {
     }
 location ~ .*\.(gif|jpg|jpeg|png|bmp|swf|flv|ico)$ {
     expires 30d;
+    access_log off;
     }
 location ~ .*\.(js|css)?$ {
     expires 7d;
+    access_log off;
     }
 }
 EOF
@@ -584,7 +590,7 @@ Del_NGX_Vhost() {
                         $web_install_dir/sbin/nginx -s reload
                         while :
                         do
-                            echo ''
+                            echo
                             read -p "Do you want to delete Virtul Host directory? [y/n]: " Del_NGX_wwwroot_yn 
                             if [ "$Del_NGX_wwwroot_yn" != 'y' ] && [ "$Del_NGX_wwwroot_yn" != 'n' ];then
                                 echo "${CWARNING}input error! Please only input 'y' or 'n'${CEND}"
@@ -635,7 +641,7 @@ Del_Apache_Vhost() {
                             /etc/init.d/httpd restart
                             while :
                             do
-                                echo ''
+                                echo
                                 read -p "Do you want to delete Virtul Host directory? [y/n]: " Del_Apache_wwwroot_yn
                                 if [ "$Del_Apache_wwwroot_yn" != 'y' ] && [ "$Del_Apache_wwwroot_yn" != 'n' ];then
                                     echo "${CWARNING}input error! Please only input 'y' or 'n'${CEND}"