web analytics

Monthly Archives January 2014

Diskusage of a few domains shown as 0 in Cpanel/WHM

Last day a few domains started throwing incorrect disk usage in WHM. The accounts has a lot of files, but the disk usage was reported as 0 in List Accounts section. Upon checking noticed that someone had played with the fstab and /home was not mounted with usrquota correctly. Did the following to correct it.

[root@abc ~]# cp -pv /etc/fstab /etc/fstab.bak.$(date +%F)

[root@abc ~]# vi /etc/fstab       Add/modify the mount point for home as follows

/dev/mapper/vg0-home    /home   ext4      defaults,usrquota             1       2

[root@abc ~]# mount -o remount /dev/mapper/vg0-home

Alternatively, you can reboot the machine, so that the changes will be picked up from the fstab after making changes.

[root@abc ~]# /scripts/fixquotas –force

When it is executed,...

Read More

Configuring SSL in nginx

Suppose you have a domain greproot.com for which you want to enable SSL. Make sure you have a dedicated IP for the domain. Say, 1.2.3.4 is the dedicated IP address for greproot.com

First, decide where you want to keep your certs and keys. In my case, I am going to place it in /etc/ssl/certs/ and /etc/ssl/keys respectively.

[root@abc ~]#mkdir /etc/ssl/certs/

[root@abc ~]#mkdir /etc/ssl/keys

Now we need to generate CSR and key for the greproot.com, get the cert signed and then install SSL.

[root@abc ~]#cd /etc/ssl/keys

[root@abc ~]#openssl genrsa -out greproot.com.key 2048

[root@abc ~]# chmod 600 greproot.com.key

[root@abc ~]# cd /etc/ssl/certs/

[root@abc ~]#openssl req -new -key greproot.com.key -out greproot.com.csr

Now we have the CSR and key...

Read More

[ERROR] Fatal error: Can’t open and lock privilege tables: Table ‘mysql.host’ doesn’t exist

I was working on a mysql server one day and mysql was refusing to start. There were no errors in logs, hence I started mysql with mysqld_safe which displayed the error as follows.

[ERROR] Fatal error: Can’t open and lock privilege tables: Table ‘mysql.host’ doesn’t exist

Upon checking the data dir at /var/lib/mysql, I noticed that the folder for mysql database is missing. Hence I issued the following command and it installed the db just fine. After that I was able to restart mysql without issues.

mysql_install_db

Read More