Browse Source

Fix php-5.3

lj2007331 8 years ago
parent
commit
65d8ad8b3c
11 changed files with 265 additions and 243 deletions
  1. 1 1
      addons.sh
  2. 75 72
      config/nginx.conf
  3. 80 77
      config/nginx_apache.conf
  4. 73 70
      config/nginx_tomcat.conf
  5. 1 1
      include/apache-2.2.sh
  6. 1 1
      include/apache-2.4.sh
  7. 1 0
      include/check_download.sh
  8. 5 3
      include/php-5.3.sh
  9. 1 1
      include/tengine.sh
  10. 6 6
      versions.txt
  11. 21 11
      vhost.sh

+ 1 - 1
addons.sh

@@ -137,7 +137,7 @@ EOF
 }
 
 Uninstall_letsencrypt() {
-  rm -rf /usr/local/bin/cerbot-auto /etc/letsencrypt /var/log/letsencrypt
+  rm -rf /usr/local/bin/cerbot-auto /etc/letsencrypt /var/log/letsencrypt /var/lib/letsencrypt
   [ "${OS}" == "CentOS" ] && Cron_file=/var/spool/cron/root || Cron_file=/var/spool/cron/crontabs/root
   sed -i '/certbot-auto/d' ${Cron_file}
   echo; echo "${CMSG}Let's Encrypt client uninstall completed${CEND}";

+ 75 - 72
config/nginx.conf

@@ -6,86 +6,89 @@ pid /var/run/nginx.pid;
 worker_rlimit_nofile 51200;
 
 events {
-    use epoll;
-    worker_connections 51200;
-    multi_accept on;
-    }
+  use epoll;
+  worker_connections 51200;
+  multi_accept on;
+}
 
 http {
-    include mime.types;
-    default_type application/octet-stream;
-    server_names_hash_bucket_size 128;
-    client_header_buffer_size 32k;
-    large_client_header_buffers 4 32k;
-    client_max_body_size 1024m;
-    client_body_buffer_size 10m;
-    sendfile on;
-    tcp_nopush on;
-    keepalive_timeout 120;
-    server_tokens off;
-    tcp_nodelay on;
+  include mime.types;
+  default_type application/octet-stream;
+  server_names_hash_bucket_size 128;
+  client_header_buffer_size 32k;
+  large_client_header_buffers 4 32k;
+  client_max_body_size 1024m;
+  client_body_buffer_size 10m;
+  sendfile on;
+  tcp_nopush on;
+  keepalive_timeout 120;
+  server_tokens off;
+  tcp_nodelay on;
 
-    fastcgi_connect_timeout 300;
-    fastcgi_send_timeout 300;
-    fastcgi_read_timeout 300;
-    fastcgi_buffer_size 64k;
-    fastcgi_buffers 4 64k;
-    fastcgi_busy_buffers_size 128k;
-    fastcgi_temp_file_write_size 128k;
-    fastcgi_intercept_errors on;
+  fastcgi_connect_timeout 300;
+  fastcgi_send_timeout 300;
+  fastcgi_read_timeout 300;
+  fastcgi_buffer_size 64k;
+  fastcgi_buffers 4 64k;
+  fastcgi_busy_buffers_size 128k;
+  fastcgi_temp_file_write_size 128k;
+  fastcgi_intercept_errors on;
 
-    #Gzip Compression
-    gzip on;
-    gzip_buffers 16 8k;
-    gzip_comp_level 6;
-    gzip_http_version 1.1;
-    gzip_min_length 256;
-    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;
-    gzip_disable "MSIE [1-6]\.(?!.*SV1)";
+  #Gzip Compression
+  gzip on;
+  gzip_buffers 16 8k;
+  gzip_comp_level 6;
+  gzip_http_version 1.1;
+  gzip_min_length 256;
+  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;
+  gzip_disable "MSIE [1-6]\.(?!.*SV1)";
 
-    #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.
-    open_file_cache max=1000 inactive=20s;
-    open_file_cache_valid 30s;
-    open_file_cache_min_uses 2;
-    open_file_cache_errors on;
+  #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.
+  open_file_cache max=1000 inactive=20s;
+  open_file_cache_valid 30s;
+  open_file_cache_min_uses 2;
+  open_file_cache_errors on;
 
 ######################## default ############################
-    server {
-    listen 80;
-    server_name _;
-    access_log /data/wwwlogs/access_nginx.log combined;
-    root /data/wwwroot/default;
-    index index.html index.htm index.php;
-    location /nginx_status {
-        stub_status on;
-        access_log off;
-        allow 127.0.0.1;
-        deny all;
-        }
-    location ~ [^/]\.php(/|$) {
-        #fastcgi_pass remote_php_ip:9000;
-        fastcgi_pass unix:/dev/shm/php-cgi.sock;
-        fastcgi_index index.php;
-        include fastcgi.conf;
-        }
-    location ~ .*\.(gif|jpg|jpeg|png|bmp|swf|flv|mp4|ico)$ {
-        expires 30d;
-        access_log off;
-        }
-    location ~ .*\.(js|css)?$ {
-        expires 7d;
-        access_log off;
-        }
+  server {
+  listen 80;
+  server_name _;
+  access_log /data/wwwlogs/access_nginx.log combined;
+  root /data/wwwroot/default;
+  index index.html index.htm index.php;
+  location /nginx_status {
+    stub_status on;
+    access_log off;
+    allow 127.0.0.1;
+    deny all;
+    }
+  location ~ [^/]\.php(/|$) {
+    #fastcgi_pass remote_php_ip:9000;
+    fastcgi_pass unix:/dev/shm/php-cgi.sock;
+    fastcgi_index index.php;
+    include fastcgi.conf;
+    }
+  location ~ .*\.(gif|jpg|jpeg|png|bmp|swf|flv|mp4|ico)$ {
+    expires 30d;
+    access_log off;
+    }
+  location ~ .*\.(js|css)?$ {
+    expires 7d;
+    access_log off;
+    }
+  location ~ /\.ht {
+    deny all;
     }
+  }
 
 ########################## vhost #############################
-    include vhost/*.conf;
+  include vhost/*.conf;
 }

+ 80 - 77
config/nginx_apache.conf

@@ -6,91 +6,94 @@ pid /var/run/nginx.pid;
 worker_rlimit_nofile 51200;
 
 events {
-    use epoll;
-    worker_connections 51200;
-    multi_accept on;
-    }
+  use epoll;
+  worker_connections 51200;
+  multi_accept on;
+}
 
 http {
-    include mime.types;
-    default_type application/octet-stream;
-    server_names_hash_bucket_size 128;
-    client_header_buffer_size 32k;
-    large_client_header_buffers 4 32k;
-    client_max_body_size 1024m;
-    client_body_buffer_size 10m;
-    sendfile on;
-    tcp_nopush on;
-    keepalive_timeout 120;
-    server_tokens off;
-    tcp_nodelay on;
+  include mime.types;
+  default_type application/octet-stream;
+  server_names_hash_bucket_size 128;
+  client_header_buffer_size 32k;
+  large_client_header_buffers 4 32k;
+  client_max_body_size 1024m;
+  client_body_buffer_size 10m;
+  sendfile on;
+  tcp_nopush on;
+  keepalive_timeout 120;
+  server_tokens off;
+  tcp_nodelay on;
 
-    fastcgi_connect_timeout 300;
-    fastcgi_send_timeout 300;
-    fastcgi_read_timeout 300;
-    fastcgi_buffer_size 64k;
-    fastcgi_buffers 4 64k;
-    fastcgi_busy_buffers_size 128k;
-    fastcgi_temp_file_write_size 128k;
-    fastcgi_intercept_errors on;
+  fastcgi_connect_timeout 300;
+  fastcgi_send_timeout 300;
+  fastcgi_read_timeout 300;
+  fastcgi_buffer_size 64k;
+  fastcgi_buffers 4 64k;
+  fastcgi_busy_buffers_size 128k;
+  fastcgi_temp_file_write_size 128k;
+  fastcgi_intercept_errors on;
 
-    #Gzip Compression
-    gzip on;
-    gzip_buffers 16 8k;
-    gzip_comp_level 6;
-    gzip_http_version 1.1;
-    gzip_min_length 256;
-    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;
-    gzip_disable "MSIE [1-6]\.(?!.*SV1)";
+  #Gzip Compression
+  gzip on;
+  gzip_buffers 16 8k;
+  gzip_comp_level 6;
+  gzip_http_version 1.1;
+  gzip_min_length 256;
+  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;
+  gzip_disable "MSIE [1-6]\.(?!.*SV1)";
 
-    #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.
-    open_file_cache max=1000 inactive=20s;
-    open_file_cache_valid 30s;
-    open_file_cache_min_uses 2;
-    open_file_cache_errors on;
+  #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.
+  open_file_cache max=1000 inactive=20s;
+  open_file_cache_valid 30s;
+  open_file_cache_min_uses 2;
+  open_file_cache_errors on;
 
 ######################## default ############################
-    server {
-    listen 80;
-    server_name _;
-    access_log /data/wwwlogs/access_nginx.log combined;
-    root /data/wwwroot/default;
-    index index.html index.htm index.php;
-    location /nginx_status {
-        stub_status on;
-        access_log off;
-        allow 127.0.0.1;
-        deny all;
-        }
-    location / {
-        try_files $uri @apache;
-        }
-    location @apache {
-        proxy_pass http://127.0.0.1:88;
-        include proxy.conf;
-        }
-    location ~ [^/]\.php(/|$) {
-        proxy_pass http://127.0.0.1:88;
-        include proxy.conf;
-        }
-    location ~ .*\.(gif|jpg|jpeg|png|bmp|swf|flv|mp4|ico)$ {
-        expires 30d;
-        access_log off;
-        }
-    location ~ .*\.(js|css)?$ {
-        expires 7d;
-        access_log off;
-        }
+  server {
+  listen 80;
+  server_name _;
+  access_log /data/wwwlogs/access_nginx.log combined;
+  root /data/wwwroot/default;
+  index index.html index.htm index.php;
+  location /nginx_status {
+    stub_status on;
+    access_log off;
+    allow 127.0.0.1;
+    deny all;
+    }
+  location / {
+    try_files $uri @apache;
+    }
+  location @apache {
+    proxy_pass http://127.0.0.1:88;
+    include proxy.conf;
+    }
+  location ~ [^/]\.php(/|$) {
+    proxy_pass http://127.0.0.1:88;
+    include proxy.conf;
+    }
+  location ~ .*\.(gif|jpg|jpeg|png|bmp|swf|flv|mp4|ico)$ {
+    expires 30d;
+    access_log off;
+    }
+  location ~ .*\.(js|css)?$ {
+    expires 7d;
+    access_log off;
+    }
+  location ~ /\.ht {
+    deny all;
     }
+  }
 
 ########################## vhost #############################
-    include vhost/*.conf;
+  include vhost/*.conf;
 }

+ 73 - 70
config/nginx_tomcat.conf

@@ -6,84 +6,87 @@ pid /var/run/nginx.pid;
 worker_rlimit_nofile 51200;
 
 events {
-    use epoll;
-    worker_connections 51200;
-    multi_accept on;
-    }
+  use epoll;
+  worker_connections 51200;
+  multi_accept on;
+}
 
 http {
-    include mime.types;
-    default_type application/octet-stream;
-    server_names_hash_bucket_size 128;
-    client_header_buffer_size 32k;
-    large_client_header_buffers 4 32k;
-    client_max_body_size 1024m;
-    client_body_buffer_size 10m;
-    sendfile on;
-    tcp_nopush on;
-    keepalive_timeout 120;
-    server_tokens off;
-    tcp_nodelay on;
+  include mime.types;
+  default_type application/octet-stream;
+  server_names_hash_bucket_size 128;
+  client_header_buffer_size 32k;
+  large_client_header_buffers 4 32k;
+  client_max_body_size 1024m;
+  client_body_buffer_size 10m;
+  sendfile on;
+  tcp_nopush on;
+  keepalive_timeout 120;
+  server_tokens off;
+  tcp_nodelay on;
 
-    fastcgi_connect_timeout 300;
-    fastcgi_send_timeout 300;
-    fastcgi_read_timeout 300;
-    fastcgi_buffer_size 64k;
-    fastcgi_buffers 4 64k;
-    fastcgi_busy_buffers_size 128k;
-    fastcgi_temp_file_write_size 128k;
-    fastcgi_intercept_errors on;
+  fastcgi_connect_timeout 300;
+  fastcgi_send_timeout 300;
+  fastcgi_read_timeout 300;
+  fastcgi_buffer_size 64k;
+  fastcgi_buffers 4 64k;
+  fastcgi_busy_buffers_size 128k;
+  fastcgi_temp_file_write_size 128k;
+  fastcgi_intercept_errors on;
 
-    #Gzip Compression
-    gzip on;
-    gzip_buffers 16 8k;
-    gzip_comp_level 6;
-    gzip_http_version 1.1;
-    gzip_min_length 256;
-    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;
-    gzip_disable "MSIE [1-6]\.(?!.*SV1)";
+  #Gzip Compression
+  gzip on;
+  gzip_buffers 16 8k;
+  gzip_comp_level 6;
+  gzip_http_version 1.1;
+  gzip_min_length 256;
+  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;
+  gzip_disable "MSIE [1-6]\.(?!.*SV1)";
 
-    #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.
-    open_file_cache max=1000 inactive=20s;
-    open_file_cache_valid 30s;
-    open_file_cache_min_uses 2;
-    open_file_cache_errors on;
+  #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.
+  open_file_cache max=1000 inactive=20s;
+  open_file_cache_valid 30s;
+  open_file_cache_min_uses 2;
+  open_file_cache_errors on;
 
 ######################## default ############################
-    server {
-    listen 80;
-    server_name _;
-    access_log /data/wwwlogs/access_nginx.log combined;
-    root /data/wwwroot/default;
-    index index.html index.htm index.jsp;
-    location /nginx_status {
-        stub_status on;
-        access_log off;
-        allow 127.0.0.1;
-        deny all;
-        }
-    location ~ .*\.(gif|jpg|jpeg|png|bmp|swf|flv|mp4|ico)$ {
-        expires 30d;
-        access_log off;
-        }
-    location ~ .*\.(js|css)?$ {
-        expires 7d;
-        access_log off;
-        }
-    location ~ {
-        proxy_pass http://127.0.0.1:8080;
-        include proxy.conf;
-        }
+  server {
+  listen 80;
+  server_name _;
+  access_log /data/wwwlogs/access_nginx.log combined;
+  root /data/wwwroot/default;
+  index index.html index.htm index.jsp;
+  location /nginx_status {
+    stub_status on;
+    access_log off;
+    allow 127.0.0.1;
+    deny all;
+    }
+  location ~ .*\.(gif|jpg|jpeg|png|bmp|swf|flv|mp4|ico)$ {
+    expires 30d;
+    access_log off;
+    }
+  location ~ .*\.(js|css)?$ {
+    expires 7d;
+    access_log off;
+    }
+  location ~ {
+    proxy_pass http://127.0.0.1:8080;
+    include proxy.conf;
+    }
+  location ~ /\.ht {
+    deny all;
     }
+  }
 
 ########################## vhost #############################
-    include vhost/*.conf;
+  include vhost/*.conf;
 }

+ 1 - 1
include/apache-2.2.sh

@@ -76,7 +76,7 @@ $wwwlogs_dir/*apache.log {
 EOF
 
   mkdir $apache_install_dir/conf/vhost
-  cat >> $apache_install_dir/conf/vhost/0.conf << EOF
+  cat > $apache_install_dir/conf/vhost/0.conf << EOF
 NameVirtualHost *:$TMP_PORT
 <VirtualHost *:$TMP_PORT>
   ServerAdmin admin@linuxeye.com

+ 1 - 1
include/apache-2.4.sh

@@ -90,7 +90,7 @@ $wwwlogs_dir/*apache.log {
 EOF
 
   mkdir $apache_install_dir/conf/vhost
-  cat >> $apache_install_dir/conf/vhost/0.conf << EOF
+  cat > $apache_install_dir/conf/vhost/0.conf << EOF
 <VirtualHost *:$TMP_PORT>
   ServerAdmin admin@linuxeye.com
   DocumentRoot "$wwwroot_dir/default"

+ 1 - 0
include/check_download.sh

@@ -492,6 +492,7 @@ checkDownload(){
         if [ "${Debian_version}" == '8' -o "${Ubuntu_version}" == "16" ]; then
           if [ ! -e "/usr/local/openssl/lib/libcrypto.a" ]; then
             src_url=${mirrorLink}/openssl-1.0.0s.tar.gz && Download_src
+            src_url=${mirrorLink}/curl-7.35.0.tar.gz && Download_src
           fi
         fi
         src_url=http://www.php.net/distributions/php-${php_3_version}.tar.gz && Download_src

+ 5 - 3
include/php-5.3.sh

@@ -34,16 +34,18 @@ Install_PHP-5-3() {
     OpenSSL_args='--with-openssl'
   fi
   
-  tar xzf curl-$curl_version.tar.gz
-  pushd curl-$curl_version
   if [ "$Debian_version" == '8' -o "$Ubuntu_version" == '16' ]; then
+    tar xzf curl-7.35.0.tar.gz
+    pushd curl-7.35.0
     LDFLAGS="-Wl,-rpath=/usr/local/openssl/lib" ./configure --prefix=/usr/local --with-ssl=/usr/local/openssl
   else
+    tar xzf curl-$curl_version.tar.gz
+    pushd curl-$curl_version
     ./configure --prefix=/usr/local
   fi
   make -j ${THREAD} && make install
   popd
-  rm -rf curl-$curl_version
+  rm -rf curl-7.35.0 curl-$curl_version 
   
   tar xzf libmcrypt-$libmcrypt_version.tar.gz
   pushd libmcrypt-$libmcrypt_version

+ 1 - 1
include/tengine.sh

@@ -25,7 +25,7 @@ Install_Tengine() {
   sed -i 's@CFLAGS="$CFLAGS -g"@#CFLAGS="$CFLAGS -g"@' auto/cc/gcc
   
   [ ! -d "$tengine_install_dir" ] && mkdir -p $tengine_install_dir
-  ./configure --prefix=$tengine_install_dir --user=$run_user --group=$run_user --with-http_stub_status_module --with-http_spdy_module --with-http_ssl_module --with-ipv6 --with-http_gzip_static_module --with-http_realip_module --with-http_flv_module --with-http_mp4_module --with-http_concat_module=shared --with-http_sysguard_module=shared --with-openssl=../openssl-$openssl_version --with-pcre=../pcre-$pcre_version --with-pcre-jit --with-jemalloc 
+  ./configure --prefix=$tengine_install_dir --user=$run_user --group=$run_user --with-http_stub_status_module --with-http_v2_module --with-http_ssl_module --with-ipv6 --with-http_gzip_static_module --with-http_realip_module --with-http_flv_module --with-http_mp4_module --with-http_concat_module=shared --with-http_sysguard_module=shared --with-openssl=../openssl-$openssl_version --with-pcre=../pcre-$pcre_version --with-pcre-jit --with-jemalloc
   make -j ${THREAD} && make install
   if [ -e "$tengine_install_dir/conf/nginx.conf" ]; then
     popd

+ 6 - 6
versions.txt

@@ -1,7 +1,7 @@
 # newest software version
 # Web
 nginx_version=1.10.2
-tengine_version=2.1.1
+tengine_version=2.1.2
 openresty_version=1.11.2.1
 openssl_version=1.0.2j
 
@@ -20,7 +20,7 @@ mysql_5_7_version=5.7.16
 mysql_5_6_version=5.6.34
 mysql_5_5_version=5.5.53
 
-mariadb_10_1_version=10.1.18
+mariadb_10_1_version=10.1.19
 mariadb_10_0_version=10.0.28
 mariadb_5_5_version=5.5.53
 
@@ -36,8 +36,8 @@ jdk_7_version=1.7.0_80
 jdk_6_version=1.6.0_45
 
 # PHP
-php_7_version=7.0.12
-php_6_version=5.6.27
+php_7_version=7.0.13
+php_6_version=5.6.28
 php_5_version=5.5.38
 php_4_version=5.4.45
 php_3_version=5.3.29
@@ -46,7 +46,7 @@ zendopcache_version=7.0.5
 xcache_version=3.2.0
 apcu_version=4.0.11
 apcu_for_php7_version=5.1.7
-ImageMagick_version=6.9.6-3
+ImageMagick_version=6.9.6-4
 imagick_version=3.4.1
 imagick_for_php53_version=3.3.0
 GraphicsMagick_version=1.3.25
@@ -77,7 +77,7 @@ memcache_pecl_version=3.0.8
 phpMyAdmin_version=4.4.15.8
 
 # jemalloc
-jemalloc_version=4.2.1
+jemalloc_version=4.3.1
 
 # boost
 boost_version=1.59.0

+ 21 - 11
vhost.sh

@@ -126,13 +126,13 @@ Choose_env() {
 
   case "${NGX_FLAG}" in
     "php")
-      NGX_CONF=$(echo -e "location ~ [^/]\.php(/|$) {\n  #fastcgi_pass remote_php_ip:9000;\n  fastcgi_pass unix:/dev/shm/php-cgi.sock;\n  fastcgi_index index.php;\n  include fastcgi.conf;\n}")
+      NGX_CONF=$(echo -e "location ~ [^/]\.php(/|$) {\n    #fastcgi_pass remote_php_ip:9000;\n    fastcgi_pass unix:/dev/shm/php-cgi.sock;\n    fastcgi_index index.php;\n    include fastcgi.conf;\n  }")
       ;;
     "java")
-      NGX_CONF=$(echo -e "location ~ {\n  proxy_pass http://127.0.0.1:8080;\n  include proxy.conf;\n}")
+      NGX_CONF=$(echo -e "location ~ {\n    proxy_pass http://127.0.0.1:8080;\n    include proxy.conf;\n  }")
       ;;
     "hhvm")
-      NGX_CONF=$(echo -e "location ~ .*\.(php|php5)?$ {\n  fastcgi_pass unix:/var/log/hhvm/sock;\n  fastcgi_index index.php;\n  fastcgi_param SCRIPT_FILENAME \$document_root\$fastcgi_script_name;\n  include fastcgi_params;\n}")
+      NGX_CONF=$(echo -e "location ~ .*\.(php|php5)?$ {\n    fastcgi_pass unix:/var/log/hhvm/sock;\n    fastcgi_index index.php;\n    fastcgi_param SCRIPT_FILENAME \$document_root\$fastcgi_script_name;\n    include fastcgi_params;\n  }")
       ;;
   esac
 }
@@ -219,9 +219,9 @@ Create_SSL() {
           Cron_Command="/etc/init.d/httpd graceful"
         fi
         [ "${OS}" == "CentOS" ] && Cron_file=/var/spool/cron/root || Cron_file=/var/spool/cron/crontabs/root
-        [ -z "$(grep "${domain} ${moredomainame_D}" ${Cron_file})" ] && echo "0 10 * * 1 /usr/local/bin/certbot-auto certonly -a webroot --agree-tos --renew-by-default --webroot-path=${wwwroot_dir}/${domain} -d ${domain} ${moredomainame_D};${Cron_Command}" >> $Cron_file
+        [ -z "$(grep "${domain} ${moredomainame_D}" ${Cron_file})" ] && echo "0 10 * * 1 /usr/local/bin/certbot-auto certonly --agree-tos --renew-by-default --webroot -w ${wwwroot_dir}/${domain} -d ${domain} ${moredomainame_D};${Cron_Command}" >> $Cron_file
       else
-        echo "${CFAILURE}Error: Let's Encrypt SSL certificate installation failed${CEND}"
+        echo "${CFAILURE}Error: Let's Encrypt SSL certificate installation failed! ${CEND}"
         exit 1
       fi
     else
@@ -455,6 +455,8 @@ server {
   ${N_log}
   index index.html index.htm index.jsp;
   root ${vhostdir};
+  #error_page 404 = /404.html;
+  #error_page 502 = /502.html;
   ${Nginx_redirect}
   ${anti_hotlinking}
   location ~ .*\.(gif|jpg|jpeg|png|bmp|swf|flv|mp4|ico)$ {
@@ -465,9 +467,10 @@ server {
     expires 7d;
     access_log off;
   }
+  location ~ /\.ht {
+    deny all;
+  }
   ${NGX_CONF}
-  #error_page 404 = /404.html;
-  #error_page 502 = /502.html;
 }
 EOF
 
@@ -544,6 +547,8 @@ server {
   index index.html index.htm index.php;
   include ${web_install_dir}/conf/rewrite/${rewrite}.conf;
   root ${vhostdir};
+  #error_page 404 = /404.html;
+  #error_page 502 = /502.html;
   ${Nginx_redirect}
   ${anti_hotlinking}
   ${NGX_CONF}
@@ -555,8 +560,9 @@ server {
     expires 7d;
     access_log off;
   }
-  #error_page 404 = /404.html;
-  #error_page 502 = /502.html;
+  location ~ /\.ht {
+    deny all;
+  }
 }
 EOF
 
@@ -667,6 +673,7 @@ EOF
   echo "$(printf "%-30s" "Your domain:")${CMSG}${domain}${CEND}"
   echo "$(printf "%-30s" "Virtualhost conf:")${CMSG}${apache_install_dir}/conf/vhost/${domain}.conf${CEND}"
   echo "$(printf "%-30s" "Directory of:")${CMSG}${vhostdir}${CEND}"
+  [ "${apache_ssl_yn}" == 'y' ] && Print_ssl
 }
 
 Create_nginx_apache_mod-php_conf() {
@@ -700,6 +707,9 @@ server {
     expires 7d;
     access_log off;
   }
+  location ~ /\.ht {
+    deny all;
+  }
 }
 EOF
 
@@ -820,7 +830,7 @@ Del_NGX_Vhost() {
             echo "${CWARNING}input error! ${CEND}"
           else
             if [ -e "${web_install_dir}/conf/vhost/${domain}.conf" ]; then
-              Directory=$(grep ^root ${web_install_dir}/conf/vhost/${domain}.conf | awk -F'[ ;]' '{print $2}')
+              Directory=$(grep '^  root' ${web_install_dir}/conf/vhost/${domain}.conf | head -1 | awk -F'[ ;]' '{print $(NF-1)}')
               rm -rf ${web_install_dir}/conf/vhost/${domain}.conf
               ${web_install_dir}/sbin/nginx -s reload
               while :; do echo
@@ -867,7 +877,7 @@ Del_Apache_Vhost() {
             echo "${CWARNING}input error! ${CEND}"
           else
             if [ -e "${apache_install_dir}/conf/vhost/${domain}.conf" ]; then
-              Directory=$(grep '^<Directory' ${apache_install_dir}/conf/vhost/${domain}.conf | awk -F'"' '{print $2}')
+              Directory=$(grep '^<Directory ' ${apache_install_dir}/conf/vhost/${domain}.conf | head -1 | awk -F'"' '{print $2}')
               rm -rf ${apache_install_dir}/conf/vhost/${domain}.conf
               /etc/init.d/httpd restart
               while :; do echo