From af9f00fdfcd918bab6c2ef2a9584c15378de4f7b Mon Sep 17 00:00:00 2001 From: joglomedia Date: Fri, 12 Jul 2019 21:07:33 +0700 Subject: [PATCH] Update Nginx installer --- scripts/install_nginx.sh | 10 +--------- scripts/install_nginx_from_source.sh | 2 +- scripts/install_tools.sh | 24 +++++++++++++++++++----- 3 files changed, 21 insertions(+), 15 deletions(-) diff --git a/scripts/install_nginx.sh b/scripts/install_nginx.sh index c586d76..09173f7 100755 --- a/scripts/install_nginx.sh +++ b/scripts/install_nginx.sh @@ -32,7 +32,7 @@ function nginx_install_menu() { case $NGINX_INSTALLER in 1) echo -e "\nInstalling Nginx from package repository..." - run apt-get install -y --allow-unauthenticated ${NGX_PACKAGE} + run apt-get install -y --allow-unauthenticated ${NGX_PACKAGE} >> lemper.log 2>&1 ;; 2) echo -e "\nInstalling Nginx from source..." @@ -68,14 +68,6 @@ function nginx_install_menu() { if [[ -f /usr/lib/nginx/modules/ngx_pagespeed.so && ! -f /etc/nginx/modules-available/mod-pagespeed.conf ]]; then run bash -c 'echo "load_module \"/usr/lib/nginx/modules/ngx_pagespeed.so\";" > \ /etc/nginx/modules-available/mod-pagespeed.conf' - - # Secure PageSpeed ​​Admin - PASSHASH="" - if [[ -n $(which php) ]]; then - PHPCMD="echo crypt(\"${PASSWORD}\", base64_encode(\"${PASSWORD}\"));" - PASSHASH=$(php -r "${PHPCMD}") - fi - echo "${USERNAME}:${PASSHASH}" >> /srv/.htpasswd fi if [[ -f /usr/lib/nginx/modules/ngx_http_geoip_module.so && ! -f /etc/nginx/modules-available/mod-http-geoip.conf ]]; then diff --git a/scripts/install_nginx_from_source.sh b/scripts/install_nginx_from_source.sh index c0d59c4..f4f0191 100755 --- a/scripts/install_nginx_from_source.sh +++ b/scripts/install_nginx_from_source.sh @@ -948,7 +948,7 @@ with --no-deps-check." fi configure_args=("${configure_args[@]}" "--prefix=$install_dir/nginx" - "--with-ipv6" + "--with-ipv6" #deprecated in version 1.15 "--with-http_v2_module" "${add_modules[@]}") if [ "$BUILD_TYPE" = "Debug" ]; then diff --git a/scripts/install_tools.sh b/scripts/install_tools.sh index 60fafec..6eb44a0 100755 --- a/scripts/install_tools.sh +++ b/scripts/install_tools.sh @@ -36,7 +36,8 @@ cat <<- _EOF_

Welcome to nginx!

-

If you see this page, the nginx web server is successfully installed using LEMPer. Further configuration is required.

+

If you see this page, the nginx web server is successfully installed using +LEMPer. Further configuration is required.

For online documentation and support please refer to nginx.org.
@@ -45,7 +46,9 @@ LEMPer and ngxTools support is available at

Thank you for using nginx, ngxTools, and LEMPer.

-

Generated using LEMPer from Nginx vHost Tool, a simple nginx web server management tool.

+

Generated using LEMPer from +Nginx vHost Tool, a simple nginx web +server management tool.

_EOF_ @@ -74,7 +77,8 @@ run bash -c 'echo "" > /usr/share/nginx/html/tools/phpinfo.ph run bash -c 'echo "" > /usr/share/nginx/html/tools/phpinfo.php72' # Install Zend OpCache Web Viewer -run wget -q --no-check-certificate https://raw.github.com/rlerdorf/opcache-status/master/opcache.php -O /usr/share/nginx/html/tools/opcache.php +run wget -q --no-check-certificate https://raw.github.com/rlerdorf/opcache-status/master/opcache.php \ + -O /usr/share/nginx/html/tools/opcache.php # Install Memcache Web-based stats #http://blog.elijaa.org/index.php?pages/phpMemcachedAdmin-Installation-Guide @@ -82,8 +86,10 @@ run git clone -q https://github.com/elijaa/phpmemcachedadmin.git /usr/share/ngin # Install Adminer for Web-based MySQL Administration Tool run mkdir /usr/share/nginx/html/tools/adminer/ -run wget -q --no-check-certificate https://github.com/vrana/adminer/releases/download/v4.7.1/adminer-4.7.1.php -O /usr/share/nginx/html/tools/adminer/index.php -run wget -q --no-check-certificate https://github.com/vrana/adminer/releases/download/v4.7.1/editor-4.7.1.php -O /usr/share/nginx/html/tools/adminer/editor.php +run wget -q --no-check-certificate https://github.com/vrana/adminer/releases/download/v4.7.1/adminer-4.7.1.php \ + -O /usr/share/nginx/html/tools/adminer/index.php +run wget -q --no-check-certificate https://github.com/vrana/adminer/releases/download/v4.7.1/editor-4.7.1.php \ + -O /usr/share/nginx/html/tools/adminer/editor.php # Install FileRun File Manager run mkdir /usr/share/nginx/html/tools/filerun/ @@ -93,6 +99,14 @@ run rm -f FileRun.zip # TODO: try Tinyfilemanager https://github.com/prasathmani/tinyfilemanager +# Secure Nginx Mod PageSpeed ​​Admin +PASSHASH="" +if [[ -n $(which php) ]]; then + PHPCMD="echo crypt(\"${PASSWORD}\", base64_encode(\"${PASSWORD}\"));" + PASSHASH=$(php -r "${PHPCMD}") +fi +echo "${USERNAME}:${PASSHASH}" >> /srv/.htpasswd + # Assign ownership properly run chown -hR www-data:root /usr/share/nginx/html/tools/