Help me figure it out. An attack on the website

Здравствуйте, профессионалы, вчера была атака на сайт в течение 3 часов без остановки. Сайт не упал, но открывался очень-очень-очень долго, пользователи в итоге уходили с сайта. Прилагаю скриншот, где видно, что нагрузка apach. Я новичок, объясните, пожалуйста, что это за атака и как защититься, чтобы в следующий раз не допустить такого

English translation:

Hello, professionals. Yesterday, there was an attack on the website that lasted for 3 hours without interruption. The website didn’t go down, but it loaded very, very, very slowly, and as a result, users ended up leaving the site. I’m attaching a screenshot showing the Apache load. I’m a beginner, so please explain what kind of attack this is and how to protect against it to prevent this from happening again in the future.

Привет. Лучше использовать nginx + php-fpm, без apache - сервер будет в разы лучше справляться с нагрузкой, на сайте настройте кеширование, если еще не сделали это, спрячьте сайт за cloudflare (там в критический момент сможете активировать настройку, что сайт под атакой), настройте файрвол (настройте fail2ban, чтоб мониторил ошибки в логах nginx и блокировал злоумышленников, добавьте ipset со зловредными ip из списка abuseipdb и из скрипта [IPv4] Block Malicious IPs).

English translation:

Hi. It’s better to use Nginx + PHP-FPM without Apache – the server will handle the load much more effectively. On the website, set up caching if you haven’t done so already. Hide the site behind Cloudflare (you can activate the “Under Attack Mode” during critical moments). Configure the firewall (set up Fail2Ban to monitor errors in Nginx logs and block attackers, add IP sets with malicious IPs from the AbuseIPDB list and from the [IPv4] Block Malicious IPs script).

Здравствуйте, спасибо. Скажите, пжл, а если вообще apache не ставить, будет ли это безопасно?
Только как будет работать файл htaccess?
И не будет ли проблем с php?
Спасибо

Тут именно отказ от apache. Но настройки переадресаций и прочего уже не в htaccess, а в nginx (придется изучать). Проблем с php и безопасностью при правильных настройках нет.

This is precisely the rejection of apache. But the settings for redirects and other things are no longer in htaccess, but in nginx (you’ll have to study it). There are no problems with php and security with the correct settings.

I’d look in the logs first, what loads the sites, and then decide how to do it and what. If bots load websites, I’d try what Sergey+https://github.com/mitchellkrogza said with Apach. I tested it myself, it’s fine, I haven’t figured out how to do it yet, but there will be protection.

Я бы для начала посмотрел в логах, что грузит сайты, а потом уже решал как сделать и что. Если боты грузят сайты, попробовал бы то что сказал Сергей+https://github.com/mitchellkrogza именно с Apach. Протестировал сам, все хорошо, есть заморочки с шаблонами пока не понял как сделать, но защита будет.

Please stick to english only.

4 Likes

This was one of my favorite websites 8 odd years ago. Clearly it’s OUT OF DATE. but I still feel that there are a lot of important concepts from this site that I still refer to.

I don’t even think that servermom.org redirects to www.servermom.org - Sometimes THAT throws me for a loop!

There are a lot of quotes like this
Vestacp using default configuration is great but Vestacp using LEMP stack (LEMP: Nginx + Php-fpm) is awesome! It can perform way better with less system resource usage than standard Vestacp install (LAMP + Nginx).

VestaCP is, unlike what most people thought, not as heavy as many hosting control panel in terms of server’s resource usage. It’s pretty lightweight and on top of that it’s free.

ONE of these days, I want to send her a ‘thank you’ note for pointing me in the right direction so many years ago.

PS - vesta is long gone, now HestiaCP is 100x better :slight_smile: