Delete User from Admin Web interface breaks apache / nginx config Topic is solved
Delete User from Admin Web interface breaks apache / nginx config
Hi,
Just helped out a client running nginx / apache combo. They deleted a user but it left the config lines for that user in
/etc/apache2/conf.d/vesta.conf and
/etc/nginx/conf.d/vesta.conf
So when they restarted the webserver a little later, all sites on the server were down.
A bit more detail. From the /var/log/vesta/system.log:
2018-02-14 08:10:16 v-unsuspend-web-domain 'i3' 'i3-domain.com' 'no'
2018-02-14 08:10:17 v-unsuspend-web-domain 'i3' 'staging.i3-domain.com' 'no'
2018-02-14 08:10:17 v-unsuspend-web-domains 'i3'
2018-02-14 08:10:17 v-unsuspend-dns-domain 'i3' 'i3-domain.com' 'no'
2018-02-14 08:10:17 v-unsuspend-dns-domain 'i3' 'staging.i3-domain.com' 'no'
2018-02-14 08:10:17 v-unsuspend-dns-domains 'i3'
2018-02-14 08:10:17 v-unsuspend-mail-domain 'i3' 'staging.i3-domain.com'
2018-02-14 08:10:17 v-unsuspend-mail-domains 'i3'
2018-02-14 08:10:17 v-unsuspend-database 'i3' 'i3_i3db'
2018-02-14 08:10:17 v-unsuspend-database 'i3' 'i3_chatdb'
2018-02-14 08:10:17 v-unsuspend-database 'i3' 'i3_stagingdb'
2018-02-14 08:10:17 v-unsuspend-databases 'i3'
2018-02-14 08:10:17 v-unsuspend-cron-jobs 'i3'
2018-02-14 08:10:18 v-unsuspend-user 'i3'
2018-02-14 08:10:27 v-unsuspend-web-domains 'i3'
2018-02-14 08:10:28 v-delete-web-domain 'i3' 'i3-domain.com' 'no'
2018-02-14 08:10:29 v-delete-web-domain 'i3' 'staging.i3-domain.com' 'no'
2018-02-14 08:10:29 v-delete-web-domains 'i3'
2018-02-14 08:10:29 v-unsuspend-dns-domains 'i3'
2018-02-14 08:10:29 v-delete-dns-domain 'i3' 'i3-domain.com' 'no'
2018-02-14 08:10:29 v-delete-dns-domain 'i3' 'staging.i3-domain.com' 'no'
2018-02-14 08:10:29 v-delete-dns-domains 'i3'
2018-02-14 08:10:29 v-unsuspend-mail-domains 'i3'
2018-02-14 08:10:29 v-delete-mail-domain 'i3' 'staging.i3-domain.com'
2018-02-14 08:10:29 v-delete-mail-domains 'i3'
2018-02-14 08:10:29 v-unsuspend-databases 'i3'
2018-02-14 08:10:30 v-delete-database 'i3' 'i3_i3db'
2018-02-14 08:10:30 v-delete-database 'i3' 'i3_chatdb'
2018-02-14 08:10:31 v-delete-database 'i3' 'i3_stagingdb'
2018-02-14 08:10:31 v-delete-databases 'i3'
2018-02-14 08:10:31 v-delete-user-ips 'i3'
2018-02-14 08:10:31 v-delete-user 'i3'
The lines left in /etc/apache2/conf.d/vesta.conf were
Include /home/i3/conf/web/apache2.conf
Include /home/i3/conf/web/sapache2.conf
And the corresponding include lines in /etc/nginx/conf.d/vesta.conf
include /home/i3/conf/web/snginx.conf;
include /home/i3/conf/web/nginx.conf;
Manually deleting these lines allowed the webserver to restart.
So what went wrong?
Just helped out a client running nginx / apache combo. They deleted a user but it left the config lines for that user in
/etc/apache2/conf.d/vesta.conf and
/etc/nginx/conf.d/vesta.conf
So when they restarted the webserver a little later, all sites on the server were down.
A bit more detail. From the /var/log/vesta/system.log:
2018-02-14 08:10:16 v-unsuspend-web-domain 'i3' 'i3-domain.com' 'no'
2018-02-14 08:10:17 v-unsuspend-web-domain 'i3' 'staging.i3-domain.com' 'no'
2018-02-14 08:10:17 v-unsuspend-web-domains 'i3'
2018-02-14 08:10:17 v-unsuspend-dns-domain 'i3' 'i3-domain.com' 'no'
2018-02-14 08:10:17 v-unsuspend-dns-domain 'i3' 'staging.i3-domain.com' 'no'
2018-02-14 08:10:17 v-unsuspend-dns-domains 'i3'
2018-02-14 08:10:17 v-unsuspend-mail-domain 'i3' 'staging.i3-domain.com'
2018-02-14 08:10:17 v-unsuspend-mail-domains 'i3'
2018-02-14 08:10:17 v-unsuspend-database 'i3' 'i3_i3db'
2018-02-14 08:10:17 v-unsuspend-database 'i3' 'i3_chatdb'
2018-02-14 08:10:17 v-unsuspend-database 'i3' 'i3_stagingdb'
2018-02-14 08:10:17 v-unsuspend-databases 'i3'
2018-02-14 08:10:17 v-unsuspend-cron-jobs 'i3'
2018-02-14 08:10:18 v-unsuspend-user 'i3'
2018-02-14 08:10:27 v-unsuspend-web-domains 'i3'
2018-02-14 08:10:28 v-delete-web-domain 'i3' 'i3-domain.com' 'no'
2018-02-14 08:10:29 v-delete-web-domain 'i3' 'staging.i3-domain.com' 'no'
2018-02-14 08:10:29 v-delete-web-domains 'i3'
2018-02-14 08:10:29 v-unsuspend-dns-domains 'i3'
2018-02-14 08:10:29 v-delete-dns-domain 'i3' 'i3-domain.com' 'no'
2018-02-14 08:10:29 v-delete-dns-domain 'i3' 'staging.i3-domain.com' 'no'
2018-02-14 08:10:29 v-delete-dns-domains 'i3'
2018-02-14 08:10:29 v-unsuspend-mail-domains 'i3'
2018-02-14 08:10:29 v-delete-mail-domain 'i3' 'staging.i3-domain.com'
2018-02-14 08:10:29 v-delete-mail-domains 'i3'
2018-02-14 08:10:29 v-unsuspend-databases 'i3'
2018-02-14 08:10:30 v-delete-database 'i3' 'i3_i3db'
2018-02-14 08:10:30 v-delete-database 'i3' 'i3_chatdb'
2018-02-14 08:10:31 v-delete-database 'i3' 'i3_stagingdb'
2018-02-14 08:10:31 v-delete-databases 'i3'
2018-02-14 08:10:31 v-delete-user-ips 'i3'
2018-02-14 08:10:31 v-delete-user 'i3'
The lines left in /etc/apache2/conf.d/vesta.conf were
Include /home/i3/conf/web/apache2.conf
Include /home/i3/conf/web/sapache2.conf
And the corresponding include lines in /etc/nginx/conf.d/vesta.conf
include /home/i3/conf/web/snginx.conf;
include /home/i3/conf/web/nginx.conf;
Manually deleting these lines allowed the webserver to restart.
So what went wrong?
Re: Delete User from Admin Web interface breaks apache / nginx config
Sudden thought ... the recent upgrade changed the web config structure.
Could it be that the delete routine was trying to remove the OLD web config structure, and failed because of that?
i.e. it missed the lines in vesta.conf because it was looking for the NEW ones?
Could it be that the delete routine was trying to remove the OLD web config structure, and failed because of that?
i.e. it missed the lines in vesta.conf because it was looking for the NEW ones?
Re: Delete User from Admin Web interface breaks apache / nginx config
Ok as I suspected there's a bug to do with users running the old style web config. If you try to delete them you break apache and nginx conf. https://github.com/serghey-rodin/vesta/issues/1458
Best idea is to do v-rebuild-web-domains for each user to make sure they're on the new config style (one config file per domain in /home/user/conf/web )
Best idea is to do v-rebuild-web-domains for each user to make sure they're on the new config style (one config file per domain in /home/user/conf/web )
Re: Delete User from Admin Web interface breaks apache / nginx config
Good solution, but anyway I will fix it in v-delete-web-domains
You and me know about this, but many users don't... so... it must be fixed in code anyway....
And yes, we discovered the same bug... on hard way :D
You and me know about this, but many users don't... so... it must be fixed in code anyway....
And yes, we discovered the same bug... on hard way :D