Update Nginx installer

This commit is contained in:
joglomedia
2019-07-12 21:07:33 +07:00
parent effef2b165
commit af9f00fdfc
3 changed files with 21 additions and 15 deletions

View File

@@ -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

View File

@@ -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

View File

@@ -36,7 +36,8 @@ cat <<- _EOF_
</head>
<body>
<h1>Welcome to nginx!</h1>
<p>If you see this page, the nginx web server is successfully installed using LEMPer. Further configuration is required.</p>
<p>If you see this page, the nginx web server is successfully installed using
LEMPer. Further configuration is required.</p>
<p>For online documentation and support please refer to
<a href="http://nginx.org/">nginx.org</a>.<br/>
@@ -45,7 +46,9 @@ LEMPer and ngxTools support is available at
<p><em>Thank you for using nginx, ngxTools, and LEMPer.</em></p>
<p style="font-size:90%;">Generated using <em>LEMPer</em> from <a href="https://eslabs.id/lemper">Nginx vHost Tool</a>, a simple nginx web server management tool.</p>
<p style="font-size:90%;">Generated using <em>LEMPer</em> from
<a href="https://eslabs.id/lemper">Nginx vHost Tool</a>, a simple nginx web
server management tool.</p>
</body>
</html>
_EOF_
@@ -74,7 +77,8 @@ run bash -c 'echo "<?php phpinfo(); ?>" > /usr/share/nginx/html/tools/phpinfo.ph
run bash -c 'echo "<?php phpinfo(); ?>" > /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/