Random useful linux notes

Redhat Enterprise 3 cPanel DNS breaking

Not 100% sure at this point but some servers are having DNS break tonight after a UPCP running. The only thing we have narrowed it down to at this point is having RHEL 3 and cPanel on the box. When UPCP runs it breaks named and stops it from responding to anything. The fix is simple just do:




up2date -u bind-libs
service named restart





That should be it =-)

Mysql 5.0 RHEL4 install problem

I was recently installing mysql 5.0 on a RHEL 4 box and was getting the following really weird error:

[root@mysql mysql]# service mysql start
Starting MySQL ERROR! Couldn't find MySQL manager or server

After looking at all the install documents and making sure I did nothing wrong and that mysql 5.1 did not just need some weird install I found a bug report:

http://bugs.mysql.com/bug.php?id=18820

The last post gives a very simple solution of just commenting out the basedir= and it will start fine, which it does. Once you fix the configuration file the mysqld will work normally, this is apparently just a bug/problem in the current rpms for rhel4 and not in the source or any other release.

Never users error list for email

When having trouble with email I got the following error in the exim_paniclog on a cpanel server:

User 0 set for local_delivery transport is on the never_users list

The issue appears to be with some of the libraries the following commands should fix it:

ln -s libdb2.so.3 libdb.so.3
/scripts/eximup --force
/etc/rc.d/init.d/exim restart

Thanks to this thread on cpanel forums that I found after a little bit of searching for this fix:
http://forums.cpanel.net/showthread.php?p=135790

cPanel's fix for perl

This email was sent out to all of those who directly purchase cPanel licenses, of course if you are like most people and do not directly own a license but get it through a datacenter you never got this email. I have pasted it below which also contains a fix for the perl problems which are causing a lot of trouble with just about everything, including email. I have corrected a few typo's in the email so that just copy and pasting it will now work, it was not working for their version, and added a few more commands that I needed on some servers.
Updated Jan 13th with the latest version of cpan

Here is the copy/paste version I created:
ls -alh /root/.gnupg
(just make sure it exists)

cd /usr/local/src/
wget http://search.cpan.org/CPAN/authors/id/G/GA/GAAS/libwww-perl-5.805.tar.g...
tar zxvf libwww-perl-5.805.tar.gz
cd libwww-perl-5.805
perl Makefile.PL
make
make install
cd ../

wget http://search.cpan.org/CPAN/authors/id/A/AN/ANDK/CPAN-1.83.tar.gz
tar zxvf CPAN-1.83.tar.gz
cd CPAN-1.83
perl Makefile.PL
make
make install

/usr/local/cpanel/bin/checkperlmodules
/scripts/updatenow
/scripts/rrdtoolinstall

cPanel perl failing to be setup correctly

As is usual with cPanel another thing has become broken, this time however it is pretty serious. It appears that somebody borked the entire perl setup within cPanel which obviously is a very quick way at ruining cPanel. At this time there is apparently a fix in edge, though I have no want to test it when you can fix it manually. The fix is luckily pretty easy simply run:

perl -MCPAN -e shell

and just hit enter a whole lot of times when it comes up with the perl configuration. I usually select "EUMM" then 5 (north america) 4 (USA) then any random number you see listed for a mirror. After that point you should be good to go and perl should be working.

If you are still having trouble with perl not working then take a look at:
http://www.eth0.us/net-aim-pm

it has some more fixes. Between these two pages I have been able to fix every server so this should work fine. The one it did not I had to completely rpm -e perl and reinstall it.

To reinstall:
up2date --get perl

Can't locate Net/Aim.pm

This error is cropping up on a lot of new cPanel installs:

Can't locate Net/AIM.pm in @INC (@INC contains: /usr/lib/perl5/5.8.7/i686-linux /usr/lib/perl5/5.8.7 /usr/lib/perl5/site_perl/5.8.7/i686-linux /usr/lib/perl5/site_perl/5.8.7 /usr/lib/perl5/site_perl/5.8.0 /usr/lib/perl5/site_perl . /scripts /scripts /scripts /scripts /scripts /scripts)

Once I installed the net aim stuff I started to get a new error:

Can't locate Tie/IxHash.pm in @INC (@INC contains: /usr/local/cpanel /usr/lib/perl5/5.8.7/i686-linux /usr/lib/perl5/5.8.7 /usr/lib/perl5/site_perl/5.8.7/i686-linux /usr/lib/perl5/site_perl/5.8.7 /usr/lib/perl5/site_perl/5.8.0 /usr/lib/perl5/site_perl . /usr/local/cpanel /scripts /usr/local/cpanel /scripts /usr/local/cpanel /scripts /usr/local/cpanel) at /usr/local/cpanel/Cpanel/Form.pm line 16

Yet another error I was getting:

Can't locate DBI.pm in @INC (@INC contains: /usr/lib/perl5/5.8.7/i686-linux /usr/lib/perl5/5.8.7 /usr/lib/perl5/site_perl/5.8.7/i686-linux /usr/lib/perl5/site_perl/5.8.7 /usr/lib/perl5/site_perl/5.8.0 /usr/lib/perl5/site_perl . /scripts /scripts /scripts /scripts /scripts /scripts /scripts /scripts) at cPScript/Mysql.pm line 23.

Yes more errors:

Mod_python global mutex error

I ran into a problem where apache would not start due to some sort of mod_python error. This is typically something you only see on a busy server. If you get the following error:

[error] (28)No space left on device: mod_python: Failed to create global mutex 0 of 4 (/tmp/mpmtx175910).
Configuration Failed

Simply run the following to fix it:

echo "kernel.sem = 512 32000 100 512" >> /etc/sysctl.conf; sysctl -p; service httpd start

Quick check for a ddos via number of connections

A quick and usefull command for checking if a server is under ddos is:

netstat -anp |grep 'tcp\|udp' | awk '{print $5}' | cut -d: -f1 | sort | uniq -c | sort -n

That will list the IPs taking the most amount of connections to a server. It is important to remember that the ddos is becoming more sophistcated and they are using fewer connections with more attacking ips. If this is the case you will still get low number of connections even while you are under a DDOS.

Why use a foundry server iron load balancer

Untitled Document

So what exactly is a server load balancer (SLB) and how is it going to help you?

An SLB is a rather expensive, but very effective, way to minimize downtime on an important website that requires 0 downtime. The load balancer that I have the most experience with is the foundry serveriron load balancer that ev1servers currently offers. The primary gain from a load balancer is the ability to host one, or a small group, of websites easily on multiple servers without having to rely on unbalanced solutions like round robin (RR) dns. The load balancer is configured so that each website has a single incoming IP and then when traffic hits the load balancer it will send it to which ever server has the least amount of connections. In this way if for some reason a server starts to slow down and the connections queue up it will stop sending them.

BCC/php spam email and a fix

So I am sure if you are running a cPanel server you are having the exact same trouble as we have been having the last week, lots of spam! It appears there is somebody in this world that has decided to write a rather efficient script that searches for webforms then sends spam via php and bcc. The first quick fix was to enable safe_mode but that obviouslly gets a fair amount of webhosting clients pretty bad. I have been working with mod_security and come up with a pretty simple rule that should help:

SecFilterSelective THE_REQUEST "bcc:|Bcc:|BCc:|BCC:|bCc:|bCC:|bcC:|BcC:"


What that will do is search first for the bcc, Bcc, etc then look for com, org, or net in a url. I was trying to filter it looking for an @ symbol but I was having trouble with apache picking it up. I figure if they are not spamming to one of those TDLs it is probably not a very big attack. If you want to protect more simply add to the list, remember all it has to do is catch one and it blocks the entire request.

Dedicated Server Provider

There are a lot of data centers out there, in fact way too many to easily make a decision. Each datacenter has its own quirks, advantages, and disadvantages. I have had the opportunity to work with many datacenters in the past few years. I am going to list just a few of the ones that we have worked with.


While I am very biased we generally suggest going with an unmanaged provider then getting a help from a third party company, such as mine TotalServerSolutions. This as many advantages, if you ever are dis-satisfied with either the datacenter or management company you can change while still keeping continuity with at least one. If you go with a datacenter that does everything it may be harder.


Highly recommend:
SoftLayer
ThePlanet


Other datacenters that are popular:

About me!


So who is the real eth00? I go by John and currently live a very busy life juggling being a full time Biology major at a local University and running my company, www.totalserversolutions.com

I have been interested in computers for most of my life, in the mid 90's I was introduced to a linux distro and was intreagued by the concept of open source. Fast forward today and I am a huge fan of open source who uses it all the time. I do not program so am unable to contribue directly back to the open source code so instead I have built this site in hopes of sharing some of the information I have learned free. I hope as you search around here you are able to find the answers you were looking for.

Thanks for stopping by and enjoy the stay! If you have any questions that you do not want to post directly on the site there is a contact button on the left you can use to contact me.


John Wigle
"eth00"
Owner TotalServerSolutions

RSS feed for eth0.us

Looking at the web stats it looks like a lot of you have already figured it out already but I was looking at the drupal documents and found that RSS feeds were already built into it. The url to access the RSS is at: http://www.eth0.us/?q=node/feed
Enjoy :)
John Wigle
"eth00"

Powered by Drupal - Theme created by Danger4k