Fix cPanel Error -The Email Account Already Exists

  1. Login to your Linux machine via SSH as root user.
  2. Navigate to the following path, locate and remove email account folder in question. /home/domainco/mail/domain.com
  3. Similarly, navigate to the following path, open passwd file with editor of your choice. Remove email account entry from that file and save it. /home/domainco/etc/domain.com
  4. Remove the email id from this file

error: Failed to create domain from /etc/libvirt/qemu/

We had a issue in one of the virtualizor node

Where the server on rebooting the KVM VM were not starting

With error message being

error: Failed to create domain from /etc/libvirt/qemu/
error: Cannot get interface MTU on ‘viifbr0’: No such device

ON checking around found the issue with virtnetwork

Below command fixed the issue

service virtnetwork start

~]# service virtnetwork start
Bringing up viifbr0 – OK
Waiting for 10 seconds…1…2…3…4…5…6…7…8…9…10
Internet connectivity check successful viifbr0 – OK

Open port in Centos 7

Below are the commands which are to be used in centos 7 to open port 80

[root@onlinesupport ~]# firewall-cmd --permanent --zone=public --add-port=80/tcp success

[root@onlinesupport]# firewall-cmd --reload


Mysql Upgrade Process

While upgrading mysql in server make sure you make a backup of existing mysql

using commmand mysqldump --all-databases > all_databases.sql

Once you have complete backup , You can proceed with with upgrade of mysql.

How to add multiple ips in centos 7

In centos 7 by default ifconfig command will not work.
You need to install it using this command yum install net-tools
1.  Create a file in /opt/1.sh
2.  create ip list in an excel sheet,
Example:
ip addr add 198.xxx.xx.xx dev enp6s0f0 label   enp6s0f0:1
ip addr add 198.xxx.xx.xx dev enp6s0f0 label   enp6s0f0:2
ip addr add 198.xxx.xx.xx dev enp6s0f0 label enp6s0f0:3
ip addr add 198.xxx.xx.xx dev enp6s0f0 label enp6s0f0:4
3. Add ips in /opt/1.sh file
4. Execute sh 1.sh for the ips to display in ifconfig
5. For the ips to reflect in ifconfig even after server is rebooted add this command sh /opt/1.sh in /etc/rc.d/init.d/network file and it should be added above exit $rc

/tmp is 100% due to Mysql

Was having an issue where /tmp was getting 100% full every few minutes

on investigation i see the files of 3Gb over there in /tmp

#sql_436_0.MAD

ddvps20 tmp]# ls -al
total 3779332
drwxrwxrwt 12 root root 4096 Sep 21 10:24 .
dr-xr-xr-x 21 root root 4096 Sep 21 09:17 ..
drwxrwxrwt 2 root root 4096 Sep 21 09:17 .font-unix
drwxr-xr-x 2 cpanelsolr cpanelsolr 4096 Sep 21 10:22 hsperfdata_cpanelsolr
drwxr-xr-x 2 root root 4096 Sep 21 10:21 hsperfdata_root
drwxrwxrwt 2 root root 4096 Sep 21 09:17 .ICE-unix
drwx—— 2 root root 16384 Sep 21 09:56 lost+found
lrwxrwxrwx 1 root root 30 Sep 21 10:23 mysql.sock -> ../../var/lib/mysql/mysql.sock
-rw——- 1 cpdigita cpdigita 4096 Sep 21 10:11 .spamassassin1694OHMO4Dtmp
-rw——- 1 cpdigita cpdigita 0 Sep 21 10:17 .spamassassin1694voSq6Ctmp
-rw——- 1 cpdigita cpdigita 0 Sep 21 10:11 .spamassassin1694y0CJyjtmp
-rw——- 1 cpdigita cpdigita 0 Sep 21 10:04 .spamassassin18453ZHMaRtmp
-rw——- 1 cpdigita cpdigita 0 Sep 21 10:06 .spamassassin1845bypIDCtmp
-rw——- 1 cpdigita cpdigita 0 Sep 21 10:03 .spamassassin1845pCtlHqtmp
-rw-rw—- 1 mysql mysql 3866185728 Sep 21 10:07 #sql_436_0.MAD
-rw-rw—- 1 mysql mysql 8192 Sep 21 10:00 #sql_436_0.MAI
-rw——- 1 cpanelsolr cpanelsolr 165 Sep 21 10:22 start_2180387910403356223.properties
drwx—— 3 root root 4096 Sep 21 09:17 systemd-private-1d4af49159364e018772426d7df23a9d-named.service-8XVCsj
drwx—— 3 root root 4096 Sep 21 09:17 systemd-private-1d4af49159364e018772426d7df23a9d-named.service-FyUDBs
drwxrwxrwt 2 root root 4096 Sep 21 09:17 .Test-unix
drwxrwxrwt 2 root root 4096 Sep 21 09:17 .X11-unix
drwxrwxrwt 2 root root 4096 Sep 21 09:17 .XIM-unix

So mysql was going down due to /tmp being full

So as a work around found a better solution

To change the /tmp file to something else for mysql

vi /etc/my.cnf
tmpdir=/mysqltmp

Save the file with :wq

2. Create the /mysqltmp directory

Code:
mkdir /mysqltmp
chmod 1777 /mysqltmp



3. Restart MySQL and check that the tmpdir is now /mysqltmp
Code:
/etc/init.d/mysql restart
mysqladmin var | grep tmpdir
You should see the following return:

Code:
# mysqladmin var | grep tmpdir
| slave_load_tmpdir                       | /mysqltmp
| tmpdir                                  | /mysqltmp

Redirecting HTTP to HTTPS

Redirecting HTTP to HTTPS

RewriteEngine On
RewriteCond %{SERVER_PORT} 80
RewriteRule ^(.*)$ https://www.yourdomain.com/$1 [R,L]

Redirect Only a Specific Domain

RewriteEngine On
RewriteCond %{HTTP_HOST} ^yourdomain\.com [NC]
RewriteCond %{SERVER_PORT} 80
RewriteRule ^(.*)$ https://www.yourdomain.com/$1 [R,L]
Redirecting to HTTPS on a specific folder, add the following: