root@m ~ # apt-get update && apt-get -y dist-upgrade && apt-get -y autoremove --purge && service nginx restart Ign:1 http://mirror.hetzner.de/debian/packages stretch InRelease Hit:2 http://mirror.hetzner.de/debian/packages stretch-updates InRelease Hit:3 http://mirror.hetzner.de/debian/packages stretch-backports InRelease Hit:4 http://mirror.hetzner.de/debian/security stretch/updates InRelease Hit:5 http://security.debian.org stretch/updates InRelease Ign:6 http://deb.debian.org/debian stretch InRelease Hit:7 http://mirror.hetzner.de/debian/packages stretch Release Hit:8 http://deb.debian.org/debian stretch-updates InRelease Hit:9 http://deb.debian.org/debian stretch Release Hit:10 https://packages.sury.org/php stretch InRelease Hit:11 http://nginx.org/packages/debian stretch InRelease Reading package lists... Done Reading package lists... Done Building dependency tree Reading state information... Done You might want to run 'apt --fix-broken install' to correct these. The following packages have unmet dependencies: libnginx-mod-http-dav-ext : Depends: nginx-common (= 1.10.3-1+deb9u1) but it is not installed libnginx-mod-http-echo : Depends: nginx-common (= 1.10.3-1+deb9u1) but it is not installed libnginx-mod-http-geoip : Depends: nginx-common (= 1.10.3-1+deb9u1) but it is not installed libnginx-mod-http-image-filter : Depends: nginx-common (= 1.10.3-1+deb9u1) but it is not installed libnginx-mod-http-subs-filter : Depends: nginx-common (= 1.10.3-1+deb9u1) but it is not installed libnginx-mod-http-upstream-fair : Depends: nginx-common (= 1.10.3-1+deb9u1) but it is not installed libnginx-mod-http-xslt-filter : Depends: nginx-common (= 1.10.3-1+deb9u1) but it is not installed libnginx-mod-mail : Depends: nginx-common (= 1.10.3-1+deb9u1) but it is not installed libnginx-mod-stream : Depends: nginx-common (= 1.10.3-1+deb9u1) but it is not installed nginx-full : Depends: libnginx-mod-http-auth-pam (= 1.10.3-1+deb9u1) but it is not installed Depends: nginx-common (= 1.10.3-1+deb9u1) but it is not installed E: Unmet dependencies. Try 'apt --fix-broken install' with no packages (or specify a solution).
root@m ~ # apt --fix-broken install Reading package lists... Done Building dependency tree Reading state information... Done Correcting dependencies... Done The following additional packages will be installed: libnginx-mod-http-auth-pam nginx-common Suggested packages: fcgiwrap nginx-doc ssl-cert The following NEW packages will be installed: libnginx-mod-http-auth-pam nginx-common 0 upgraded, 2 newly installed, 0 to remove and 1 not upgraded. Need to get 190 kB of archives. After this operation, 342 kB of additional disk space will be used. Do you want to continue? [Y/n] Y Get:1 http://deb.debian.org/debian stretch/main amd64 nginx-common all 1.10.3-1+deb9u1 [104 kB] Get:2 http://deb.debian.org/debian stretch/main amd64 libnginx-mod-http-auth-pam amd64 1.10.3-1+deb9u1 [85.8 kB] Fetched 190 kB in 0s (4,913 kB/s) Preconfiguring packages ... Selecting previously unselected package nginx-common. (Reading database ... 50116 files and directories currently installed.) Preparing to unpack .../nginx-common_1.10.3-1+deb9u1_all.deb ... Unpacking nginx-common (1.10.3-1+deb9u1) ... Selecting previously unselected package libnginx-mod-http-auth-pam. Preparing to unpack .../libnginx-mod-http-auth-pam_1.10.3-1+deb9u1_amd64.deb ... Unpacking libnginx-mod-http-auth-pam (1.10.3-1+deb9u1) ... Setting up nginx-common (1.10.3-1+deb9u1) ... Processing triggers for systemd (232-25+deb9u4) ... Setting up libnginx-mod-http-auth-pam (1.10.3-1+deb9u1) ... Processing triggers for nginx-full (1.10.3-1+deb9u1) ... Triggering nginx reload ...
Что-то не получается... :(
Ign:1 http://mirror.hetzner.de/debian/packages stretch InRelease
Hit:2 http://mirror.hetzner.de/debian/packages stretch-updates InRelease
Hit:3 http://mirror.hetzner.de/debian/packages stretch-backports InRelease
Hit:4 http://mirror.hetzner.de/debian/security stretch/updates InRelease
Hit:5 http://security.debian.org stretch/updates InRelease
Ign:6 http://deb.debian.org/debian stretch InRelease
Hit:7 http://mirror.hetzner.de/debian/packages stretch Release
Hit:8 http://deb.debian.org/debian stretch-updates InRelease
Hit:9 http://deb.debian.org/debian stretch Release
Hit:10 https://packages.sury.org/php stretch InRelease
Hit:11 http://nginx.org/packages/debian stretch InRelease
Reading package lists... Done
Reading package lists... Done
Building dependency tree
Reading state information... Done
You might want to run 'apt --fix-broken install' to correct these.
The following packages have unmet dependencies:
libnginx-mod-http-dav-ext : Depends: nginx-common (= 1.10.3-1+deb9u1) but it is not installed
libnginx-mod-http-echo : Depends: nginx-common (= 1.10.3-1+deb9u1) but it is not installed
libnginx-mod-http-geoip : Depends: nginx-common (= 1.10.3-1+deb9u1) but it is not installed
libnginx-mod-http-image-filter : Depends: nginx-common (= 1.10.3-1+deb9u1) but it is not installed
libnginx-mod-http-subs-filter : Depends: nginx-common (= 1.10.3-1+deb9u1) but it is not installed
libnginx-mod-http-upstream-fair : Depends: nginx-common (= 1.10.3-1+deb9u1) but it is not installed
libnginx-mod-http-xslt-filter : Depends: nginx-common (= 1.10.3-1+deb9u1) but it is not installed
libnginx-mod-mail : Depends: nginx-common (= 1.10.3-1+deb9u1) but it is not installed
libnginx-mod-stream : Depends: nginx-common (= 1.10.3-1+deb9u1) but it is not installed
nginx-full : Depends: libnginx-mod-http-auth-pam (= 1.10.3-1+deb9u1) but it is not installed
Depends: nginx-common (= 1.10.3-1+deb9u1) but it is not installed
E: Unmet dependencies. Try 'apt --fix-broken install' with no packages (or specify a solution).
root@m ~ # apt --fix-broken install
Reading package lists... Done
Building dependency tree
Reading state information... Done
Correcting dependencies... Done
The following additional packages will be installed:
libnginx-mod-http-auth-pam nginx-common
Suggested packages:
fcgiwrap nginx-doc ssl-cert
The following NEW packages will be installed:
libnginx-mod-http-auth-pam nginx-common
0 upgraded, 2 newly installed, 0 to remove and 1 not upgraded.
Need to get 190 kB of archives.
After this operation, 342 kB of additional disk space will be used.
Do you want to continue? [Y/n] Y
Get:1 http://deb.debian.org/debian stretch/main amd64 nginx-common all 1.10.3-1+deb9u1 [104 kB]
Get:2 http://deb.debian.org/debian stretch/main amd64 libnginx-mod-http-auth-pam amd64 1.10.3-1+deb9u1 [85.8 kB]
Fetched 190 kB in 0s (4,913 kB/s)
Preconfiguring packages ...
Selecting previously unselected package nginx-common.
(Reading database ... 50116 files and directories currently installed.)
Preparing to unpack .../nginx-common_1.10.3-1+deb9u1_all.deb ...
Unpacking nginx-common (1.10.3-1+deb9u1) ...
Selecting previously unselected package libnginx-mod-http-auth-pam.
Preparing to unpack .../libnginx-mod-http-auth-pam_1.10.3-1+deb9u1_amd64.deb ...
Unpacking libnginx-mod-http-auth-pam (1.10.3-1+deb9u1) ...
Setting up nginx-common (1.10.3-1+deb9u1) ...
Processing triggers for systemd (232-25+deb9u4) ...
Setting up libnginx-mod-http-auth-pam (1.10.3-1+deb9u1) ...
Processing triggers for nginx-full (1.10.3-1+deb9u1) ...
Triggering nginx reload ...
root@m ~ # apt-get update && apt-get -y dist-upgrade && apt-get -y autoremove --purge && service nginx restart
Ign:1 http://mirror.hetzner.de/debian/packages stretch InRelease
Hit:2 http://mirror.hetzner.de/debian/packages stretch-updates InRelease
Hit:3 http://mirror.hetzner.de/debian/packages stretch-backports InRelease
Hit:4 http://mirror.hetzner.de/debian/security stretch/updates InRelease
Hit:5 http://mirror.hetzner.de/debian/packages stretch Release
Ign:6 http://deb.debian.org/debian stretch InRelease
Hit:7 http://security.debian.org stretch/updates InRelease
Hit:8 http://deb.debian.org/debian stretch-updates InRelease
Hit:9 http://deb.debian.org/debian stretch Release
Hit:10 https://packages.sury.org/php stretch InRelease
Hit:11 http://nginx.org/packages/debian stretch InRelease
Reading package lists... Done
Reading package lists... Done
Building dependency tree
Reading state information... Done
Calculating upgrade... Done
The following packages have been kept back:
nginx
0 upgraded, 0 newly installed, 0 to remove and 1 not upgraded.
Reading package lists... Done
Building dependency tree
Reading state information... Done
0 upgraded, 0 newly installed, 0 to remove and 1 not upgraded.
root@m ~ # nginx -v
nginx version: nginx/1.10.3
правильно я понимаю что папку /etc/nginx нужно забекапить, после обновления быстро ее перезаписать, опять рестарнтнуть и на этом все?
И еще вопрос - эта команда apt-get -y dist-upgrade не полезет обновлять пхп с 7,2 на 7,3 ?
А обновить нельзя без удаления? Чтоб даун тайм поменьше был...
Подскажите как, буду очень благодарен.
/ru/forum/comment/14885499
+ я еще добавил определение ботов без кукисов, и добавил автоблокировку особо упоротых по айпи на сутки.
+ уде на фронте, тем кто превышает заданное кол-во обращений я выдаю гугл капчу и пока не пройдкт контент не показываю.
Решение работает уже год, траф растет, поисковые боты ходят без ограничений. Все остальные боты или отсекаются сразу или ходят с большим трудом
Если ваш сайт на https + http2, то отсечь 98% ботов можно средствами nginx
при 30 тысячах уников в сутки. сейчас плачу 4600 в месяц за выделенный.
Что-то вы переплачиваете. Я плачу 1700 р. за впс при трафике 80.000 в сутки, так у меня он нагружен всего на 30%.
все разобрался - там вообще не нужно var
прописал так
и все заработало!!!
Спасибо!
jkm, спасибо большое за помощь. Опять разнес по разным строкам, сделал ваш запрос.
Ошибки пропали - но и релоад Nginx не работает. Я его как-то не так прописал?
P.S. посмотрел файл - ваш запрос объединил две последние строки..... Ну да, я это уже догнал попробовать...
Записал в одну строку, ошибок нет, но и релоад Nginx не работает. Может я его не так записал?
jkm, спаисбо большое! А я тут подумал... а нужно ли делать релоад Nginx после каждой новой записи ?
Можно так?
query="SELECT CONCAT('deny ', INET_NTOA(ip_start), ';') FROM \`xyfq1_blacklist_items\` WHERE \`c\` > 20 ORDER BY \`c\` DESC "
mysql --skip-column-names --user="root" --password="Пароль" --database="База2" --execute="$query" > /etc/nginx/sites-conf/blockip.conf;
var='/etc/init.d/nginx reload';
но мне выдает