MySQL: max_allowed_packet

Some times, when you backup or restore your database table with huge binary data, you will get max_allowed_packet error.

By default MySQL set the max_allowed_packet to 10M.
[email protected] [~]# mysqladmin variable | grep max_allowed_packet
| max_allowed_packet                      | 10485760

To fix it, change your MySQL global variable as step below.
1. Open /etc/my.cnf file.
[email protected] [~]# vi /etc/my.cnf

2. Insert the value as below.
[mysqld]
max_allowed_packet = 64M

3. Save it and restart the MySQL services.

How to Check Apache Connections

Apache is one of the famous web services and surpass for more than 100 Million website.

If you have experience in Server Administrator task, you surely headache on the Apache connections when it is getting tons of connections to the server. But, how could you going to check for those connections?

Some command like netstats, grep, ps, etc will very helpful to help you to understand the number of connections of the server.

Mick Genie will guide you some ways to list the Apache connection as below.

Grep port 80 (web services port)

netstat -alntp | grep :80

Check the number of connection from port 80

netstat -alntp | grep :80 | wc -l
ps auxw | grep httpd | wc -l

List the remote IPs connecting to your server on port 80

netstat -ntu | awk '{print $5}' | cut -d: -f1 | sort | uniq -c | sort -nr

List the unique remote IPs and the number of connections from each IP

netstat -alntp | grep :80 | awk ‘{print $5}’ | cut -d: -f1 | sort | uniq -c | sort -n

PureFTP not able to list more than 2000 files?

If you using PureFTP as your FTP server and you might wonder why when you perform FTP action and you are not able to list all of your file.

The answer is because of the default PureFTP setting only allow 2000 files to be shown and this is to avoid the FTP services getting higher usage when you using the FTP services.

To check the setting of PureFTP, you may refer to the file named /etc/pure-ftpd.conf

grep LimitRecursion /etc/pure-ftpd.conf

Result:
LimitRecursion 2000 8

Edit the value to LimitRecursion 5000 8 and save it and this will allow your FTP list 5000 files instead of default 2000 files.

Then restart the PureFTP services.

/scripts/restartsrv_pureftpd

No Space Left on Device

When you restarting the httpd services while the the server found high load, you might get these error.

ERROR: (28)No space left on device: mod_rewrite: could not create rewrite_log_lock

Why you will getting this error? The reason is the semaphore issue. What is semaphore? It is the process used to communicate between active process from Apache.

To check what is the semaphore used, you may use the command as below.

Continue reading No Space Left on Device