Category Archives: Servers

Vim : how do I search and replace text

Do the following to find and replace text string in a whole file using the Vi text editor : 1. Enter in command mode by typing ” : ” 2. Your command should look like this : :%s/search_for_text/replace_with_this_text/g NOTE : To search & replace a string containing slashes ” / “, use a coma ”… Read More »

MySQL : Can’t open and lock privilege tables

Trying to import a MySQL dump and/or starting mysqld return the following error : [ERROR] bdb:  fatal region error detected; run recovery [ERROR] Fatal error: Can’t open and lock privilege tables: Table ‘host’ is read only Probably the MySQL database directory does not have the right privileges. The permission scheme should look like this :… Read More »

SSL Connection Error : exceeded the maximum permissible length

When trying to open a page through HTTPS, you receive this error : SSL received a record that exceeded the maximum permissible length. (Error code: ssl_error_rx_record_too_long) This is probably due to a vhost IP mismatch/configuration error. The virtual host does not have the right IP address.

Qmail : How to change the default submission SMTP port

By default, the submission port is TCP-587. To change to another value, edit the following file : /var/qmail/supervise/submission/run And simply change the port number just before the last line : /usr/bin/tcpserver -v -R -H -l $HOSTNAME -x $TCP_CDB -c “$MAXSMTPD” \ -u “$QMAILDUID” -g “$NOFILESGID” 0 587 \ $SMTPD $VCHKPW /bin/true 2>&1 Of course, you… Read More »

Bind : unexpected RCODE (REFUSED) resolving

Query refused shown on system log. unexpected RCODE (REFUSED) resolving ‘vhost.domain.tld/A/IN’: xxx.xxx.xxx.xxx#53 This indicate that one of your forwarders deny to resolve the query. You should remove/comment it.

Bind : the working directory is not writable

Directory permission problem shown in system log when starting named. named[xxxx]: the working directory is not writable Owner as well as group should be “named” and both have “read-write-execute” (775) mode. sudo chmod g+w named

Bind : max open files (1024) is smaller than max sockets (4096)

You may see the following notice in the system log. You need to raise the max open file in both system limit file and named configuration. Edit /etc/security/limits.conf and add : named soft nofile 4096 Inside the /var/named/chroot/etc/named.conf, add in the option section : files 4096;

Bind : system log full of network unreachable resolving messages

On RHEL Linux v5, you may expect the following message in your system log : named[xxxxx]: network unreachable resolving ‘vhost.domain.tld/A/IN’: xxxx:xxx:xx::xxx#53 This is because by default, named try to listen IPv6 even if there is no IPv6 configured on the host. So you need to modify /etc/sysconfig/named and add the following parameter to tell bind… Read More »