Sunday, March 16, 2008

Where can I change the time between email queue runs?

Click on the "Tweak Settings" link under "Server Setup". Within the "Mail" section is a text box with the heading:
"Number of minutes between mail server queue runs (default is 60).:"

Change the value and apply the changes by clicking on the "Save" button at the bottom of the page.

why do i get this mysql error: Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2) 0

You should check that mysqld is running first of all. If it is, check to see that it's looking for the correct UNIX socket.

On FreeBSD it would look something like this :
# netstat -f unix grep mysql
x65b33c0 stream 0 0 e5477840 0 0 0 /tmp/mysql.sock

On Linux is would look something like :
# netstat -ax grep mysql
unix 2 [ ACC ] STREAM LISTENING 362783486 /var/lib/mysql/mysql.sock

If you have one and an application is looking for the other, make a symbolic link (ln -s) from the one you see to the one it wants.

Where can I set cPanel to alert users who are close to exceeding disk space limits?

Click on the "Tweak Settings" link under "Server Setup". Within the "Notifications" section is a check box with the heading:

"Disk Space Usage Warnings"

Tick the check box and apply the changes by clicking on the "Save" button at the bottom of the page.

How do I block an IP on my server?

If you want to block access to your server for whatever reason, you will need to log into the shell as root. Your server should either have ipchains or iptables to help accomplish this.

In this example, the attacking IP is 192.168.56.210 .
If you are using ipchains, type "ipchains -A input -j DENY -p all -l -s 192.168.56.210/32"
If you are using iptables, type "iptables -A INPUT -s 192.168.56.210/32 -j DROP"

If you just want to block access to one port from an ip :
iptables -A INPUT -s 192.168.56.210/32 -p tcp --destination-port 23 -j DROP

The above would drop all packets from 192.168.56.210/32 to port 23 (telnet) on the server.

What do I do if CPanel ports 2083 and 2087 do not work?

The stunnel binary listens on these ports and forwards the requests to cpsrvd (the web interface binary). Ensure that it is running.

root@cpdemo [~]# ps wwwaux grep stunnel
cpanel 25180 0.0 0.2 34572 1364 ? S 03:17 0:00 /usr/bin/stunnel-4.04local /usr/local/cpanel/etc/stunnel/mycabundle/stunnel.conf.run
root 31191 0.0 0.1 4764 672 pts/3 S 15:59 0:00 grep stunnel
root@cpdemo [~]#

If it is not running try starting it.

root@cpdemo [~]# ps wwwaux grep stunnel
root 31228 0.0 0.1 4764 672 pts/3 S 16:00 0:00 grep stunnel
root@cpdemo [~]# /usr/local/cpanel/startstunnel
root@cpdemo [~]# ps wwwaux grep stunnelcpanel 31241 0.0 0.3 3696 1656 ? S 16:00 0:00 /usr/bin/stunnel-4.04local /usr/local/cpanel/etc/stunnel/mycabundle/stunnel.conf.runroot 31243 0.0 0.1 4772 672 pts/3 S 16:00 0:00 grep stunnelroot@cpdemo [~]#

What do I do if my MySql.sock file is missing?

1. THIS IS THE MOST IMPORTANT! Back up the /var/lib/mysql directory!!!!!!!
# cp -fr /var/lib/mysql /var/lib/mysql.old

2. Check /var/lib/mysql and /tmp for the .sock file (is it in both places?)

3. Recreate the symbolic link to the .sock file:
# ln -s /var/lib/mysql/mysql.sock /tmp/mysql.sock

4. Now check the permissions of the /var/lib/mysql. It should be 0755 and mysql:root. If not:
# chmod 0755 /var/lib/mysql
# chown mysql:root /var/lib/mysql

5. cat /etc/passwd to make sure that the mysql user is there.

6. Does /var/lib/mysql/mysql/host.MYI exist? If not then:
# chmod -R 0660 /var/lib/mysql/mysql
# chown -R mysql:mysql /var/lib/mysql/mysql
# /usr/bin/mysql_install_db

7. Now try to force an update:
# /scripts/mysqlup --force

8. If all else fails, then you may have a corrupted table. No before you do this, TRIPLE CHECK that you have backed up the /var/lib/mysql directory. It fact, check it 4 times!
# rm -fr /var/lib/mysql
# rm -f /usr/sbin/mysqld Then force another update:
# /scripts/mysqlup --force

Now if all if this did not help, then try:

# /usr/sbin/mysqld --basedir=/ --datadir=/var/lib/mysql --user=mysql --pid-file=/var/lib/mysql/Server_HostName.pid --skip-locking &

What do I do if my quotas show 0 in WHM?

ssh into the server then issue:

/sbin/quotaoff -av
/sbin/quotacheck -augvm
/sbin/quotaon -av