web analytics

Category Troubleshooting

CSF on SolusVM Node

One of my clients wanted to secure their slave nodes with a firewall, and asked to install CSF on the servers. We setup a new slave node and installed CSF and everything was working fine. Created a new VPS, and noticed that the VPS IP Address is not responding. There was no ping to the VPS IP Address from outside. Logged into the server via console and the IP Address was up in the server. However there was no inbound and outbound network connections.


[root@vps ~]# ping google.com

Thinking it could be a resolver problem, I switched the resolver entries to use google DNS as follows.


[root@vps ~]# vi /etc/resolv.conf

Enter the following

nameserver 8.8.8.8
nameserver 8.8.4.4

Save and quit the file. Tried to ping google.com again from the server and it timed out again...

Read More

Solusvm Access Denied !

I was working on my client’s solusvm admin panel that I got kicked out suddenly. I started getting the following message, whatever way I tried to access the admin control panel.


Access Denied! Contact the system administrator for support

I tried various ways to gain access, but nothing worked. The following trick helped me.

I logged in to the server as root via ssh and whitelisted my IP Address.


[root@abc ~]# cd /usr/local/solusvm/tmp/
[root@abc ~]# touch fixwhitelist
[root@abc ~]# chown solusvm.solusvm fixwhitelist
[root@abc ~]# vi fixwhitelist

Then enter your IP Address in that file, save and restart solusvm.

[root@abc ~]# /etc/rc.d/init.d/solusvm restart
Stopping solusvm: [ OK ]
Starting solusvm: [...

Read More

Fatal error: Class ‘Net_SMTP’ not found in /usr/local/lib/php/Mail/smtp.php on line 349″

I was trying to setup a php script to send mail with SMTP Authentication. The script was ready, but when executed in a browser, it displayed the following error.

Fatal error: Class ‘Net_SMTP’ not found in /usr/local/lib/php/Mail/smtp.php on line 349″

The problem appears because the php pear package Net_SMTP is not present in the server. You can install it in two way.

  1. Install the Mail package with –alldeps which will install all required dependencies like Net_SMTP

pear install –alldeps Mail

If Mail is already installed, and if it refuses to get installed then you can force the installation as follows.

pear install –alldeps -f Mail

2.  If Mail is already installed, then you can install the Net_SMTP option alone as follows.

pear install Net_SMTP

After that, execute the script again and...

Read More

df showing wrong result

My mysql server suddenly started showing my disk space usage as almost full.

[root@abc /]# df -h
Filesystem      Size  Used Avail Use% Mounted on
/dev/sda3       550G  508G   14G  98% /
tmpfs            32G     0   32G   0% /dev/shm
/dev/sda1       2.0G  173M  1.8G   9% /tmp

But when I issued a disk usage check on / , it returned the usage to be very little.

[root@abc /]# du -sch
47G     .
47G     total

I was sure there is something wrong. Hence, I checked for deleted files. You can use either of the following commands.

[root@abc /]# lsof +L1

mysqld    23193     mysql    5u   REG    8,1          184     0       13 /tmp/ibrUf6yr (deleted)
mysqld    23193     mysql    6u   REG    8,1            0     ...

Read More

(28)No space left on device: mod_rewrite: Parent could not create RewriteLock file

Noticed this error in a cpanel server while starting apache. Apache refused to start with the following error.

(28)No space left on device: mod_rewrite: Parent could not create RewriteLock file

Seeing the error, the first thing that I checked was the disk space in the server but it looked fine.

root@abc [~]# df -h
Filesystem            Size  Used Avail Use% Mounted on
/dev/mapper/vg0-root   16G  1.2G   14G   8% /
/dev/mapper/vg0-home  249G  124G  113G  53% /home
/dev/mapper/vg0-var    23G  7.0G   15G  33% /var
/dev/mapper/vg0-usr    23G  7.6G   14G  36% /usr
/dev/mapper/vg0-tmp   9.5G  151M  8.9G   2% /tmp
/dev/sda1             7.4G  184M  6.9G   3% /boot
tmpfs                 7.9G     0  7...

Read More

Error: Missing Dependency: python(abi) = 2.6 is needed by package s3cmd-1.0.0-4.1.x86_64 (s3tools)

I was trying to install s3cmd in my centos6 server when i got the following error.

s3cmd-1.0.0-4.1.i386 from s3tools has depsolving problems —> Missing Dependency: python(abi) = 2.6 is needed by package s3cmd-1.0.0-4.1.i386 (s3tools)
s3cmd-1.0.0-4.1.x86_64 from s3tools has depsolving problems —> Missing Dependency: python(abi) = 2.6 is needed by package s3cmd-1.0.0-4.1.x86_64 (s3tools)
Error: Missing Dependency: python(abi) = 2.6 is needed by package s3cmd-1.0.0-4.1.x86_64 (s3tools)
Error: Missing Dependency: python(abi) = 2.6 is needed by package s3cmd-1.0.0-4.1.i386 (s3tools) You could try using —skip-broken to work around the problem

If you are getting python dependency issues with s3cmd tools in centos6, please instal EPEL repo and it will solve it.

wget http://dl...

Read More

IIS7 file upload limit of 30M

I had wordpress setup for one of my domains in a windows 2008 server with IIS7. All files uploads upto 30M was working fine, but more than that no luck. Then I read that IIS7 has a default upload limit of 30M. I had to do two things to get it working. Details given below.

Click Start -> Internet Information Services Manager

Click on the webserver name to highlight it(in order to make changes globally) or just click on your website name to enable changes for that site alone.

On features view, scroll down to IIS -> Request Filtering.

On the right pane, click on Edit Feature Settings

Look for the field “Maximum Allowed Content Length”. It will be the default value of 30000000

Change the value to 104857600 which is 100M.

Save the changes and restart IIS(usually a restart is not needed)

Now...

Read More

The used command is not allowed with this MySQL version – LOAD DATA LOCAL INFILE

This error normally occurs when you run the ‘load data local infile’ command in mysql.

If you are seeing this error in shell, please check this link

If you are seeing this error while running a php script, here are the following things you can test.

I have a php script as follows for testing.


<?php
mysql_connect(“localhost”,”myuser”,”mypass”)or die(mysql_error());
mysql_select_db(“abc_test”) or die(mysql_error());

$query =”LOAD DATA LOCAL INFILE ‘/home/abc/public_html/test.csv’ INTO TABLE abctesting”;
mysql_query($query) or die(mysql_error());

?>

The file ‘test.csv’ contains some random input and if when this script runs, my database abc_test should populate the table abctesting with contents from the file ‘test.csv’

Unfotunately, when I ran this script over browser, I got the following ...

Read More

530 This FTP server is anonymous only. Login failed.

Ever received the following error while connecting to your site via FTP????

# ftp test.com
Connected to test.com.
220 (vsFTPd 2.3.5)
Name (test):
530 This FTP server is anonymous only.
Login failed.
ftp> bye

You can correct this problem by doing the following in the FTP configuration file.

vi /etc/vsftpd.conf

Now, the following lines will be commented, uncomment them.

local_enable=YES    – this lets the local users login via FTP
write_enable=YES   – this lets the users upload files

Save and quit the file.

/etc/init.d/vsftpd restart

Read More

htaccess pcfg_openfile: unable to check htaccess file

I was getting random forbidden errors on one of my websites one day. It appears and disappears and was not getting an idea as to what had happened. Upon checking the apache error log, I noticed the following error.

[Thu May 16 23:38:13 2013] [crit] [client x.x.x.x] (24)Too many open files: /var/www/vhosts/.htaccess pcfg_openfile: unable to check htaccess file, ensure it is readable, referer: http://abc.com/blog/%20abcd?ades

Normally it happens due to the open files exceeding the limit. I tried the following and that fixed it.

1) A simple restart of apache fixed it all of a sudden.

2) Try ulimit -a as root and  check for “open files”. The default value will be 1024. Try raising it to 4096 as follows.

ulimit -n 4096

3) Also, you can raise this limit for apache by giving it in apache star...

Read More