• The Horde webmail has been deprecated. Its complete removal is scheduled for April 2025. For details and recommended actions, see the Feature and Deprecation Plan.
  • We’re working on enhancing the Monitoring feature in Plesk, and we could really use your expertise! If you’re open to sharing your experiences with server and website monitoring or providing feedback, we’d love to have a one-hour online meeting with you.

Renaming of a domain requires server restart to keep fail2ban working

Thomas Poisl

Basic Pleskian
If you rename a domain, fail2ban will stop working, since it still tries to open the old path the the web access log.

One workaround is to restart the server after renaming the domain, then fail2ban paths are updated.

I'm using plesk 12.0.18.
 
Hi Thomas Poisl,

don't you think that it is much more effective, if you just restart Fail2Ban ?

If you change a domains name, fail2ban will not restart automatically like apache and/or nginx for example, so fail2ban doesn't know, that the paths changed. Please see the configuration files i.e: "plesk.conf" at "/etc/fail2ban/jail.d" - the section "[plesk-apache]" for example looks for error.logs in "logpath = /var/www/vhosts/system/*/logs/error_log" and the new path(s) are only used, if you restart Fail2Ban. If you changed a domain name, you will see in the fail2ban.log, that Fail2Ban still looks for the error.log in the old path, which causes an error, when the path isn't existent any more.

Absolut sufficient would be, after you changed vhosts - paths:

service fail2ban restart
or
/etc/init.d/fail2ban restart
 
Ok, I'll check that...

But the really bad thing about that domain renaming is, that fail2ban stops working... and if you don't check the logs you won't even notice that it is not working anymore.

Maybe a good solution would be to send a fail2ban restart automatically, when a domain is renamed, don't you think?
 
Hi Thomas Poisl,

renaming domains ( or changing vhosts - paths ) is not really a "common" procedure and I would like to mention, that Fail2Ban is an addon ( extension ). You should always be aware, that if you use additional services, then consider their restarts after such a procedure, because Plesk won't check any running service on your server, so it could restart them in case you made an essential change on a vhost - path. Be aware as well, that Fail2Ban is not installed on every server which uses Plesk, because it is not a necessary extension on a server... it's a user choice.
 
Shouldn't be that much effort to check for the service and restart it in the case of a domain rename, or?

For me it seemed a valid scenario to allow new customers the possibilty to move their site to a temporary domain name, e.g. "<customer>.<hosting-provider-tld>" before it is transfered and renamed.

But if there is a better practice for such migration scenarios, I'd really love to hear about it.
 
Hi Thomas Poisl,

I don't have to understand, WHY you move new customer to a subdomain like "<customer>.<hosting-provider-tld>", before you create the desired domain for the new customer, but did you know that a preview of the new domain exist, even that the DNS entries are not synched with the new IP yet? ( pls. view the setting "Tools & Settings > Website Preview Settings" ) and the depending configuration i.e. at the domain specific http.conf : "ServerAlias "customer-site.tld.192-0-2-12.your-domain.tld" ).

To answer the question "Shouldn't be that much effort to check for the service and restart it in the case of a domain rename, or?", I would again re-ask, why you don't just restart Fail2Ban with the commands like suggested above, instead of asking for a complex re-coding of several Plesk files? If you know, that Fail2Ban ( because it is an extension, which doesn't depend on the webservers on the server ) isn't restarted in case of domain renaming, it is by far easier, just to restart the service after your changes, than to re-code several Plesk files.
 
Hi Igor, I'm using latest Plesk 12.0.18 Update #35 on CentOS 6.6 (Final). Please don't hesitate to ask, if you need more info.
 
Back
Top