elitepvpers

elitepvpers (https://www.elitepvpers.com/forum/)
-   Unix/Linux (https://www.elitepvpers.com/forum/unix-linux/)
-   -   Der perfekte Rootserver (Support Thread) (https://www.elitepvpers.com/forum/unix-linux/3955384-der-perfekte-rootserver-support-thread.html)

TakeThisBitch 08/13/2016 10:09

Und wie mach ich das? Ich habe auch versucht die commons zu löschen und neu zu installieren per apt-get install nginx aber das geht auch nicht

Gesendet von meinem C6903 mit Tapatalk

Achso und apt-get update -y && apt-get upgrade -y
Geht auch nicht, weil er ja nginx dann nicht mit updated

Gesendet von meinem C6903 mit Tapatalk

REtender 08/13/2016 11:39

Quote:

Originally Posted by REtender (Post 34976738)
Man könnte bestimmt den Update Script von mxiiii umschreiben
[Only registered and activated users can see links. Click Here To Register...]

Edit:

Ich habe die update_server.sh mal grob "entmüllt".
Es funktioniert so DEFINITIV NICHT! Es ist nur ein Ansatz falls wer basteln möchte.
Spoiler:
Code:

source ~/updateconfig.cfg

IPADR=$(ifconfig eth0 | awk -F ' *|:' '/inet /{print $4}')

# Some nice colors
red() { echo "$(tput setaf 1)$*$(tput setaf 9)"; }
green() { echo "$(tput setaf 2)$*$(tput setaf 9)"; }
yellow() { echo "$(tput setaf 3)$*$(tput setaf 9)"; }
magenta() { echo "$(tput setaf 5)$*$(tput setaf 9)"; }
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 MXIIII)"
echo "$(yellowb +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+)"
echo
if [ "$CONFIG_COMPLETED" != '1' ]; then
echo "${error} Please check the userconfig and set a valid value for the variable \"$(textb CONFIG_COMPLETED)\" to continue." | awk '{ print strftime("[%H:%M:%S] |"), $0 }'
exit 1
fi

echo "${info} Backup..."
rm /root/backup/ -r >/dev/null 2>&1
mkdir /root/backup/nginx >/dev/null 2>&1
cp -R /etc/nginx/* /root/backup/nginx

echo "${info} Install..."
echo
echo "$(yellowb +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+)"
echo " $(textb Perfect) $(textb Rootserver) $(textb Update) $(textb by)" "$(cyan MXIIII)"
echo "$(yellowb +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+)"
echo
echo "${info} Backup..."
echo "${info} Install..."
echo "${info} NGINX Update..."
echo "${warn} Some of the tasks could take a long time, please be patient!"
service nginx stop

cd ~/sources
echo "${info} Downloading Nginx..."
wget -nc http://nginx.org/download/nginx-${NGINX_VERSION}.tar.gz >/dev/null 2>&1
tar -xzf nginx-${NGINX_VERSION}.tar.gz
cd nginx-${NGINX_VERSION}

./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 "${info} NGINX Install..."
make >/dev/null 2>&1

checkinstall --install=no -y >/dev/null 2>&1

dpkg -i nginx_${NGINX_VERSION}-1_amd64.deb >/dev/null 2>&1

mv nginx_${NGINX_VERSION}-1_amd64.deb ../
cp -R /root/backup/nginx/* /etc/nginx/

cat > /etc/nginx/sites-available/autodiscover.${MYDOMAIN}.conf <<END
 server {
                        listen 80;
                        server_name autodiscover.${MYDOMAIN} autoconfig.${MYDOMAIN};
                        return 301 https://autodiscover.${MYDOMAIN}\$request_uri;
 }
 
 server {
                        listen 443 ssl http2;
                        server_name autodiscover.${MYDOMAIN} autoconfig.${MYDOMAIN};
 
                        root /var/www/zpush;
                        index index.php;
                        charset utf-8;
 
                        error_page 404 /index.php;
 
                        ssl_certificate        ssl/${MYDOMAIN}.pem;
                        ssl_certificate_key ssl/${MYDOMAIN}.key;
                        #ssl_trusted_certificate ssl/${MYDOMAIN}.pem;
                        ssl_dhparam                    ssl/dh.pem;
                        #ssl_ecdh_curve                secp384r1;
                        ssl_session_cache  shared:SSL:10m;
                        ssl_session_timeout 10m;
                        ssl_session_tickets off;
                        ssl_protocols      TLSv1 TLSv1.1 TLSv1.2;
                        ssl_prefer_server_ciphers on;
                        ssl_buffer_size        1400;
 
                        #ssl_stapling                on;
                        #ssl_stapling_verify on;
                        #resolver                        8.8.8.8 8.8.4.4 208.67.222.222 208.67.220.220 valid=60s;
                        #resolver_timeout        2s;
 
                        ssl_ciphers                "ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-AES256-GCM-SHA384:DHE-RSA-AES128-GCM-SHA256:DHE-DSS-AES128-GCM-SHA256:kEDH+AESGCM:ECDHE-RSA-AES128-SHA256:ECDHE-ECDSA-AES128-SHA256:ECDHE-RSA-AES128-SHA:ECDHE-ECDSA-AES128-SHA:ECDHE-RSA-AES256-SHA384:ECDHE-ECDSA-AES256-SHA384:ECDHE-RSA-AES256-SHA:ECDHE-ECDSA-AES256-SHA:DHE-RSA-AES128-SHA256:DHE-RSA-AES128-SHA:DHE-DSS-AES128-SHA256:DHE-RSA-AES256-SHA256:DHE-DSS-AES256-SHA:DHE-RSA-AES256-SHA:!aNULL:!eNULL:!EXPORT:!DES:!RC4:!3DES:!MD5:!PSK";
 
                        #add_header                Strict-Transport-Security "max-age=63072000; includeSubdomains; preload";
                        #add_header                Public-Key-Pins 'pin-sha256="${HPKP1}"; pin-sha256="${HPKP2}"; max-age=5184000; includeSubDomains';
                        add_header                        Cache-Control "public";
                        add_header                        X-Frame-Options SAMEORIGIN;
                        add_header                        Alternate-Protocol  443:npn-http/2;
                        add_header                        X-Content-Type-Options nosniff;
                        add_header                        X-XSS-Protection "1; mode=block";
                        add_header                        X-Permitted-Cross-Domain-Policies "master-only";
                        add_header                        "X-UA-Compatible" "IE=Edge";
                        add_header                        "Access-Control-Allow-Origin" "*";
                        add_header                        Content-Security-Policy "script-src 'self' 'unsafe-inline' 'unsafe-eval' *.youtube.com maps.gstatic.com *.googleapis.com *.google-analytics.com cdnjs.cloudflare.com assets.zendesk.com connect.facebook.net; frame-src 'self' *.youtube.com assets.zendesk.com *.facebook.com s-static.ak.facebook.com tautt.zendesk.com; object-src 'self'";
 
                        auth_basic_user_file htpasswd/.htpasswd;
 
                        location ~ ^(.+\.php)(.*)\$ {
                                fastcgi_split_path_info ^(.+\.php)(/.+)\$;
                                try_files \$fastcgi_script_name =404;
                                set \$path_info \$fastcgi_path_info;
                                fastcgi_param PATH_INFO \$path_info;
                                fastcgi_param APP_ENV production;
                                fastcgi_pass unix:/var/run/php5-fpm.sock;
                                fastcgi_index index.php;
                                include fastcgi.conf;
                                fastcgi_intercept_errors on;
                                fastcgi_ignore_client_abort off;
                                fastcgi_buffers 256 16k;
                                fastcgi_buffer_size 128k;
                                fastcgi_connect_timeout 3s;
                                fastcgi_send_timeout 120s;
                                fastcgi_read_timeout 120s;
                                fastcgi_busy_buffers_size 256k;
                                fastcgi_temp_file_write_size 256k;
                        }
 
                        rewrite (?i)^/autodiscover/autodiscover\.xml\$ /autodiscover/autodiscover.php;
 
                        location / {
                                try_files \$uri \$uri/ /index.php;
                        }
 
                        location /Microsoft-Server-ActiveSync {
                    rewrite ^(.*)\$  /index.php last;
                }
 
                        location ~ /(\.ht|Core|Specific) {
                deny all;
                return 404;
                }
 
                        location = /favicon.ico {
                                access_log off;
                                log_not_found off;
                        }
                               
                        location = /robots.txt {
                                allow all;
                                access_log off;
                                log_not_found off;
                        }
 
                        location ~* ^.+\.(css|js)\$ {
                                rewrite ^(.+)\.(\d+)\.(css|js)\$ \$1.\$3 last;
                                expires 30d;
                                access_log off;
                                log_not_found off;
                                add_header Pragma public;
                                add_header Cache-Control "max-age=2592000, public";
                        }
 
                        location ~* \.(asf|asx|wax|wmv|wmx|avi|bmp|class|divx|doc|docx|eot|exe|gif|gz|gzip|ico|jpg|jpeg|jpe|mdb|mid|midi|mov|qt|mp3|m4a|mp4|m4v|mpeg|mpg|mpe|mpp|odb|odc|odf|odg|odp|ods|odt|ogg|ogv|otf|pdf|png|pot|pps|ppt|pptx|ra|ram|svg|svgz|swf|tar|t?gz|tif|tiff|ttf|wav|webm|wma|woff|wri|xla|xls|xlsx|xlt|xlw|zip)\$ {
                                expires 30d;
                                access_log off;
                                log_not_found off;
                                add_header Pragma public;
                                add_header Cache-Control "max-age=2592000, public";
                        }
 
                        if (\$http_user_agent ~* "FeedDemon|JikeSpider|Indy Library|Alexa Toolbar|AskTbFXTV|AhrefsBot|CrawlDaddy|CoolpadWebkit|Java|Feedly|UniversalFeedParser|ApacheBench|Microsoft URL Control|Swiftbot|ZmEu|oBot|jaunty|Python-urllib|lightDeckReports Bot|YYSpider|DigExt|YisouSpider|HttpClient|MJ12bot|heritrix|EasouSpider|Ezooms|Scrapy") {
                    return 403;
            }
 
 }
END

cat > /etc/nginx/sites-available/dav.${MYDOMAIN}.conf <<END
 server {
                        listen 80;
                        server_name dav.${MYDOMAIN};
                        return 301 https://dav.${MYDOMAIN}\$request_uri;
 }
 
 server {
                        listen 443 ssl http2;
                        server_name dav.${MYDOMAIN};
 
                        root /var/www/dav;
                        index server.php;
                        charset utf-8;
 
                        error_page 404 /index.php;
 
                        ssl_certificate        ssl/${MYDOMAIN}.pem;
                        ssl_certificate_key ssl/${MYDOMAIN}.key;
                        #ssl_trusted_certificate ssl/${MYDOMAIN}.pem;
                        ssl_dhparam                    ssl/dh.pem;
                        #ssl_ecdh_curve                secp384r1;
                        ssl_session_cache  shared:SSL:10m;
                        ssl_session_timeout 10m;
                        ssl_session_tickets off;
                        ssl_protocols      TLSv1 TLSv1.1 TLSv1.2;
                        ssl_prefer_server_ciphers on;
                        ssl_buffer_size        1400;
 
                        #ssl_stapling                on;
                        #ssl_stapling_verify on;
                        #resolver                        8.8.8.8 8.8.4.4 208.67.222.222 208.67.220.220 valid=60s;
                        #resolver_timeout        2s;
 
                        ssl_ciphers                "ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-AES256-GCM-SHA384:DHE-RSA-AES128-GCM-SHA256:DHE-DSS-AES128-GCM-SHA256:kEDH+AESGCM:ECDHE-RSA-AES128-SHA256:ECDHE-ECDSA-AES128-SHA256:ECDHE-RSA-AES128-SHA:ECDHE-ECDSA-AES128-SHA:ECDHE-RSA-AES256-SHA384:ECDHE-ECDSA-AES256-SHA384:ECDHE-RSA-AES256-SHA:ECDHE-ECDSA-AES256-SHA:DHE-RSA-AES128-SHA256:DHE-RSA-AES128-SHA:DHE-DSS-AES128-SHA256:DHE-RSA-AES256-SHA256:DHE-DSS-AES256-SHA:DHE-RSA-AES256-SHA:!aNULL:!eNULL:!EXPORT:!DES:!RC4:!3DES:!MD5:!PSK";
 
                        #add_header                Strict-Transport-Security "max-age=63072000; includeSubdomains; preload";
                        #add_header                Public-Key-Pins 'pin-sha256="${HPKP1}"; pin-sha256="${HPKP2}"; max-age=5184000; includeSubDomains';
                        add_header                        Cache-Control "public";
                        add_header                        X-Frame-Options SAMEORIGIN;
                        add_header                        Alternate-Protocol  443:npn-http/2;
                        add_header                        X-Content-Type-Options nosniff;
                        add_header                        X-XSS-Protection "1; mode=block";
                        add_header                        X-Permitted-Cross-Domain-Policies "master-only";
                        add_header                        "X-UA-Compatible" "IE=Edge";
                        add_header                        "Access-Control-Allow-Origin" "*";
                        add_header                        Content-Security-Policy "script-src 'self' 'unsafe-inline' 'unsafe-eval' *.youtube.com maps.gstatic.com *.googleapis.com *.google-analytics.com cdnjs.cloudflare.com assets.zendesk.com connect.facebook.net; frame-src 'self' *.youtube.com assets.zendesk.com *.facebook.com s-static.ak.facebook.com tautt.zendesk.com; object-src 'self'";
                       
                        auth_basic_user_file htpasswd/.htpasswd;
 
                        location ~ ^(.+\.php)(.*)\$ {
                                fastcgi_split_path_info ^(.+\.php)(/.+)\$;
                                try_files \$fastcgi_script_name =404;
                                set \$path_info \$fastcgi_path_info;
                                fastcgi_param PATH_INFO \$path_info;
                                fastcgi_param APP_ENV production;
                                fastcgi_pass unix:/var/run/php5-fpm.sock;
                                fastcgi_index index.php;
                                include fastcgi.conf;
                                fastcgi_intercept_errors on;
                                fastcgi_ignore_client_abort off;
                                fastcgi_buffers 256 16k;
                                fastcgi_buffer_size 128k;
                                fastcgi_connect_timeout 3s;
                                fastcgi_send_timeout 120s;
                                fastcgi_read_timeout 120s;
                                fastcgi_busy_buffers_size 256k;
                                fastcgi_temp_file_write_size 256k;
                        }
 
                        rewrite ^/.well-known/caldav /server.php redirect;
                        rewrite ^/.well-known/carddav /server.php redirect;
 
                        location / {
                                try_files \$uri \$uri/ /server.php?\$args;
                        }
 
                        location ~ /(\.ht|Core|Specific) {
                deny all;
                return 404;
                }
 
                        location = /favicon.ico {
                                access_log off;
                                log_not_found off;
                        }
                               
                        location = /robots.txt {
                                allow all;
                                access_log off;
                                log_not_found off;
                        }
 
                        location ~* ^.+\.(css|js)\$ {
                                rewrite ^(.+)\.(\d+)\.(css|js)\$ \$1.\$3 last;
                                expires 30d;
                                access_log off;
                                log_not_found off;
                                add_header Pragma public;
                                add_header Cache-Control "max-age=2592000, public";
                        }
 
                        location ~* \.(asf|asx|wax|wmv|wmx|avi|bmp|class|divx|doc|docx|eot|exe|gif|gz|gzip|ico|jpg|jpeg|jpe|mdb|mid|midi|mov|qt|mp3|m4a|mp4|m4v|mpeg|mpg|mpe|mpp|odb|odc|odf|odg|odp|ods|odt|ogg|ogv|otf|pdf|png|pot|pps|ppt|pptx|ra|ram|svg|svgz|swf|tar|t?gz|tif|tiff|ttf|wav|webm|wma|woff|wri|xla|xls|xlsx|xlt|xlw|zip)\$ {
                                expires 30d;
                                access_log off;
                                log_not_found off;
                                add_header Pragma public;
                                add_header Cache-Control "max-age=2592000, public";
                        }
 
                        if (\$http_user_agent ~* "FeedDemon|JikeSpider|Indy Library|Alexa Toolbar|AskTbFXTV|AhrefsBot|CrawlDaddy|CoolpadWebkit|Java|Feedly|UniversalFeedParser|ApacheBench|Microsoft URL Control|Swiftbot|ZmEu|oBot|jaunty|Python-urllib|lightDeckReports Bot|YYSpider|DigExt|YisouSpider|HttpClient|MJ12bot|heritrix|EasouSpider|Ezooms|Scrapy") {
                    return 403;
            }
 }
END

cat > /etc/nginx/sites-available/${MYDOMAIN}.conf <<END
 server {
                        listen                                80 default_server;
                        server_name                ${IPADR} ${MYDOMAIN};
                        return 301                        https://${MYDOMAIN}\$request_uri;
 }
 
 server {
                        listen                                443;
                        server_name                ${IPADR} www.${MYDOMAIN} mail.${MYDOMAIN};
                        return 301                        https://${MYDOMAIN}\$request_uri;
 }
 
 server {
                        listen                                443 ssl http2 default deferred;
                        server_name                ${MYDOMAIN};
 
                        root                                /etc/nginx/html;
                        index                                index.php index.html index.htm;
 
                        charset                        utf-8;
 
                        error_page 404                /index.php;
 
                        ssl_certificate        ssl/${MYDOMAIN}.pem;
                        ssl_certificate_key ssl/${MYDOMAIN}.key;
                        #ssl_trusted_certificate ssl/${MYDOMAIN}.pem;
                        ssl_dhparam                    ssl/dh.pem;
                        #ssl_ecdh_curve                secp384r1;
                        ssl_session_cache  shared:SSL:10m;
                        ssl_session_timeout 10m;
                        ssl_session_tickets off;
                        ssl_protocols      TLSv1 TLSv1.1 TLSv1.2;
                        ssl_prefer_server_ciphers on;
                        ssl_buffer_size        1400;
 
                        #ssl_stapling                on;
                        #ssl_stapling_verify on;
                        #resolver                        8.8.8.8 8.8.4.4 208.67.222.222 208.67.220.220 valid=60s;
                        #resolver_timeout        2s;
 
                        ssl_ciphers                "ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-AES256-GCM-SHA384:DHE-RSA-AES128-GCM-SHA256:DHE-DSS-AES128-GCM-SHA256:kEDH+AESGCM:ECDHE-RSA-AES128-SHA256:ECDHE-ECDSA-AES128-SHA256:ECDHE-RSA-AES128-SHA:ECDHE-ECDSA-AES128-SHA:ECDHE-RSA-AES256-SHA384:ECDHE-ECDSA-AES256-SHA384:ECDHE-RSA-AES256-SHA:ECDHE-ECDSA-AES256-SHA:DHE-RSA-AES128-SHA256:DHE-RSA-AES128-SHA:DHE-DSS-AES128-SHA256:DHE-RSA-AES256-SHA256:DHE-DSS-AES256-SHA:DHE-RSA-AES256-SHA:!aNULL:!eNULL:!EXPORT:!DES:!RC4:!3DES:!MD5:!PSK";
 
                        #add_header                Strict-Transport-Security "max-age=63072000; includeSubdomains; preload";
                        #add_header                Public-Key-Pins 'pin-sha256="${HPKP1}"; pin-sha256="${HPKP2}"; max-age=5184000; includeSubDomains';
                        add_header                        Cache-Control "public";
                        add_header                        X-Frame-Options SAMEORIGIN;
                        add_header                        Alternate-Protocol  443:npn-http/2;
                        add_header                        X-Content-Type-Options nosniff;
                        add_header                        X-XSS-Protection "1; mode=block";
                        add_header                        X-Permitted-Cross-Domain-Policies "master-only";
                        add_header                        "X-UA-Compatible" "IE=Edge";
                        add_header                        "Access-Control-Allow-Origin" "*";
                        add_header                        Content-Security-Policy "script-src 'self' 'unsafe-inline' 'unsafe-eval' *.youtube.com maps.gstatic.com *.googleapis.com *.google-analytics.com cdnjs.cloudflare.com assets.zendesk.com connect.facebook.net; frame-src 'self' *.youtube.com assets.zendesk.com *.facebook.com s-static.ak.facebook.com tautt.zendesk.com; object-src 'self'";
 
                        pagespeed                        on;
                        pagespeed                        EnableFilters collapse_whitespace;
                        pagespeed                        EnableFilters canonicalize_javascript_libraries;
                        pagespeed                        EnableFilters combine_css;
                        pagespeed                        EnableFilters combine_javascript;
                        pagespeed                        EnableFilters elide_attributes;
                        pagespeed                        EnableFilters extend_cache;
                        pagespeed                        EnableFilters flatten_css_imports;
                        pagespeed                        EnableFilters lazyload_images;
                        pagespeed                        EnableFilters rewrite_javascript;
                        pagespeed                        EnableFilters rewrite_images;
                        pagespeed                        EnableFilters insert_dns_prefetch;
                        pagespeed                        EnableFilters prioritize_critical_css;
 
                        pagespeed                        FetchHttps enable,allow_self_signed;
                        pagespeed                        FileCachePath /var/lib/nginx/nps_cache;
                        pagespeed                        RewriteLevel CoreFilters;
                        pagespeed                        CssFlattenMaxBytes 5120;
                        pagespeed                        LogDir /var/log/pagespeed;
                        pagespeed                        EnableCachePurge on;
                        pagespeed                        PurgeMethod PURGE;
                        pagespeed                        DownstreamCachePurgeMethod PURGE;
                        pagespeed                        DownstreamCachePurgeLocationPrefix http://127.0.0.1:80/;
                        pagespeed                        DownstreamCacheRewrittenPercentageThreshold 95;
                        pagespeed                        LazyloadImagesAfterOnload on;
                        pagespeed                        LazyloadImagesBlankUrl "data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7";
 
                        pagespeed                        MemcachedThreads 1;
                        pagespeed                        MemcachedServers "localhost:11211";
                        pagespeed                        MemcachedTimeoutUs 100000;
                        pagespeed                        RespectVary on;
 
                        pagespeed                        Disallow "*/pma/*";
 
                        # This will correctly rewrite your subresources with https:// URLs and thus avoid mixed content warnings.
                        # Note, that you should only enable this option if you are behind a load-balancer that will set this header,
                        # otherwise your users will be able to set the protocol PageSpeed uses to interpret the request.
                        #
                        #pagespeed                        RespectXForwardedProto on;
 
                        auth_basic_user_file htpasswd/.htpasswd;
 
                        location ~ \.php\$ {
                                fastcgi_split_path_info ^(.+\.php)(/.+)\$;
                                try_files \$fastcgi_script_name =404;
                                fastcgi_param PATH_INFO \$fastcgi_path_info;
                                fastcgi_param PATH_TRANSLATED \$document_root\$fastcgi_path_info;
                                fastcgi_param APP_ENV production;
                                fastcgi_pass unix:/var/run/php5-fpm.sock;
                                fastcgi_index index.php;
                                include fastcgi.conf;
                                fastcgi_intercept_errors off;
                                fastcgi_ignore_client_abort off;
                                fastcgi_buffers 256 16k;
                                fastcgi_buffer_size 128k;
                                fastcgi_connect_timeout 3s;
                                fastcgi_send_timeout 120s;
                                fastcgi_read_timeout 120s;
                                fastcgi_busy_buffers_size 256k;
                                fastcgi_temp_file_write_size 256k;
                        }
 
                        include /etc/nginx/sites-custom/*.conf;
 
                        location / {
                                    include /etc/nginx/naxsi.rules;
 
                                    # Uncomment, if you need to remove index.php from the
                                # URL. Usefull if you use Codeigniter, Zendframework, etc.
                                # or just need to remove the index.php
                                #
                                    #try_files \$uri \$uri/ /index.php?\$args;
                        }
 
                        location ~* /\.(?!well-known\/) {
                            deny all;
                            access_log off;
                                log_not_found off;
                        }
 
                        location ~* (?:\.(?:bak|conf|dist|fla|in[ci]|log|psd|sh|sql|sw[op])|~)$ {
                            deny all;
                            access_log off;
                                log_not_found off;
                        }
 
                        location = /favicon.ico {
                                access_log off;
                                log_not_found off;
                        }
                               
                        location = /robots.txt {
                                allow all;
                                access_log off;
                                log_not_found off;
                        }
 
                        location ~* ^.+\.(css|js)\$ {
                                rewrite ^(.+)\.(\d+)\.(css|js)\$ \$1.\$3 last;
                                expires 30d;
                                access_log off;
                                log_not_found off;
                                add_header Pragma public;
                                add_header Cache-Control "max-age=2592000, public";
                        }
 
                        location ~* \.(asf|asx|wax|wmv|wmx|avi|bmp|class|divx|doc|docx|eot|exe|gif|gz|gzip|ico|jpg|jpeg|jpe|mdb|mid|midi|mov|qt|mp3|m4a|mp4|m4v|mpeg|mpg|mpe|mpp|odb|odc|odf|odg|odp|ods|odt|ogg|ogv|otf|pdf|png|pot|pps|ppt|pptx|ra|ram|svg|svgz|swf|tar|t?gz|tif|tiff|ttf|wav|webm|wma|woff|wri|xla|xls|xlsx|xlt|xlw|zip)\$ {
                                expires 30d;
                                access_log off;
                                log_not_found off;
                                add_header Pragma public;
                                add_header Cache-Control "max-age=2592000, public";
                        }
 
                        if (\$http_user_agent ~* "FeedDemon|JikeSpider|Indy Library|Alexa Toolbar|AskTbFXTV|AhrefsBot|CrawlDaddy|CoolpadWebkit|Java|Feedly|UniversalFeedParser|ApacheBench|Microsoft URL Control|Swiftbot|ZmEu|oBot|jaunty|Python-urllib|lightDeckReports Bot|YYSpider|DigExt|YisouSpider|HttpClient|MJ12bot|heritrix|EasouSpider|Ezooms|Scrapy") {
                    return 403;
            }
 }
END
service nginx start


Der Weg von mxiii ist der richtige denke ich mal :)
Nginx Ordner sichern, Nginx downloaden, compilen, installieren und den Ordner zurück spielen.

Es müsste sich halt nur wer die Arbeit machen den Script wieder lauffähig zu machen^^

TakeThisBitch 08/14/2016 16:45

Naja, @[Only registered and activated users can see links. Click Here To Register...]tyle z.B. hat ja schon updates gemacht.

Ich habe es jetzt wirklich oft versucht aber es hat einfach nicht klappt.

Im Zweifel muss ich eben alles Platt machen und Komplett neu installieren.

Vorher: Welchen nginx order soll ich denn sichern? Den gesamten inkl aller Webseiten?
Also alles in /etc/nginx/ ?

Was updatet er denn dann, wenn ich das alles unberührt lasse.

minecraftreflex 08/14/2016 17:18

Anybody in here has some knowledge about hosting csgo servers on dedicated servers? - Just wanna know how many resources/power they need n all.

TakeThisBitch 08/14/2016 17:34

3 years ago I have a CS: go server hosted with this
[Only registered and activated users can see links. Click Here To Register...]

That worked well.

minecraftreflex 08/14/2016 18:20

Quote:

Originally Posted by TakeThisBitch (Post 35009535)
3 years ago I have a CS: go server hosted with this
[Only registered and activated users can see links. Click Here To Register...]

That worked well.

You hosted just 1 server on that machine?

TakeThisBitch 08/14/2016 18:39

one public server one private server 2 ts server 1 website

minecraftreflex 08/14/2016 19:34

Quote:

Originally Posted by TakeThisBitch (Post 35009942)
one public server one private server 2 ts server 1 website

Ah fair enough - Well I'll go for a couple csgo servers which are meant for private matches. Thanks tho!

TiggaStyle 08/15/2016 08:37

das mit den Blocked hosts macht Zypr's script doch automatisch, blocked-hosts

TakeThisBitch 08/15/2016 10:21

das ging recht schnell. Konnte da keine Probleme feststellen. Komisch ist es.

Delinquenz 08/15/2016 15:46

Quote:

You hosted just 1 server on that machine?
It isn't a dedicated server, even if it looks like that. Netcup is really confusing regarding this matter.

TakeThisBitch 08/15/2016 21:45

if you want a much more powerful machine you can use [Only registered and activated users can see links. Click Here To Register...]

TiggaStyle 08/16/2016 10:19

real dedi, is mutch cheaper @ ovh ... or server4you
@[Only registered and activated users can see links. Click Here To Register...]
hast du denn eine SSD oder mit SATA? Ich hab das Gefühl das liegt an der SATA Platte, dass es solang dauert, bei ovh mit meinen SSD geht das auch rucki zucki. Nur bei netcup mit der sata Platte dauert das 6 Minuten. Naja ich mach nun nen force-reload dann lädt der nur den blocked-hosts Datei neu ein. Das geht schneller.

TakeThisBitch 08/16/2016 10:27

yes, OHV is also a very good provider !
@[Only registered and activated users can see links. Click Here To Register...], ja ich habe eine SSD genommen. Ich brauch ja nicht so viel Speicherplatz.

Hauptsache es läuft schnell. Aber eig. sollte es auch mit der SATA nicht so lange dauern oder?

TiggaStyle 08/16/2016 10:29

@[Only registered and activated users can see links. Click Here To Register...]
der Meinung bin ich auch, dass es nicht 6 Minuten dauern sollte.
Der Server ist dabei ausgelastet, sogar kurzzeitig nicht erreichbar.
und dabei hab ich schon extra den RS 3000 SAS G7 genommen.

TakeThisBitch 08/16/2016 10:36

Mh das ist aber wirklich merkwürdig.

An der Hardware kann es eig. nicht liegen. Die ist Potent genug. Das die Fstplatte aber so langsam ist, erschreckt mich schon ein wenig. Aber was anderes bleibt nicht.

Kannst ja mal den Support anschreiben. die sind immer recht schnell. Entweder machst du ne SSD draus, falls du nicht die ganzen 490 GB brauchst oder die haben tatsächlich nen Fehler in der Konfig.

TiggaStyle 08/16/2016 10:50

Ja im Forum hat mir auch keiner geholfen. Naja

Ja wollte ne Cloud drauf machen, und da brauche ich schon mehr als 90 gb platz, daher SAS Platte.

mxpr 08/18/2016 14:13

Hab neulich eine E-Mail bekommen ich soll doch alle Zertifikate erneuern, wie?

Your certificate (or certificates) for the names listed below will expire in 19 days (on 02 Sep 16 13:11 +0000). Please make sure to renew your certificate before then, or visitors to your website will encounter errors.

TiggaStyle 08/18/2016 14:24

cd ~/sources/letsencrypt
./letsencrypt-auto --renew

mxpr 08/18/2016 14:39

Quote:

Originally Posted by TiggaStyle (Post 35029163)
cd ~/sources/letsencrypt
./letsencrypt-auto --renew


Upgrading certbot-auto 0.8.0 to 0.8.1...
Replacing certbot-auto...
Creating virtual environment...
Installing Python packages...
Installation succeeded.
usage:
letsencrypt-auto [SUBCOMMAND] [options] [-d domain] [-d domain] ...

Certbot can obtain and install HTTPS/TLS/SSL certificates. By default,
it will attempt to use a webserver both for obtaining and installing the
cert. Major SUBCOMMANDS are:

(default) run Obtain & install a cert in your current webserver
certonly Obtain cert, but do not install it (aka "auth")
install Install a previously obtained cert in a server
renew Renew previously obtained certs that are near expiry
revoke Revoke a previously obtained certificate
register Perform tasks related to registering with the CA
rollback Rollback server configuration changes made during install
config_changes Show changes made to server config during installation
plugins Display information about installed plugins
letsencrypt: error: ambiguous option: --renew could match --renew-by-default, --renew-hook

TiggaStyle 08/18/2016 14:43

dann vllt nur ./letsencrypt-auto renew

TakeThisBitch 08/18/2016 14:49

Code:

service nginx stop
cd /root/sources/letsencrypt

Wenn der Mailserver genutzt wird:
./letsencrypt-auto --agree-tos --renew-by-default --email [Only registered and activated users can see links. Click Here To Register...] --rsa-key-size 4096 -d deinedomain.tld -d www.deinedomain.tld -d mail.deinedomain.tld -d autodiscover.deinedomain.tld -d autoconfig.deinedomain.tld -d dav.deinedomain.tld certonly

Wenn der Mailserver nicht genutzt wird:
./letsencrypt-auto --agree-tos --renew-by-default --email [Only registered and activated users can see links. Click Here To Register...] --rsa-key-size 4096 -d deinedomain.tld -d www.deinedomain.tld certonly

Punkt 2 Wählen, Standalone

service nginx start


REtender 08/21/2016 12:42

Hat wer den VPS SSD 1 bei OVH und weiß ob das Script da einwandfrei läuft?

Meine Spielwiese bei Netcup ist abgelaufen und daher brauche ich einen neuen möglichst günstigen Server zum testen.

TakeThisBitch 08/21/2016 13:09

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

TiggaStyle 08/22/2016 10:51

@[Only registered and activated users can see links. Click Here To Register...]

läuft läuft.

REtender 08/22/2016 11:32

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

[Only registered and activated users can see links. Click Here To Register...]

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 (Post 35043339)
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 (Post 35047758)
@[Only registered and activated users can see links. Click Here To Register...]

läuft läuft.

Danke :) Der Script ist bei OVH entstanden / getestet.
Das Webinterface gefällt mir wirklich gut.

TakeThisBitch 08/22/2016 17:37

@[Only registered and activated users can see links. Click Here To Register...], 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
Spoiler:
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="[Only registered and activated users can see links. Click Here To Register...]"

# ---------------------------------------------------------------------------------------- #
########################### 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
Spoiler:
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 }'


[Only registered and activated users can see links. Click Here To Register...]

REtender 08/22/2016 17:50

Quote:

Originally Posted by TakeThisBitch (Post 35049513)
@[Only registered and activated users can see links. Click Here To Register...], 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? :)

TakeThisBitch 08/22/2016 17:51

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 :D

So, hier mal eine neue Version:
update.sh
Spoiler:
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 :)

REtender 08/22/2016 22:47

So, ich bin gerade erst nach Hause gekommen :D

[Only registered and activated users can see links. Click Here To Register...]
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.

TakeThisBitch 08/23/2016 07:07

eh, und ich habe verpennt und schaffe vor arbeit nix mehr :D

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. :)

REtender 08/23/2016 17:08

Quote:

Originally Posted by TakeThisBitch (Post 35052250)
eh, und ich habe verpennt und schaffe vor arbeit nix mehr :D

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 :)
[Only registered and activated users can see links. Click Here To Register...]
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 :D

_daniel4711 08/29/2016 05:38

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

TakeThisBitch 08/29/2016 07:39

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

_daniel4711 08/29/2016 12:23

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 :mad:

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.

REtender 08/29/2016 15:55

Quote:

Originally Posted by _daniel4711 (Post 35081429)
Denke das wird das Problem sein. Setze den Server gerade neu auf, da ich nen dummen Anfängerfehler gemacht hatte :mad:

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 :)

TiggaStyle 08/29/2016 16:20

@[Only registered and activated users can see links. Click Here To Register...]ner

von der Mailcow [Only registered and activated users can see links. Click Here To Register...] gibts übrigends auch quasi eine neue Version

REtender 08/29/2016 16:45

Quote:

Originally Posted by _daniel4711 (Post 35081429)
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!
[Only registered and activated users can see links. Click Here To Register...]

Quote:

Originally Posted by TiggaStyle (Post 35082521)
@[Only registered and activated users can see links. Click Here To Register...]ner

von der Mailcow [Only registered and activated users can see links. Click Here To Register...] 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
[Only registered and activated users can see links. Click Here To Register...]

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! :)

_daniel4711 08/29/2016 17:33

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: xxx.Domain.tld A IP Adresse sollte doch so richtig sein?

_daniel4711 09/01/2016 21:32

erledigt


All times are GMT +2. The time now is 12:01.

Powered by vBulletin®
Copyright ©2000 - 2026, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.