If you have removed cloudlinux, some hooks can be left on your cPanel:
rm -rf /usr/local/cpanel/hooks/mysql/deluser*
Tag Archives: cPanel
cpanel swap ip, change ip command line
/usr/local/cpanel/bin/setsiteip -u $user $ip
cpanel set exiim IP per account
awk ‘{ print $2″: “$1 }’ /tmp/domianips | sed ‘s/:$//’ >> /etc/mailips
remove duplicated DNS zones from cPanel cluster servers
#!/bin/bash
# Find and remove duplicated DNS zones from cPanel cluster servers
cp -r /var/named /var/named_$(date +%F)
cp /etc/named.conf /etc/named.conf_$(date +%F)
> /tmp/all_zones
> /tmp/good
> /tmp/bad
find /var/named -maxdepth 1 -name '*.db' -exec basename {} .db \; > /tmp/all_zones
for z in $(cat /tmp/zonos.txt); do
grep -qE "DNS[0-9]*=$z" /var/cpanel/users/* && echo $z >> /tmp/good
done
grep -vwf /tmp/good /tmp/all_zones > /tmp/bad
wc -l /tmp/good /tmp/bad
wc -l /tmp/all_zones
for z in $(cat /tmp/bad); do
rm -f /var/named/$z.db
done
rm -f /var/named/cache/*
mv -f /etc/named.conf /tmp/
/scripts/rebuilddnsconfig
service named restart
sleep 5
service named status
cPanel: Domain is already configured/owned by another user
When you are trying to add new addon domain, fix:
WHM -> Home -> Server Configuration -> Tweak Settings
Updating Allow domain parking across accounts from Off to On.
The system experienced a problem during the creation of the “testadress” subdomain.
cat /usr/local/cpanel/logs/error_log | grep sub
You can get this error, when: You have exceeded the maximum allowed subdomains.
cpanel make ip shared
Add 192.168.0.1 IP as shared.
vi /etc/reservedips
192.168.0.1
mkdir /var/cpanel/mainips
vi /var/cpanel/mainips/root
192.168.0.1
DBD::mysql::db do failed: Illegal mix of collations
Full error message:
DBD::mysql::db do failed: Illegal mix of collations (utf8_general_ci,IMPLICIT) and (utf8_unicode_ci,IMPLICIT) for operation ‘=’
The system failed to lock the file “/home/username/etc/domain.tld/_privs.json” because of an error: Permission denied at /usr/local/cpanel/Cpanel/Transaction/File/Base.pm line 88.
Fix.
chown username.username /home/username/etc/domain.tld/
getpwuid: couldn’t determine user name from uid 4294967295
vi httpd.conf
User nobody
Group nobody
cPanel disable SSL 3
If you are afraid of POODLE Attack, you should disable SSL v3. You can use this ansible playbook:
—
– hosts: test
remote_user: root
tasks:
– lineinfile: dest=/usr/local/apache/conf/includes/pre_main_global.conf line=”#Turn off SSL v3 support\nSSLProtocol All -SSLv2 -SSLv3\nSSLHonorCipherOrder On\n” insertafter=BOF
– name: rebuild httpd confs
command: /scripts/rebuildhttpdconf
notify:
– restart httpd
– name: ensure apache is running
service: name=httpd state=started
handlers:
– name: restart httpd
service: name=httpd state=restarted
The server cannot upgrade to cPanel & WHM version because Microsoft® FrontPage® is installed.
Fix.
rpm -qa | grep -i frontpage
yum remove frontpage-*
/scripts/cpup
cpanel disable ssh redirection
vi /var/cpanel/cpanel.config
alwaysredirecttossl=0
requiressl=0
service cpanel restart
unable assign IPs to nameserver cpanel
cat /var/cpanel/nameserverips.yaml
/usr/local/cpanel/scripts/nameserverup
cat /etc/nameserverips
cpanel disable cphulkd for 8 minutes
/usr/local/cpanel/etc/init/stopcphulkd
also you can disable it:
rm -f /var/cpanel/hulkd/enabled
check WHM / cPanel verion
/usr/local/cpanel/cpanel -V
if is stable or released:
grep CPANEL /etc/cpupdate.conf