Accept Mutex Error in apache error log

Error we see in apache error log:

(22)Invalid argument: couldn’t grab the accept mutex
(22)Invalid argument: couldn’t grab the accept mutex
(22)Invalid argument: couldn’t grab the accept mutex

This may happen because of low memory or improper file handlers

Please add the following in apache conf and see the changes.

AcceptMutex fcntl

then

/usr/local/cpanel/bin/apache_conf_distiller –update –main
/scripts/rebuildhttpdconf
/etc/init.d/httpd graceful

Know which vps is having the process running on by standing in main Node.

We know about Hardware Node and small vps servers inside it. We usually think, regarding to know about what all process running in vps only after entering into that particular VPS.

Using command vzpid you can know from Node, which VPS of that node the process is running on and what process is it. Get the process ID from node and try it with command vzpid.

vzpid pid

You will get result like as follows:

Pid VEID Name
22620 182 clamd

cdp-agent not running and also not starting when try to manually start it.

Error:

root@ [~]# /etc/init.d/cdp-agent status
/etc/init.d/cdp-agent status: cdp (pid 753?) not running

You can grab the error generating from the r1soft log
(/usr/sbin/r1soft/log/cdp.log), there you can find the exact reason.

The error would be like as follows:
============
,[ERROR],[NO-CONNECTION],Exception from network
server: Address already in use
============

This happens when port 1167 is on use. The issue can be sorted out by using the following steps.

If your Agent hangs up and is not restarting properly,
check Agent port is used by hcp demon

lsof -i :1167 #1167 default agent port

~]# lsof -i :1167
COMMAND PID USER FD TYPE DEVICE SIZE NODE NAME
hcp_io/1/ 2250 root 8u IPv4 191316993 TCP *:1167 (LISTEN)
hcp_io/1/ 2256 root 8u IPv4 191316993 TCP *:1167 (LISTEN)
hcp_io/1/ 2257 root 8u IPv4 191316993 TCP *:1167 (LISTEN)
hcp_io/1/ 2258 root 8u IPv4 191316993 TCP *:1167 (LISTEN)

you see that hcp working so , you must stop hcp activity :

hcp -r /dev/hcp1 (/dev/hcp1 : example)

now ! you can restart agent easily :
/etc/init.d/cdp-agent restart

check the status now

# /etc/init.d/cdp-agent status
/etc/init.d/cdp-agent status: cdp (pid 10238) running

Simple 🙂

Blank page on domain after installing Drupal through softaculous.

It is nothing but, just check if PHP module mysqli is compiled and enabled in the server.
Search the list “php -m” for mysqli. If present make sure the correct extension_directory is set in the php.ini and enabled extension=mysqli.so as well.

If not present, recompile php(include current modules present and in addition add mysqli too). After that check the module comes in the list “php -m” and enable extension=mysqli.so in the php.ini file. Then try loading the drupal page or remove it and reinstall using softaculous again.

It will load fine then 🙂

Issue when try to add new IP address in VPS server

This is something generic to uncommon errors, this issue arises when we try to add new IP in vps server.

When we click on the option “Add a New IP Address” under IP Functions on WHM, we get the following error sometimes.

“To add, edit, or remove IPs, please contact your server administrator”

This can be solved by adding the new IP manually in two seperate files of VPS server.

1) One is, add IP in the format like –> IP Address + Netmask to /etc/ips inside the correct VPS to which you wish to add the new IP

* Restart ipaliases (/etc/init.d/ipaliases restart)

2) Secondly, by standing in the main node, add the IP in vps configuration file.

For example, if virtual server ID is 123,

* vi /etc/vz/conf/123.conf

* search for line “IP_ADDRESS”

– Add your new IP in the line IP_ADDRESS=”x.x.x.x y.y.y.y z.z.z.z”

* Restart the VPS (vzctl restart 123)

* Done and your new IP is added, you can see the new IP in “Show IP Address Usage” of WHM.

create SWAP space in Linux Servers

You need to use the dd command to create swap file. The mkswap command is used to set up a Linux swap area on a device or in a file.

Login as root user, and use the following command to create a swap file.

The following dd command example creates a swap file with the name “tmpDSK” under /backup directory with a size of 2000MB (2GB)

# dd if=/dev/zero of=/backup/tmpDSK bs=1M count=2000

Setup correct file permission for security reasons, enter:

# chown root:root /backup/tmpDSK
# chmod 600 /backup/tmpDSK

Make this file as a swap file using mkswap command.

# mkswap /backup/tmpDSK
Setting up swapspace version 1, size = 2097147 kB

To make this swap file available as a swap area even after the reboot, add the following line to the /etc/fstab file.

/backup/tmpDSK swap swap defaults 0 0

Enable the newly created swapfile.

# swapon /backup/tmpDSK

# free -m
total used free shared buffers cached
Mem: 4050 3222 828 0 210 2589
-/+ buffers/cache: 422 3628
Swap: 1999 0 1999

Enable Wildcard E-mail

This is a trick I have enabled through cPanel account, but it worked to enable wildcard email.

Just like wildcard domains, there is a technique exists for routing mails send to non-existing email accounts to a legitimate email account situated in a particular domain. This method can generally be called as Wildcard E-mail

Suppose a client open up a ticket where he is requested to set a wilcard email to test@mydomain.com, where this email account should be an existing one in the domain. And he wants all mails sending to wild.*@mydomain.com(a non existing account and the “*” could be anything) would be delivered to test@mydomain.com.

The above request can be fulfilled by setting the following Account Level Filtering rule.

Put a Filter name as ‘wildcard’ or something identifiable name

Then Rule as, “To begins with”

keyword as ‘wild’ ( where ‘wild’ here means any non existing email accounts starting with that term, ie wild*@mydomain.com, the client wanted here)

Actions, “Redirect to email” “test@mydomain.com”

You are done!!!

From now onwards mails sending to wild*@mydomain.com, ie wild1, wild123, wild*** etc would be delivered to test@mydomain.com.

Proper Installation of Imagemagick

Please do the following steps for installing imagemagick.

You can install imagemagick using the script

/scripts/installimagemagick

If the installation is not successful, please download and install it from source file.

Download –> ImageMagick-6.7.7-3.zip
cd /downloaded/path – mostly /usr/src/
unzip ImageMagick-6.7.7-3.zip
cd ImageMagick-6.7.7-3
./configure
make
make install

If you are installing imagamagick from source, then you need to install perl magick also. The perl magick is included in the imagemagick untared directory.

cd /usr/src/ImageMagick-6.7.7-3/PerlMagick/
perl Makefile.PL
make
make install

Some php scripts need imagick need to be installed.

Download imagick-2.3.0.tgz to /usr/src
cd /usr/src
tar -xvzf imagick-2.3.0.tgz
cd imagick-2.3.0/
phpize
./configure
make
make install

You need to add the extension file extension=imagick.so in the php.ini file.

You can check the version of imagemagick using the following command

convert -v

You can check whether imagemagick and perl magick installed successfully using the following command

/scripts/checkimagemagick

tadaaaa 😀