ISPmanager console commands: mgrctl and panel files
All commands are run over SSH as root on the VPS. mgrctl is the console interface to panel functions: the same as the buttons, but from the terminal.
Panel: restart, update, configs
| Command | What it does |
|---|---|
/usr/local/mgr5/sbin/mgrctl -m ispmgr exit | restart the panel (same as killall core). Needed after editing ispmgr.conf |
systemctl restart ihttpd | restart the panel web server (port 1500). Needed after editing ihttpd.conf |
/usr/local/mgr5/sbin/pkgupgrade.sh coremanager | update the panel core |
nano /usr/local/mgr5/etc/ispmgr.conf | panel settings |
nano /usr/local/mgr5/etc/ihttpd.conf | panel address, port, certificate and timeout |
Domains, sites, owners
/usr/local/mgr5/sbin/mgrctl -m ispmgr domain | sed -e 's/displayname=.*user/user/' -e 's/dtype.*//'
# name=example.com user=www-root
/usr/local/mgr5/sbin/mgrctl -m ispmgr webdomain | sed -e 's/docroot.*//'
# name=example.com owner=www-rootWithout sed all fields are shown. Suspend a site (elid is the name from the webdomain list):
/usr/local/mgr5/sbin/mgrctl -m ispmgr webdomain.suspend elid=example.com
/usr/local/mgr5/sbin/mgrctl -m ispmgr webdomain.resume elid=example.comPasswords
# panel user
/usr/local/mgr5/sbin/mgrctl -m ispmgr user.edit elid=demo passwd='NewPassword' confirm='NewPassword' sok=ok
# FTP user
/usr/local/mgr5/sbin/mgrctl -m ispmgr ftp.user.edit elid=demo passwd='NewPassword' confirm='NewPassword' sok=ok
# one password for all panel users (e.g. after a hack — then give each user their own)
for u in $(/usr/local/mgr5/sbin/mgrctl -m ispmgr user | sed 's/=/ /' | awk '{print $2}'); do
/usr/local/mgr5/sbin/mgrctl -m ispmgr user.edit elid=$u passwd='NewPassword' confirm='NewPassword' sok=ok
doneKeep the password in single quotes — then the characters $ ! & do not break the command.
Panel access by IP
# allow a user to log in only from one IP
/usr/local/mgr5/sbin/mgrctl -m ispmgr usrparam su=demo addr='198.51.100.7' atype=atallow sok=ok elid=demoLocked yourself out with an IP restriction — remove the Access line from /usr/local/mgr5/var/userconf/ispmgr.root (for a user — ispmgr.<login>) and restart the panel.
Backups
cd /usr/local/mgr5 && ./sbin/backup2 demo # copy of user demo
/usr/local/mgr5/sbin/cron-ispmgr sbin/backup2_pro demo # the same in the Business editionTemporary backup files — /usr/local/mgr5/var/backup/ispmgr/. Backups to our server: VPS backups.
Cron: open a site URL on schedule
If a CMS asks to "call a URL by cron" rather than a file, the job command is:
wget --no-check-certificate -O - -q -t 1 https://example.com/cron.php-O - — do not save files to disk, -q — quiet, -t 1 — one try.
A long import from another server breaks
With a slow connection or a big volume the user import breaks on the session timeout. On the source server temporarily increase the timeouts:
# /usr/local/mgr5/etc/ispmgr.conf
AuthenLifeTime 1000000
NodeTimeoutSmall 36000
NodeTimeoutMiddle 36000
NodeTimeoutLong 36000
NodeTimeoutVeryLong 38000
# /usr/local/mgr5/etc/ihttpd.conf — inside the listen { ... } block
timeout 1000000systemctl restart ihttpd && /usr/local/mgr5/sbin/mgrctl -m ispmgr exitIf the source panel could not enable SSH for the users being moved, enable it manually and run the import again. Revert the defaults afterwards. Import: Import from another server.