Managing an Enhance server requires familiarity with various commands that help you monitor and maintain your server’s performance. Below is a list of essential daily commands that will assist you in efficiently managing your Enhance server.
Enhance ORCHD logs:
v11: docker logs -f orchd
v12+:
# View logs for orchd service:
journalctl -u orchd.service
# View logs in real-time:
journalctl -u orchd.service -f
# View logs for the last hour:
journalctl -u orchd.service --since "1 hour ago"
# View the last 100 logs:
journalctl -u orchd.service -n 100
Container Stats Rams / CPU / Net IO / Block IO (v11 only) :
# With live updates :
sudo docker stats
# No live Updates:
docker stats --no-stream
Tail Apache Logs:
v11:
docker logs -f apache
v12+:
# View logs for Apache service:
journalctl -u apache2.service
# View logs in real-time:
journalctl -u apache2.service -f
# View logs for the last hour:
journalctl -u apache2.service --since "1 hour ago"
# View the last 100 logs:
journalctl -u apache2.service -n 100
Tail LiteSpeed & OpenLiteSpeed Logs:
v11:
docker logs -f openlitespeed
docker logs -f litespeed
v12+:
# View logs for lshttpd service:
journalctl -u lshttpd.service
# View logs in real-time:
journalctl -u lshttpd.service -f
# View logs for the last hour:
journalctl -u lshttpd.service --since "1 hour ago"
# View the last 100 logs:
journalctl -u lshttpd.service -n 100
Tail Litespeed / OLS cPFence WAF logs :
v11:
docker exec litespeed tail -f /usr/local/lsws/logs/security_audit.log
docker exec litespeed tail -f /usr/local/lsws/logs/auditlog-debug.txt
docker exec openlitespeed tail -f /usr/local/lsws/logs/security_audit.log
docker exec openlitespeed tail -f /usr/local/lsws/logs/auditlog-debug.txt
v12+:
tail -f /usr/local/lsws/logs/security_audit.log
tail -f /usr/local/lsws/logs/auditlog-debug.txt
Tail Nginx Logs:
v11:
docker logs -f nginx
v12+:
# View logs for nginx service:
journalctl -u nginx.service
# View logs in real-time:
journalctl -u nginx.service -f
# View logs for the last hour:
journalctl -u nginx.service --since "1 hour ago"
# View the last 100 logs:
journalctl -u nginx.service -n 100
Tail All Web Server Logs for all accounts :
tail -f /var/local/enhance/webserver_logs/*.log
Tail Web Server Logs for one website :
tail -f /var/local/enhance/webserver_logs/{uuid}.log
Tip: Replace {uuid} with the website ID which is visible in your browser’s address bar when managing the website.
Tail Mysql Logs:
# View logs for mysql service:
journalctl -u mysql.service
# View logs in real-time:
journalctl -u mysql.service -f
# View logs for the last hour:
journalctl -u mysql.service --since "1 hour ago"
# View the last 100 logs:
journalctl -u mysql.service -n 100
Tail Docker Container Logs (v11 only):
tail -f /var/lib/docker/containers/*/*.log
Tail System Logs or Restart syslog service:
tail -f /var/log/syslog
systemctl restart syslog.service
View Most Active IPs:
tail -n 500 /var/local/enhance/webserver_logs/*.log | grep -E '"[^"]*" "[^"]*" "[A-Z]+ [^"]*" "[^"]*" "[^"]*" "[^"]*" "[^"]*" "[^"]*"' | awk '{print $1}' | sort | uniq -c | sort -nr
Edit Cronjob for Users:
crontab -e -u username
Container Management (v11 only)
Entering a Container:
docker exec -it apache bash
docker exec -it openlitespeed bash
docker exec -it litespeed bash
docker exec -it nginx bash
To exit, simply type:
exit
Restarting Apache Service in Enhance:
v11:
docker exec apache apachectl -k stop
docker exec apache apachectl -k start
docker exec apache apachectl -k restart
v12+:
systemctl start apache2.service
systemctl stop apache2.service
systemctl restart apache2.service
Graceful Restart of Apache (v11 only):
docker exec apache apachectl -k graceful
Restart / Stop / Start Litespeed & Openlitespeed Server:
v12+:
/usr/local/lsws/bin/lswsctrl stop
/usr/local/lsws/bin/lswsctrl start
/usr/local/lsws/bin/lswsctrl restart
v11:
# OLS
docker exec openlitespeed /usr/local/lsws/bin/lswsctrl stop
docker exec openlitespeed /usr/local/lsws/bin/lswsctrl start
docker exec openlitespeed /usr/local/lsws/bin/lswsctrl restart
# Litespeed
docker exec litespeed /usr/local/lsws/bin/lswsctrl stop
docker exec litespeed /usr/local/lsws/bin/lswsctrl start
docker exec litespeed /usr/local/lsws/bin/lswsctrl restart
Restart Mariadb or Mysql :
v12+:
systemctl restart mysql.service
v11:# Mysql
docker stop mysql
docker start mysql
# Mariadb
docker stop mariadb
docker start mariadb
Restart Enhance orchd:
v12+:
systemctl restart orchd.service
v11:
docker restart orchd
Reinstalling Default UFW Rules:
On each server run this :
apt install -y ecp-core --reinstall
Then, on the control panel server:
v12+:
systemctl restart orchd.service
Load Modules in Apache:
nano /etc/apache2/apache2.conf
Add this line under the existing LoadModule lines
LoadModule cgid_module modules/mod_cgid.so
systemctl restart apache2.service
Verify that the module is loaded
apachectl -M | grep cgid
Listing All Containers and Checking Status (v11 only):
docker ps -a
Cancel cPanel imports that failed and are still pending:
Run this command :
v12+:
sudo -u postgres psql orchd
v11:
docker exec -it orchd-postgres psql -U enhance
Then run this command :
update import_migrations set status = 'failed' where status = 'queued';
Cancel Hanged Pending Restores :
First run this :
v12+:
sudo -u postgres psql orchd
v11:
docker exec -it orchd-postgres psql -U enhance
Then This :
update restores set finished_at = now() where finished_at is null;
To Cancel a Pending Migration :
On the source app server, run:
systemctl restart appcd
On the main panel server, run:
systemctl restart orchd
Apply Latest Ubuntu Updates :
apt update && sudo apt -y upgrade
Change Web server Type from the CLI on Main Control Panel :
On the main control panel :
appcd-cli change-webserver apache
Tip : you can replace apache with the server type you want , possible values: apache, dummy-web-server, lite-speed, open-lite-speed, nginx
List all Usernames for all accounts on the Enhance Server :
cat /etc/passwd | grep /var/www
Import Big DB via Command Line on Enhance:
su - username
mysql -u db_username -p database_name < your_backup.sql
Clear Unused Docker Images to save space (v11 only):
docker image prune -a
This will clear from 1 GB to 5GB or more.
Tip: If you are on v12 and not using Docker, you can save space by running these commands:
docker stop bkupd bkupfilerd
systemctl disable docker
apt-get remove docker-ce
rm -rf /var/lib/docker
Diagnose Enhance Server Disk Usage:
du --exclude='/var/container_tmp/*' --exclude='/var/lib/docker/*' --exclude='/var/local/enhance/*' --exclude='/proc' --exclude='/sys' -h / 2>/dev/null | awk '$1 ~ /[0-9]G/'
or
du --max-depth=3 --exclude=/var/lib/docker/overlay2 --exclude=/var/local/enhance/containers --exclude=/proc --exclude=/sys -h /
And you can also run :
du --max-depth=2 --exclude=/var/local/enhance/containers /var/local/enhance -h
To find the accounts with the largest size, use:
du -sh /var/www/* | sort -rh
To find only the top 10 accounts by size, use:
du -sh /var/www/* | sort -rh | head -n 10
To find all files and directories in /var/www owned by root
find /var/www -user root ! -path "*/acme-challenge*" ! -path "*/control-panel*" ! -path "*/default*" ! -path "*/vhost*"
Find leftover .sql backup files :
find /*/*/*/.mysql_backup_enhance -type f -exec du -h {} \; -print
Search in Backups on Enhance Backup Server:
v12+:
grep target_db_name /backups/*/current/home/public_html/wp-config.php
v11:
grep target_db_name /backups/*/backup-subvolume/home/public_html/wp-config.php
or
v12+:
grep account_username /backups/*/current/home/.my.cnf
v11:
grep account_username /backups/*/backup-subvolume/home/.my.cnf
Search and Delete Snapshots on Enhance Backup Server :
# Search for Snapshots :
btrfs subvolume list /backups/ | grep 'website_id_here'
# Delete Snapshots with IDs:
btrfs subvolume delete --subvolid=id_from_list_command /backups/
Empty all syslog files
find /var/log/ -type f -name "syslog*" ! -name "*.gz" -exec truncate -s 0 {} \;
To clear the Main CP logs
v12+:
sudo -u postgres psql orchd
v11:
docker exec -it orchd-postgres psql -U enhance
then
delete from activities;
Force Disable of local MTA :
systemctl stop postfix
systemctl disable postfix
Resource usage
To monitor all websites (sorted by CPU usage by default):
systemd-cgtop -p -n 0 --depth=1 /websites/
To sort by memory usage, add -m:
systemd-cgtop -p -m -n 0 --depth=1 /websites/
To sort by IO load, add -i:
systemd-cgtop -p -i -n 0 --depth=1 /websites/
To monitor a specific website, use its website ID:
systemd-cgtop -p -n 0 /websites/website-id-here
To monitor all system services :
systemd-cgtop -p -n 0
or
systemd-cgtop -p -n 0 --depth=1 system.slice
Enhance Appcd CLI Tool :
This CLI tool from Enhance you can use –help to find more info about it :
appcd-cli --help
List & View Main Running Processes:
Display a list of currently running processes on the server, specifically those managed by the Enhance system. It provides details such as the process ID (PID), executable path, and user ID (UID) for each process. This command is useful for monitoring and managing system processes, allowing administrators to quickly identify running services, their associated files, and any potential issues related to server resource usage.
appcd-cli list-processes
Reset LiteSpeed Webserver configs :
appcd-cli reset-webserver-config
Display Current Installed version :
appcd-cli version
These commands form the backbone of daily operations on an Enhance server. By familiarizing yourself with these commands, you can ensure smooth operation, quickly address issues, and maintain the security and performance of your server.
If you have any other useful commands that you regularly use to manage your Enhance server and aren’t listed here, we’d love to hear from you! Share your tips and tricks in the comments below to help others optimize their server management routines. Together, we can build a more comprehensive resource for the Enhance community.
Thanks for this
You are welcome!