|
You last visited: Today at 17:59
Advertisement
Der perfekte Rootserver (Support Thread)
Discussion on Der perfekte Rootserver (Support Thread) within the Unix/Linux forum part of the Technical Support category.
08/22/2016, 11:32
|
#346
|
elite*gold: 0
Join Date: Jun 2010
Posts: 74
Received Thanks: 6
|
Ich habe mal einen Nginx Update Script gebastelt, der wirklich stupide funktioniert.
1. Nginx Ordner wird gesichert
2. Nginx Download, Compile und Installation
3. Ordner wird zurück gespielt
Nach der normalen Installation von Zyprs Script (letzte Version) liefen bei mir im Test alle Sachen wie gewohnt.
Ich übernehme keine Garantie das es bei jedem funktioniert oder nicht etwas kaputt geht, daher Nutzung auf eigene Gefahr!
Edit:
Quote:
Originally Posted by TakeThisBitch
Ich hatte mal ne spielwiese Bei ohv und da lief das Script hervorragend. Als das System da stabil lief habe ich es bei netcup umgesetzt
Gesendet von meinem C6903 mit Tapatalk
|
Quote:
Originally Posted by TiggaStyle
@
läuft läuft.
|
Danke  Der Script ist bei OVH entstanden / getestet.
Das Webinterface gefällt mir wirklich gut.
|
|
|
08/22/2016, 17:37
|
#347
|
elite*gold: 0
Join Date: Jan 2015
Posts: 118
Received Thanks: 17
|
@  , danke!
ich weiß nicht, ob ich es richtig gemacht habe bei Git. ich habe das Script mal erweitert, es kann jetzt insgesamt: - [NEU]SYSTEM UPDATE
- [NEU]Cert with mail UPDATE
- [NEU]Cert Without Mail UPDATE
- [NEU]UPDATE ROUNDCUBE
- UPDATE nginx
- UPDATE OPENSSL
- UPDATE NPS
Es kann natürlich in der Config. eingestellt werden was wie geupdatet werden soll.
Hoffe, ich habe das bei Githup richtig hinterlegt.
updateconfig.cfg
Code:
############
# Versions #
############
# Versions from 22.08.2016
NGINX_VERSION="1.11.3"
OPENSSL_VERSION="1.0.2g"
OPENSSH_VERSION="7.2p2"
NPS_VERSION="1.11.33.2"
ROUNDCUBE_VERSION="1.2.1"
###############################
# Edit settings to your needs #
###############################
# Enter your domain without a subdomain (www)
# --------------------------------
MYDOMAIN="yourdomain.tld"
MYEMAIL=" "
# ---------------------------------------------------------------------------------------- #
########################### SYSTEM UPDATE
# ---------------------------------------------------------------------------------------- #
SYSTEM_UPDATE="1"
# ---------------------------------------------------------------------------------------- #
########################### Cert with mail UPDATE
# ---------------------------------------------------------------------------------------- #
CERT_UPDATE="0"
# ---------------------------------------------------------------------------------------- #
########################### Cert Without Mail UPDATE
# ---------------------------------------------------------------------------------------- #
CERT_UPDATE_MAIL="1"
# ---------------------------------------------------------------------------------------- #
########################### UPDATE ROUNDCUBE
# ---------------------------------------------------------------------------------------- #
ROUNDCUBE_UPDATE="1"
# ---------------------------------------------------------------------------------------- #
########################### NGINX UPDATE
# ---------------------------------------------------------------------------------------- #
NGINX_UPDATE="0"
# ---------------------------------------------------------------------------------------- #
########################### READY?
# ---------------------------------------------------------------------------------------- #
CONFIG_COMPLETED="0"
update.sh
Code:
#!/bin/bash
# The perfect rootserver UPDATE
# by Shoujii
# https://github.com/mxiiii/perfect_update
# Based on https://github.com/zypr/perfectrootserver & https://github.com/mxiiii/perfect_update
# Thanks to Zypr and and mxiiii
# Compatible with Debian 8.x (jessie)
source ~/updateconfig.cfg
# Some nice colors
cyan() { echo "$(tput setaf 6)$*$(tput setaf 9)"; }
textb() { echo $(tput bold)${1}$(tput sgr0); }
greenb() { echo $(tput bold)$(tput setaf 2)${1}$(tput sgr0); }
redb() { echo $(tput bold)$(tput setaf 1)${1}$(tput sgr0); }
yellowb() { echo $(tput bold)$(tput setaf 3)${1}$(tput sgr0); }
pinkb() { echo $(tput bold)$(tput setaf 5)${1}$(tput sgr0); }
# Some nice variables
info="$(textb [INFO] -)"
warn="$(yellowb [WARN] -)"
error="$(redb [ERROR] -)"
fyi="$(pinkb [INFO] -)"
ok="$(greenb [OKAY] -)"
echo
echo "$(yellowb +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+)"
echo " $(textb Perfect) $(textb Rootserver) $(textb Update) $(textb by)" "$(cyan REtender / Shoujii)"
echo "$(yellowb +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+)"
echo
# ---------------------------------------------------------------------------------------- #
########################### READY TO GO?
# ---------------------------------------------------------------------------------------- #
if [ "$CONFIG_COMPLETED" != '1' ]; then
echo "${error} Please check the updateconfig and set a valid value for the variable \"$(textb CONFIG_COMPLETED)\" to continue." | awk '{ print strftime("[%H:%M:%S] |"), $0 }'
exit 1
fi
# ---------------------------------------------------------------------------------------- #
########################### ARE YOU Admin?
# ---------------------------------------------------------------------------------------- #
if [[ $EUID -ne 0 ]]; then
echo "This script must be run as root"
echo "${error} Update System" | awk '{ print strftime("[%H:%M:%S] |"), $0 }'
exit 1
fi
# ---------------------------------------------------------------------------------------- #
########################### SYSTEM UPDATE
# ---------------------------------------------------------------------------------------- #
if [ "$SYSTEM_UPDATE" = '1' ]; then
echo "${info} Update System" | awk '{ print strftime("[%H:%M:%S] |"), $0 }'
apt-get update -y >/dev/null 2>&1
apt-get upgrade -y >/dev/null 2>&1
echo "${ok} Complete without fail" | awk '{ print strftime("[%H:%M:%S] |"), $0 }'
fi
# ---------------------------------------------------------------------------------------- #
########################### Cert with mail UPDATE
# ---------------------------------------------------------------------------------------- #
if [ "$CERT_UPDATE_MAIL" = '1' ]; then
echo "${info} Update your SSL Certificate with Mailserver" | awk '{ print strftime("[%H:%M:%S] |"), $0 }'
systemctl -q stop nginx.service >/dev/null 2>&1
cd ~/sources/letsencrypt >/dev/null 2>&1
./letsencrypt-auto --agree-tos --renew-by-default --standalone --email ${MYEMAIL} --rsa-key-size 4096 -d ${MYDOMAIN} -d www.${MYDOMAIN} -d mail.${MYDOMAIN} -d autodiscover.${MYDOMAIN} -d autoconfig.${MYDOMAIN} -d dav.${MYDOMAIN} certonly >/dev/null 2>&1
echo "${ok} Complete without fail" | awk '{ print strftime("[%H:%M:%S] |"), $0 }'
fi
# ---------------------------------------------------------------------------------------- #
########################### Cert Without Mail UPDATE
# ---------------------------------------------------------------------------------------- #
if [ "$CERT_UPDATE" = '1' ]; then
echo "${info} Update your SSL Certificate" | awk '{ print strftime("[%H:%M:%S] |"), $0 }'
service stop nginx >/dev/null 2>&1
cd ~/sources/letsencrypt >/dev/null 2>&1
./letsencrypt-auto --agree-tos --renew-by-default --standalone --email ${MYEMAIL} --rsa-key-size 4096 -d ${MYDOMAIN} -d www.${MYDOMAIN} certonly >/dev/null 2>&1
systemctl -q start nginx.service >/dev/null 2>&1
echo "${ok} Complete without fail" | awk '{ print strftime("[%H:%M:%S] |"), $0 }'
fi
# ---------------------------------------------------------------------------------------- #
########################### UPDATE ROUNDCUBE
# ---------------------------------------------------------------------------------------- #
if [ "$ROUNDCUBE_UPDATE" = '1' ]; then
cd /root/ >/dev/null 2>&1
wget https://github.com/roundcube/roundcubemail/releases/download/${ROUNDCUBE_VERSION}/roundcubemail-${ROUNDCUBE_VERSION}-complete.tar.gz >/dev/null 2>&1
tar xfvz roundcubemail-${ROUNDCUBE_VERSION}-complete.tar.gz >/dev/null 2>&1
cd cd roundcubemail-${ROUNDCUBE_VERSION} >/dev/null 2>&1
bin/installto.sh /var/www/mail/rc >/dev/null 2>&1
rm /root/roundcubemail-${ROUNDCUBE_VERSION}/ -r >/dev/null 2>&1
rm /root/roundcubemail-${ROUNDCUBE_VERSION}-complete.tar.gz/ -r >/dev/null 2>&1
echo "${ok} Complete without fail" | awk '{ print strftime("[%H:%M:%S] |"), $0 }'
fi
# ---------------------------------------------------------------------------------------- #
########################### NGINX UPDATE
# ---------------------------------------------------------------------------------------- #
if [ "$NGINX_UPDATE" = '1' ]; then
echo "${info} Stop Nginx..." | awk '{ print strftime("[%H:%M:%S] |"), $0 }'
systemctl -q stop nginx.service
echo "${info} Backup Nginx Folder..." | awk '{ print strftime("[%H:%M:%S] |"), $0 }'
rm /root/backup/ -r >/dev/null 2>&1
mkdir /root/backup/ >/dev/null 2>&1
mkdir /root/backup/nginx/ >/dev/null 2>&1
cp -R /etc/nginx/* /root/backup/nginx/
echo "${ok} Complete for backup nginx" | awk '{ print strftime("[%H:%M:%S] |"), $0 }'
cd ~/sources
echo "${info} Downloading Nginx Pagespeed..." | awk '{ print strftime("[%H:%M:%S] |"), $0 }'
wget https://github.com/pagespeed/ngx_pagespeed/archive/release-${NPS_VERSION}-beta.zip >/dev/null 2>&1
unzip -qq release-${NPS_VERSION}-beta.zip
cd ngx_pagespeed-release-${NPS_VERSION}-beta/
wget https://dl.google.com/dl/page-speed/psol/${NPS_VERSION}.tar.gz >/dev/null 2>&1
tar -xzf ${NPS_VERSION}.tar.gz
echo "${ok} Complete pagespeed" | awk '{ print strftime("[%H:%M:%S] |"), $0 }'
cd ~/sources
echo "${info} Downloading Nginx..." | awk '{ print strftime("[%H:%M:%S] |"), $0 }'
wget http://nginx.org/download/nginx-${NGINX_VERSION}.tar.gz >/dev/null 2>&1
tar -xzf nginx-${NGINX_VERSION}.tar.gz
cd nginx-${NGINX_VERSION}
echo "${info} Compiling Nginx..." | awk '{ print strftime("[%H:%M:%S] |"), $0 }'
./configure --prefix=/etc/nginx \
--sbin-path=/usr/sbin/nginx \
--conf-path=/etc/nginx/nginx.conf \
--error-log-path=/var/log/nginx/error.log \
--http-log-path=/var/log/nginx/access.log \
--pid-path=/var/run/nginx.pid \
--lock-path=/var/run/nginx.lock \
--http-client-body-temp-path=/var/lib/nginx/body \
--http-proxy-temp-path=/var/lib/nginx/proxy \
--http-fastcgi-temp-path=/var/lib/nginx/fastcgi \
--http-uwsgi-temp-path=/var/lib/nginx/uwsgi \
--http-scgi-temp-path=/var/lib/nginx/scgi \
--user=www-data \
--group=www-data \
--without-http_autoindex_module \
--without-http_browser_module \
--without-http_empty_gif_module \
--without-http_userid_module \
--without-http_split_clients_module \
--with-http_ssl_module \
--with-http_v2_module \
--with-http_realip_module \
--with-http_geoip_module \
--with-http_addition_module \
--with-http_sub_module \
--with-http_dav_module \
--with-http_flv_module \
--with-http_mp4_module \
--with-http_gunzip_module \
--with-http_gzip_static_module \
--with-http_random_index_module \
--with-http_secure_link_module \
--with-http_stub_status_module \
--with-http_auth_request_module \
--with-mail \
--with-mail_ssl_module \
--with-file-aio \
--with-ipv6 \
--with-debug \
--with-pcre \
--with-cc-opt='-O2 -g -pipe -Wall -Wformat -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic' \
--with-openssl=$HOME/sources/openssl-${OPENSSL_VERSION} \
--add-module=$HOME/sources/ngx_pagespeed-release-${NPS_VERSION}-beta >/dev/null 2>&1
echo "${ok} Complete compile nginx" | awk '{ print strftime("[%H:%M:%S] |"), $0 }'
# make the package
make >/dev/null 2>&1
# Create a .deb package
checkinstall --install=no -y >/dev/null 2>&1
# Install the package
echo "${info} Installing Nginx..." | awk '{ print strftime("[%H:%M:%S] |"), $0 }'
dpkg -i nginx_${NGINX_VERSION}-1_amd64.deb >/dev/null 2>&1
mv nginx_${NGINX_VERSION}-1_amd64.deb ../
echo "${ok} Complete install nginx" | awk '{ print strftime("[%H:%M:%S] |"), $0 }'
echo "${info} Restore Nginx Folder..." | awk '{ print strftime("[%H:%M:%S] |"), $0 }'
cp -R /root/backup/nginx/* /etc/nginx/
echo "${ok} Complete restore nginx" | awk '{ print strftime("[%H:%M:%S] |"), $0 }'
echo "${info} Starting Nginx..." | awk '{ print strftime("[%H:%M:%S] |"), $0 }'
systemctl -q start nginx.service
echo "${info} Update finished..." | awk '{ print strftime("[%H:%M:%S] |"), $0 }'
echo "${ok} Complete without fail" | awk '{ print strftime("[%H:%M:%S] |"), $0 }'
fi
echo "${ok} All is done, bye dude!" | awk '{ print strftime("[%H:%M:%S] |"), $0 }'
|
|
|
08/22/2016, 17:50
|
#348
|
elite*gold: 0
Join Date: Jun 2010
Posts: 74
Received Thanks: 6
|
Quote:
Originally Posted by TakeThisBitch
@  , danke!
ich weiß nicht, ob ich es richtig gemacht habe bei Git. ich habe das Script mal erweitert, es kann jetzt insgesamt: - [NEU]SYSTEM UPDATE
- [NEU]Cert with mail UPDATE
- [NEU]Cert Without Mail UPDATE
- [NEU]UPDATE ROUNDCUBE
- UPDATE nginx
- UPDATE OPENSSL
- UPDATE NPS
|
Wow, auf den ersten Blick sieht das wirklich super aus!
Und ich finde es richtig toll das du dich dran gesetzt hast um die anderen Sachen zu implementieren!
Da ich gerade auf dem Sprung bin schaue ich es mir nachher genauer und und merge es dann bei Github, wenn es für dich okay ist?
|
|
|
08/22/2016, 17:51
|
#349
|
elite*gold: 0
Join Date: Jan 2015
Posts: 118
Received Thanks: 17
|
Klar, mach das. Es macht ja Spaß, aber ich war mir bei nginx so unsicher. Habe aber alles getestet und klappt auch.
Habe jetzt nochmal eine Abfrage einzeln für nginx update gemacht. so kann jemand dann auch nur die Zertifikate updaten bzw. man ist etwas flexibler. So wird es allgemeiner.
Ich versuch es bei Github wieder zu "forken" oder wie man das da nennt
So, hier mal eine neue Version:
update.sh
Code:
#!/bin/bash
# The perfect rootserver UPDATE
# by Shoujii
# https://github.com/mxiiii/perfect_update
# Based on https://github.com/zypr/perfectrootserver & https://github.com/mxiiii/perfect_update
# Thanks to Zypr and and mxiiii
# Compatible with Debian 8.x (jessie)
source ~/updateconfig.cfg
# Some nice colors
cyan() { echo "$(tput setaf 6)$*$(tput setaf 9)"; }
textb() { echo $(tput bold)${1}$(tput sgr0); }
greenb() { echo $(tput bold)$(tput setaf 2)${1}$(tput sgr0); }
redb() { echo $(tput bold)$(tput setaf 1)${1}$(tput sgr0); }
yellowb() { echo $(tput bold)$(tput setaf 3)${1}$(tput sgr0); }
pinkb() { echo $(tput bold)$(tput setaf 5)${1}$(tput sgr0); }
# Some nice variables
info="$(textb [INFO] -)"
warn="$(yellowb [WARN] -)"
error="$(redb [ERROR] -)"
fyi="$(pinkb [INFO] -)"
ok="$(greenb [OKAY] -)"
# let me, i need it to create backupfolder
date=$(date +%Y-%m-%d)
#echo $date
#mkdir /root/backup
#mkdir /root/backup/$date/
#exit 1
# ---------------------------------------------------------------------------------------- #
echo
echo "$(yellowb +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+)"
echo " $(textb Perfect) $(textb Rootserver) $(textb Update) $(textb by)" "$(cyan REtender / Shoujii)"
echo "$(yellowb +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+)"
echo
# ---------------------------------------------------------------------------------------- #
########################### READY TO GO?
# ---------------------------------------------------------------------------------------- #
if [ "$CONFIG_COMPLETED" != '1' ]; then
echo "${error} Please check the updateconfig and set a valid value for the variable \"$(textb CONFIG_COMPLETED)\" to continue." | awk '{ print strftime("[%H:%M:%S] |"), $0 }'
exit 1
fi
# ---------------------------------------------------------------------------------------- #
########################### ARE YOU Admin?
# ---------------------------------------------------------------------------------------- #
if [[ $EUID -ne 0 ]]; then
echo "${error} No root user? No update! | awk '{ print strftime("[%H:%M:%S] |"), $0 }'
exit 1
fi
# ---------------------------------------------------------------------------------------- #
########################### SYSTEM UPDATE
# ---------------------------------------------------------------------------------------- #
if [ "$SYSTEM_UPDATE" = '1' ]; then
echo "${info} Update System" | awk '{ print strftime("[%H:%M:%S] |"), $0 }'
apt-get update -y >/dev/null 2>&1
apt-get upgrade -y >/dev/null 2>&1
echo "${ok} Complete without fail : System Update" | awk '{ print strftime("[%H:%M:%S] |"), $0 }'
fi
# ---------------------------------------------------------------------------------------- #
########################### Cert with mail UPDATE
# ---------------------------------------------------------------------------------------- #
if [ "$CERT_UPDATE_MAIL" = '1' ]; then
echo "${info} Update your SSL Certificate with Mailserver" | awk '{ print strftime("[%H:%M:%S] |"), $0 }'
systemctl -q stop nginx.service >/dev/null 2>&1
cd ~/sources/letsencrypt >/dev/null 2>&1
./letsencrypt-auto --agree-tos --renew-by-default --standalone --email ${MYEMAIL} --rsa-key-size 4096 -d ${MYDOMAIN} -d www.${MYDOMAIN} -d mail.${MYDOMAIN} -d autodiscover.${MYDOMAIN} -d autoconfig.${MYDOMAIN} -d dav.${MYDOMAIN} certonly >/dev/null 2>&1
echo "${ok} Complete without fail : Update Certificate without mail Server" | awk '{ print strftime("[%H:%M:%S] |"), $0 }'
fi
# ---------------------------------------------------------------------------------------- #
########################### Cert Without Mail UPDATE
# ---------------------------------------------------------------------------------------- #
if [ "$CERT_UPDATE" = '1' ]; then
echo "${info} Update your SSL Certificate" | awk '{ print strftime("[%H:%M:%S] |"), $0 }'
service stop nginx >/dev/null 2>&1
cd ~/sources/letsencrypt >/dev/null 2>&1
./letsencrypt-auto --agree-tos --renew-by-default --standalone --email ${MYEMAIL} --rsa-key-size 4096 -d ${MYDOMAIN} -d www.${MYDOMAIN} certonly >/dev/null 2>&1
systemctl -q start nginx.service >/dev/null 2>&1
echo "${ok} Complete without fail : Update Certificate with mail Server" | awk '{ print strftime("[%H:%M:%S] |"), $0 }'
fi
# ---------------------------------------------------------------------------------------- #
########################### UPDATE ROUNDCUBE
# ---------------------------------------------------------------------------------------- #
if [ "$ROUNDCUBE_UPDATE" = '1' ]; then
echo "${info} Update Roundcube" | awk '{ print strftime("[%H:%M:%S] |"), $0 }'
cd /root/ >/dev/null 2>&1
wget https://github.com/roundcube/roundcubemail/releases/download/${ROUNDCUBE_VERSION}/roundcubemail-${ROUNDCUBE_VERSION}-complete.tar.gz >/dev/null 2>&1
tar xfvz roundcubemail-${ROUNDCUBE_VERSION}-complete.tar.gz >/dev/null 2>&1
cd roundcubemail-${ROUNDCUBE_VERSION} >/dev/null 2>&1
bin/installto.sh /var/www/mail/rc >/dev/null 2>&1
rm -r /root/roundcubemail-${ROUNDCUBE_VERSION}/ >/dev/null 2>&1
rm -f /root/roundcubemail-${ROUNDCUBE_VERSION}-complete.tar.gz/ >/dev/null 2>&1
echo "${ok} Complete without fail : Roundcube Update" | awk '{ print strftime("[%H:%M:%S] |"), $0 }'
fi
# ---------------------------------------------------------------------------------------- #
########################### NGINX UPDATE
# ---------------------------------------------------------------------------------------- #
if [ "$NGINX_UPDATE" = '1' ]; then
echo "${info} Stop Nginx..." | awk '{ print strftime("[%H:%M:%S] |"), $0 }'
systemctl -q stop nginx.service
echo "${info} Backup Nginx Folder..." | awk '{ print strftime("[%H:%M:%S] |"), $0 }'
mkdir /root/backup/ >/dev/null 2>&1
mkdir /root/backup/$date/ >/dev/null 2>&1
mkdir /root/backup/$date/nginx/ >/dev/null 2>&1
cp -R /etc/nginx/* /root/backup/$date/nginx/
echo "${ok} Complete for backup nginx" | awk '{ print strftime("[%H:%M:%S] |"), $0 }'
cd ~/sources
echo "${info} Downloading Nginx Pagespeed..." | awk '{ print strftime("[%H:%M:%S] |"), $0 }'
wget https://github.com/pagespeed/ngx_pagespeed/archive/release-${NPS_VERSION}-beta.zip >/dev/null 2>&1
unzip -qq release-${NPS_VERSION}-beta.zip
cd ngx_pagespeed-release-${NPS_VERSION}-beta/
wget https://dl.google.com/dl/page-speed/psol/${NPS_VERSION}.tar.gz >/dev/null 2>&1
tar -xzf ${NPS_VERSION}.tar.gz
echo "${ok} Complete pagespeed" | awk '{ print strftime("[%H:%M:%S] |"), $0 }'
cd ~/sources
echo "${info} Downloading Nginx..." | awk '{ print strftime("[%H:%M:%S] |"), $0 }'
wget http://nginx.org/download/nginx-${NGINX_VERSION}.tar.gz >/dev/null 2>&1
tar -xzf nginx-${NGINX_VERSION}.tar.gz
cd nginx-${NGINX_VERSION}
echo "${info} Compiling Nginx..." | awk '{ print strftime("[%H:%M:%S] |"), $0 }'
./configure --prefix=/etc/nginx \
--sbin-path=/usr/sbin/nginx \
--conf-path=/etc/nginx/nginx.conf \
--error-log-path=/var/log/nginx/error.log \
--http-log-path=/var/log/nginx/access.log \
--pid-path=/var/run/nginx.pid \
--lock-path=/var/run/nginx.lock \
--http-client-body-temp-path=/var/lib/nginx/body \
--http-proxy-temp-path=/var/lib/nginx/proxy \
--http-fastcgi-temp-path=/var/lib/nginx/fastcgi \
--http-uwsgi-temp-path=/var/lib/nginx/uwsgi \
--http-scgi-temp-path=/var/lib/nginx/scgi \
--user=www-data \
--group=www-data \
--without-http_autoindex_module \
--without-http_browser_module \
--without-http_empty_gif_module \
--without-http_userid_module \
--without-http_split_clients_module \
--with-http_ssl_module \
--with-http_v2_module \
--with-http_realip_module \
--with-http_geoip_module \
--with-http_addition_module \
--with-http_sub_module \
--with-http_dav_module \
--with-http_flv_module \
--with-http_mp4_module \
--with-http_gunzip_module \
--with-http_gzip_static_module \
--with-http_random_index_module \
--with-http_secure_link_module \
--with-http_stub_status_module \
--with-http_auth_request_module \
--with-mail \
--with-mail_ssl_module \
--with-file-aio \
--with-ipv6 \
--with-debug \
--with-pcre \
--with-cc-opt='-O2 -g -pipe -Wall -Wformat -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic' \
--with-openssl=$HOME/sources/openssl-${OPENSSL_VERSION} \
--add-module=$HOME/sources/ngx_pagespeed-release-${NPS_VERSION}-beta >/dev/null 2>&1
echo "${ok} Complete compile nginx" | awk '{ print strftime("[%H:%M:%S] |"), $0 }'
# make the package
make >/dev/null 2>&1
# Create a .deb package
checkinstall --install=no -y >/dev/null 2>&1
# Install the package
echo "${info} Installing Nginx..." | awk '{ print strftime("[%H:%M:%S] |"), $0 }'
dpkg -i nginx_${NGINX_VERSION}-1_amd64.deb >/dev/null 2>&1
mv nginx_${NGINX_VERSION}-1_amd64.deb ../
echo "${ok} Complete install nginx" | awk '{ print strftime("[%H:%M:%S] |"), $0 }'
echo "${info} Restore Nginx Folder..." | awk '{ print strftime("[%H:%M:%S] |"), $0 }'
cp -R /root/backup/$date/nginx/* /etc/nginx/
echo "${ok} Complete restore nginx" | awk '{ print strftime("[%H:%M:%S] |"), $0 }'
echo "${info} Starting Nginx..." | awk '{ print strftime("[%H:%M:%S] |"), $0 }'
systemctl -q start nginx.service
echo "${info} Update finished..." | awk '{ print strftime("[%H:%M:%S] |"), $0 }'
echo "${ok} Complete without fail" | awk '{ print strftime("[%H:%M:%S] |"), $0 }'
fi
echo "${ok} All is done, bye dude!" | awk '{ print strftime("[%H:%M:%S] |"), $0 }'
Fehler fixes
erstellt Backup-Ordner nach Datum, dafür $date erstellt
Er löscht jetzt den Backup Ordner nicht mehr, erstellt dafür einen Ordner mit aktuellen Datum. Speichert da alles rein und stellt es wieder her.
So würde man beim wiederholten starten des Scripts verschiedene Ordner mit Datum im Ordner "Backup" haben.
Alternativ kann man jetzt ja noch den Ordner in ein Archiv mit Datum hauen.
So behält man den Überblick. In die Config könnte jetzt noch ne Var für "only" update rein. Macht aber nur sinn, meine Meinung, wenn man auch Mysql sichert und das auch in den Ordner haut. Dann wäre es ein für mich vollwertiges Update Script.
Systeme + Daten
Muss jetzt aber los. Danke nochmal für deine Mühe, danke euch allen
|
|
|
08/22/2016, 22:47
|
#350
|
elite*gold: 0
Join Date: Jun 2010
Posts: 74
Received Thanks: 6
|
So, ich bin gerade erst nach Hause gekommen

die Beiden Patches 2 und 3 (update und updateconfig) habe ich gemerged.
Dann habe ich hier noch ein paar Änderungen die du hier gepostet hast übernommen (du kannst dir meine Beiden Commits anschauen), allerdings nicht alle, da ein paar Fehler sich eingeschlichen haben :P
Bei den Certs habe ich nochmal eine Fehlermeldung eingebaut, damit nicht beide auf 1 stehen können.
Gruß, Shoujii
PS: das mit dem Datum ist eine gute Idee, dass kommt Morgen dann mit rein, gerade bin ich zu müde dafür.
|
|
|
08/23/2016, 07:07
|
#351
|
elite*gold: 0
Join Date: Jan 2015
Posts: 118
Received Thanks: 17
|
eh, und ich habe verpennt und schaffe vor arbeit nix mehr
Danke für das Einfügen ins Update. Habe noch ein paar Ideen. Werde nach Arbeit bissien dran arbeiten. Dann dürfte auch alles dabei sein
Habe mal das mit dem Backup Ordner etwas umgestaltet:
Code:
#no delete /backup/ folder
if [ ! -d /root/backup/ ]; then
mkdir /root/backup/ >/dev/null 2>&1
fi
mkdir /root/backup/$date/ >/dev/null 2>&1
mkdir /root/backup/$date/nginx/ >/dev/null 2>&1
cp -R /etc/nginx/* /root/backup/$date/nginx/
Weniger Fehler, weniger Ärger. Naja habe es bei git mal kommentiert.
|
|
|
08/23/2016, 17:08
|
#352
|
elite*gold: 0
Join Date: Jun 2010
Posts: 74
Received Thanks: 6
|
Quote:
Originally Posted by TakeThisBitch
eh, und ich habe verpennt und schaffe vor arbeit nix mehr
Danke für das Einfügen ins Update. Habe noch ein paar Ideen. Werde nach Arbeit bissien dran arbeiten. Dann dürfte auch alles dabei sein
Habe mal das mit dem Backup Ordner etwas umgestaltet:
Code:
#no delete /backup/ folder
if [ ! -d /root/backup/ ]; then
mkdir /root/backup/ >/dev/null 2>&1
fi
mkdir /root/backup/$date/ >/dev/null 2>&1
mkdir /root/backup/$date/nginx/ >/dev/null 2>&1
cp -R /etc/nginx/* /root/backup/$date/nginx/
Weniger Fehler, weniger Ärger. Naja habe es bei git mal kommentiert. 
|
So alles direkt gemerged

Ich habe bei dem zurückspielen von Nginx auch mal $date eingefügt, sonst zieht er sich das nicht :P
Hats du einen Messenger wie Skype oder ähnliches?
Da kann man besser kommunizieren
|
|
|
08/29/2016, 05:38
|
#353
|
elite*gold: 0
Join Date: Feb 2011
Posts: 18
Received Thanks: 0
|
Moin,
erstmal dicken Respekt für Eure Arbeit! So stabil und schnell lief bisher keiner meiner Server.
Nur ein Problem habe ich derzeit.
Da ich keine Administrative Software wie Plesk oder dergleichen einsetzen möchte, muss ich alles von Hand erledigen. Und da liegt das Problem.
Auf dem Server liegt derzeit eine eine Domain. Funktioniert soweit auch.
Jetzt wollte ich zu dieser Domain noch ein Sub Domain anlegen, mit eigenem Verzeichnis und User.
Verzeichnis und User sind kein Problem. Nur die conf für die SubDomain will nginx einfach nicht schlucken.
Könnte mir da jemand bitte helfen?
VG
|
|
|
08/29/2016, 07:39
|
#354
|
elite*gold: 0
Join Date: Jan 2015
Posts: 118
Received Thanks: 17
|
Mh naja sie subdomain musst du ja nur in der sites-available anlegen. In der nginx.conf wird alles geladen was in dem sites-available Ordner liegt.
Außerdem musst oder solltest du die Zertifikate dazu anlegen bzw. Holen.
Wie sieht denn deine Konfiguration aus? Was gibt es denn für ein Fehler?
Gesendet von meinem C6903 mit Tapatalk
|
|
|
08/29/2016, 12:23
|
#355
|
elite*gold: 0
Join Date: Feb 2011
Posts: 18
Received Thanks: 0
|
Quote:
|
Außerdem musst oder solltest du die Zertifikate dazu anlegen bzw. Holen.
|
Denke das wird das Problem sein. Setze den Server gerade neu auf, da ich nen dummen Anfängerfehler gemacht hatte
Dabei is mir aber aufgefallen das die Version von shoujii (0.1.3.tar.gz), einen Fehler enthält.
Und zwar wird geprüft ob: KEY_COUNTRY KEY_PROVINCE KEY_CITY KEY_EMAIL ausgefüllt wurde. Dies ist aber in der config Datei ja nicht mehr vorhanden.
|
|
|
08/29/2016, 15:55
|
#356
|
elite*gold: 0
Join Date: Jun 2010
Posts: 74
Received Thanks: 6
|
Quote:
Originally Posted by _daniel4711
Denke das wird das Problem sein. Setze den Server gerade neu auf, da ich nen dummen Anfängerfehler gemacht hatte
Dabei is mir aber aufgefallen das die Version von shoujii (0.1.3.tar.gz), einen Fehler enthält.
Und zwar wird geprüft ob: KEY_COUNTRY KEY_PROVINCE KEY_CITY KEY_EMAIL ausgefüllt wurde. Dies ist aber in der config Datei ja nicht mehr vorhanden.
|
Die Openvpn Sachen hatte ich von der Master in die testing Branch verschoben um für die Zukunft stabile Releases anbieten zu können...
Da ist mir wohl noch etwas entgangen.
Ich schaue es mir gleich Zuhause an und stelle dann eine Version ohne Openvpn Reste bereit.
Sonst läuft ja alles
|
|
|
08/29/2016, 16:20
|
#357
|
elite*gold: 0
Join Date: Apr 2014
Posts: 83
Received Thanks: 4
|
@  ner
von der Mailcow  gibts übrigends auch quasi eine neue Version
|
|
|
08/29/2016, 16:45
|
#358
|
elite*gold: 0
Join Date: Jun 2010
Posts: 74
Received Thanks: 6
|
Quote:
Originally Posted by _daniel4711
Und zwar wird geprüft ob: KEY_COUNTRY KEY_PROVINCE KEY_CITY KEY_EMAIL ausgefüllt wurde. Dies ist aber in der config Datei ja nicht mehr vorhanden.
|
In der neuen Version 0.1.4 ist der Check entfernt!
Quote:
Originally Posted by TiggaStyle
@  ner
von der Mailcow  gibts übrigends auch quasi eine neue Version
|
Das können TakeThisBitch und ich uns die Tage mal anschauen, erstmal können wir euch die neue Version des Update Scriptes präsentieren:
The perfect rootserver update1.2.2
Man kann jetzt: - System updaten
- Nginx updaten
- NPS UPDATE
- Cert with mail UPDATE
- Cert Without Mail UPDATE
- [NEU] Roundcube updaten (gestern fertig geworden)
- [NEU] OPENSSH updaten
Danke an TakeThisBitch der auch sehr viel zu dem Update Script beisteuert!
|
|
|
08/29/2016, 17:33
|
#359
|
elite*gold: 0
Join Date: Feb 2011
Posts: 18
Received Thanks: 0
|
Läuft beides super!!!
Allerdings habe ich mit den Subdomains immer noch meine Probleme.
Neue Config wurde angelegt, Verzeichnis und User plus entsprechende Zertifikate. Aber er routet die Subdomain immer noch ins Verzeichnis der Hauptdomain und nimmt die neuen Zertifikate nicht an. Was dann atürlich zu einem Fehler führt. Als DNS Eintrag habe ich für die Sub einen A Rekord eintrag: ***.Domain.tld A IP Adresse sollte doch so richtig sein?
|
|
|
09/01/2016, 21:32
|
#360
|
elite*gold: 0
Join Date: Feb 2011
Posts: 18
Received Thanks: 0
|
erledigt
|
|
|
 |
|
Similar Threads
|
Der perfekte Rootserver (Nginx, SSL, Mailserver, Roundcube, phpMyAdmin, Firewall)
10/14/2016 - Tutorials - 379 Replies
Der perfekte Rootserver
Version 0.3.8
Was kann das Skript?:
Das Skript ist ein Allrounder und bietet eine Oneclick-Installation, die zahlreiche Systeme und Funktionen mit sich bringt. Es ist dafür gedacht einen frisch aufgesetzten Debian Jessie minimal Server in einen perfekten Rootserver zu verwandeln. Besonders für unerfahrene User ist das Skript bestens dafür geeignet, per "oneclick" eine sichere, perfomante und optimale Umgebung für seine Projekte zu schaffen. Die im Skript...
|
Der perfekte Rootserver by Zypr
12/14/2015 - Unix/Linux - 8 Replies
Hallo Community.
Ich habe ein Kleines Problem beim Installieren des Scriptes von Zypr.
Unzwar bekomme ich immer Fehler Meldungenen Während der Installation
| +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|
[Suche]Perfekte Serverfiles+Client für Rootserver
07/26/2011 - Metin2 Private Server - 9 Replies
Hey Leute,
Also ich suche für meinen Metin2-Rootserver gute Serverfiles+Client.
Sie sollten haben:
*Die neuen Waffen von SonyStyle
*Die neuen Rüsstungen von EYvil
*Reittiere (Egal ob alt oder neu)
*Maximal level: mindestens 120
*Es darf nichts verbuggt sein
Also das sollte in den Client+in den Serverfiles/Datenbank drinnen sein.
|
All times are GMT +1. The time now is 17:59.
|
|