A handy reference page for common CyberPanel commands and configurations.
I made a list of the most common configurations and issues that I deal with on CyberPanel servers. If you don’t find what you need here, check on CyberPanel documentation or forums.
Install (CentOS):
yum update
, press “y” when askedsh <(curl https://cyberpanel.net/install.sh || wget -O - https://cyberpanel.net/install.sh)
(official link)- To update (when new versions are available),
sh <(curl https://raw.githubusercontent.com/usmannasir/cyberpanel/stable/preUpgrade.sh || wget -O - https://raw.githubusercontent.com/usmannasir/cyberpanel/stable/preUpgrade.sh)
(official link, for most recent update instructions and quick fixes if you see errors)
Usual configs after installation:
- after finished, log into panel and create admin user account for client
- go to security/firewall and open port 7080 for LS console
- change LS console pass with
cd /usr/local/lsws/admin/misc
and./admpass.sh
- log into LS console and enable brotli, WP security throttle (if you have LS Enterprise)
- take note of mysql root password with
cat /etc/cyberpanel/mysqlPassword
(used for logging into phpmyadmin) - php.ini limits must be increased for for CP (PHP7.0), and you should do the same for all other php versions as well
- Setting SSHD port in firewall
- SFTP (if you need it) – IP, root, root pass, SSH port, and make sure you choose SFTP protocol
- Go to “PHP > Install Extensions” if you any PHP extensions for certain plugins, etc.
- Enable crawler,
vi /usr/local/lsws/conf/httpd.conf
and add the lines below underneathCacheRoot /home/lscache/
:
CacheEngine on crawler
SetEnv CRAWLER_USLEEP 1000
SetEnv CRAWLER_LOAD_LIMIT 5.2
OpenLiteSpeed:
- Check version –
/usr/local/lsws/bin/openlitespeed -v
- Update OLS –
yum update
andyum upgrade openlitespeed
Logs:
- View from UI at
https://yourdomain.com::8090/serverlogs/
- Or from terminal –
cat /home/cyberpanel/error-logs.txt
(log files on CyberPanel) - Important log file locations – https://cyberpanel.net/docs/log-files-on-cyberpanel/
SSL certificates:
- SSL not renewing properly – run the acme
wget -O - https://get.acme.sh | sh
- Need to edit SSL’s manually? Look in
/etc/letsencrypt/live
- Need to check errors regarding SSL’s? Go to
https://serverip:8090/serverstatus/cyberCPMainLogFile
in your browser
MariaDB:
- Get phpMyAdmin pass –
cat /etc/cyberpanel/mysqlPassword
(user is “root”) - Restart control panel?
systemctl restart lscpd
- Restart mariadb
systemctl restart mariadb
Configurations:
- Changing mysql root pass? – edit
/etc/cyberpanel/mysqlPassword
,home/cyberpanel/.my.cnf
, and/root/cyberpanel/CyberCP/settings.py
,/usr/local/settings.py
, and/usr/local/CyberCP/CyberCP/settings.py
- How to do redirects in htaccess. You have to use different directives.
Common fixes:
- Cron schedules –
/etc/crontab
clear out unnecessary cronjobs eating up server resources (backups). Reference link. - Restart database –
systemctl start mariadb
- If having database error connection issues, try changing DB user password to match what you have in wp-config.php. Also check mysql root password in
/usr/local/cyberpanel/settings.py
- Look for a (potentially) better mysql config? Try this.
- Need to edit mysql configs? You can find it in
/home/cyberpanel/.my.cnf
- 404 errors, or .htaccess/vhost configs not applying immediately after updates? This issue can happen on OLS (which doesn’t support live htaccess updates). Try restarting LiteSpeed (Server Status > LiteSpeed Status > Reboot LiteSpeed).
- Terminal not working – make sure port 5678 is open in firewall, also
systemctl restart cpssh
. - Can’t connect to your panel on Amazon Lightsail? Go to the Networking section in Lightsail and open ports 8090 (for CyberPanel) and 7080 (for LiteSpeed console).
- Multisite – use child domains instead of domain aliases. Can follow our hosting documentation here.
- Troubleshooting diagnosis steps – https://cyberpanel.net/docs/troubleshooting-cyberpanel/
- Rpmdb open errors during upgrade, backup rpmdb
mv /var/lib/rpm/__db* /tmp
, thenyum clean all
andyum update
, and remove rpmdb backup if yum update worksrm -i /tmp/__db*
. - SSL certifications not renewing? – try going to /etc/letsencrypt/live/yourdomain.com and make sure the privkey has permissions of 644 instead of 600. Handy tool for diagnosing SSL.
- Annoying license error – refresh LS license
/usr/local/lsws/bin/lshttpd -v
Emails:
- Generating SSL for mail domain.
- Setting up custom mail server SSL.
- Rainloop webmail giving “unknown error” – try restart
- Other email issues? Can make sure SELinux is disabled.
- Getting emails delivered
Backups:
- Controlling backup schedule (time of day), for now can be done by editing cron job in
/etc/crontab
, like0 3 * * 0-6 root python /usr/local/CyberCP/plogical/backupSchedule.py
.
Want to see general Linux server commands?
Brajmohan Kumar
Hey!
“php.ini limits must be increased for PHP7.0 for CP.”
I am running OpenLiteSpeed with CyberPanel on one of my client sites, can’t upload more than 2GB from CyberPanel file manager even after editing php.ini for PHP 7.0.
It doesn’t work; You can’t increase the CP file manager upload limit by just editing the php.ini file. It can only be increased by modifying the codes.
According to Usman Nasir from SLACK:
“2GB is default body limit on LSCPD. So no matter what php.ini you changed, it won’t alter anything in 8090 port, and according to Usman, the LSCPD is limited upload size to 2GB in code.”
By the way, thank you for the excellent post 🙂
Regards,
Braj
Johnny
Ahhhh….why not use FTP then?
Aaron
Hi Johnny,
Thanks for this cheat sheet! It’s a great help!
Do you have any security tips for cyberpanel, on how to make CP and WordPress secure? I tried using the bult in ModSec but it ended up interfering with WordPress.
Do you have any tips on this?
Thanks!
Johnny
Did ModSec block your users or did it block certain API connectivity? You should read my guide on How to HARDEN a Linux web server.
Aaron
ModSec was interfering with my contact forms, Ajax, and some stuff in the back end. I didn’t even check if it interfered with my visitors, but it probably did. I was using the owasp rule pack.
Thanks for linking your article on hardening Linux. I’ll check it out!
billy
Hi Johnny,
At step Enable crawler, i can’t find “CacheRoot /home/lscache/:” row. File httpd.conf is empty.
Did i miss something?
Tobias
Hi.
Please share a Markdown-version of the text 🙂
Johnny
You’re trying to stick this on GitHub or something? How about an HTML-to-markdown converter? https://www.browserling.com/tools/html-to-markdown
Tobias
That’s actually a good point. I didn’t look at the source-code, so i just thought it was a mess to make a direct HTML > MD translation. But it turned out pretty good 🙂
It’s just for my personal use, in my markdown note-collection (it’s powered by CodiMD).
G
Hey Johnny,
Just FYI, adding this code didn’t work for me to enable the crawler.
But adding only the 1st line of the code worked fine: (On Litespeed Enterprise server)
CacheEngine on crawler
See more details:
https://docs.litespeedtech.com/cloud/images/cyberpanel/#how-do-i-enable-the-crawler-engine-with-litespeed-enterprise
Thanks,
G.
Johnny
The first line enables crawler. The subsequent lines puts a limit on it, which you can change for your needs/preferences.
Brad
Thanks, a nice resource.
BTW, if you are ever in need of an idea for a new topic, covering ModSecurity Conf/Rules/Rule Packs would be helpful.
Cheers
Johnny
I might consider it one day. If I had tons of free time to kill, I’d probably make my own WordPress-specific rules for ModSec. Until then, maybe something like the Rev3rseSecurity ruleset could be useful to you.
Kris
If we edit the file:
nano /etc/mysql/my.cnf
open_files_limit = 50000
max_allowed_packet = 268435456
innodb_buffer_pool_size = 1G
innodb_log_file_size = 256M
innodb_flush_method = O_DIRECT
innodb_io_capacity = 1000
innodb_old_blocks_time = 1000
innodb_open_files = 5000
key_buffer_size = 16M
read_buffer_size = 256K
read_rnd_buffer_size = 256K
query_cache_size = 256M
query_cache_limit = 5M
join_buffer_size = 4M
sort_buffer_size = 4M
max_heap_table_size = 64M
tmp_table_size = 64M
table_open_cache = 4500
table_definition_cache = 4000
thread_cache_size = 50
Then making backups does not work.
Neither ordinary nor incremental.
These settings also don’t work, there’s a problem with that:
innodb_buffer_pool_size = 8G
innodb_log_buffer_size = 1G
innodb_log_file_size = 1G
innodb_write_io_threads = 16
innodb_flush_log_at_trx_commit = 0
query_cache_limit = 256K
query_cache_min_res_unit = 2k
query_cache_size = 80M
tmp_table_size = 64M
max_heap_table_size = 64M
innodb_file_per_table = 1
wait_timeout = 60
Johnny
Thanks for reporting this. I’ll look when I have time.
Ciprian R.
Hi Johnny, thanks for the cheat sheet. Great job.
Just started playing with linux, so be gentle.
Is there a quick way to change pho version?
I use vultr vps and installed cyber panel and litespeed enterprise and even though i choosed 7.4 during installation, phpinfo shows 5.6.4. And i don’t know where to switch. I am used to cpanel but can’t seem to find it in cyber panel or litespeed admin.
Johnny
Have you check out the CyberPanel documentation?
GF
Hi Johnny, love the cheat sheet.
PHP version is changed in the website panel
– List Websites
– Manage
– Change PHP
Constantine
Just brilliant, Johnny! Thanks a lot, and may the Force be with you )