eth00's blog

Sphinx install problems

While doing a make on sphinx we got:

sphinx.cpp:16792: error: ‘m_pMysqlFields’ was not declared in this scope
sphinx.cpp:16793: error: ‘m_pMysqlResult’ was not declared in this scope
sphinx.cpp:16793: error: ‘mysql_fetch_fields’ was not declared in this scope
sphinx.cpp:16795: error: ‘m_pMysqlFields’ was not declared in this scope
make[2]: *** [sphinx.o] Error 1
make[2]: Leaving directory `/usr/local/src/sphinx-0.9.8.1/src'
make[1]: *** [all] Error 2
make[1]: Leaving directory `/usr/local/src/sphinx-0.9.8.1/src'
make: *** [all-recursive] Error 1

simply install mysql-devel rpm and should compile fine.

Welcome to the new page!

It has taken me awhile to get it up and running but I finally have released the new site! I went back and updated quiet a few of the older guides as well as the drupal back end that the site runs. It now runs the latest 5.x version which has all sorts of new features. The old site had a few problems on the back end but those should all be cleared up at this point and everything running smooth. I will also be trying to keep up with the posting on here to always have new and updated information.

Enjoy your stay!

John

Ensim X python upgrade problems

Ensim python upgrade problems:

If you end upgrading python when doing an overall system update you may start to obtain internal server errors on every page within the ensim control panel. To fix this you need to recompile the templates and restart ensim:

cd /usr/lib/ensim/frontend/kidpages/
/usr/bin/kidc -f *
service epld restart

That should fix it!

Here is the full error you may be receiving:

2007/08/29 06:33:49 HTTP INFO 127.0.0.1 - GET /isp/services/proftpd/index HTTP/1.1
2007/08/29 06:33:49 INFO Traceback (most recent call last):
File "/usr/lib/python2.4/site-packages/cherrypy/_cphttptools.py", line 271, in run
main()
File "/usr/lib/python2.4/site-packages/cherrypy/_cphttptools.py", line 502, in main
body = page_handler(*args, **cherrypy.request.paramMap)
File "/home/build/qa/saber/10.0.0/fc.4/13.fc.4/epl/pudasin13/build/build-root/epl/frontend/rootapp/isp/services/proftpd/__init__.py", line 20, in index

Quick way to add SWAP

While it would be ideal if every server had plenty of RAM in the real world that does not happen. If for some reason you have a server with too little SWAP or you are hitting the max of the swap here is a quick hack which will create a 2Gb container file then use it for additional swap space on the server. To check the swap space used you can use "free -m".


dd if=/dev/zero of=/usr/swap-file bs=1024 count=2048000
mkswap /usr/swap-file
swapon /usr/swap-file
swapon -s

Now add the following to the /etc/fstab and you are done.



/usr/swap-file swap swap defaults 0 0

Disable direct root login

While directly logging into a server as root is certainly easy it is not the best choice from a security standpoint. Disabling direct root logins is not something that instantly makes a server impervious but it does help fight against petty brute force script kiddies. There are two options when disabling direct root login, one is to have them completely disabled and the other is to have it only with an ssh key. Make SURE that you add another user you can ssh into. If you are using cPanel use WHM --> Manage wheel users and add your user. Once logging in you can do "su -" you will gain full root access and be able to do your normal administrative commands. Make sure you use su - and not simply su, without the - you will not be on the root path and not have access to all commands.



First open up the ssh config:

nano /etc/ssh/sshd_config

PermitRootLogin

How to significantly cut back spam with cPanel 11 RBLs

Along with the many other GUI enhancements that have come with the new version 11 there have been some MAJOR improvements in how spam is handled. While cPanel has always remained an easy to modify system many people do not like to start modifing configuration files. Those people will be happy to learn that now cPanel 11 includes support for RBL support.


To enable it simply login to WHM and click on "Exim Configuration Editor". From here you have your choice of spamhaus and or spamcop, I generally enable both. You can also set lower limits on SpamAssasin in this menu if you would like to be more sensitive. Keep in mind of course as you raise the sensitivity the chances of legit email getting dropped increase.



Overall good job cPanel! This is a feature that has been needed for awhile but is even more important with the recent wave of spam attacks.

Go php 5!


Its been out for awhile now but in case you have not heard php4 goes EOL at the end of the year. Time to finally drop php4 and keep moving forward. Good luck to all those with old scripts!

Delete stats logs daily

While something that most servers already have enabled from time to we encounter servers with a full domlogs directory so I figure it it worth mentioning. To check how large your apache domain logs are on a cPanel server run "du -hs /usr/local/apache/domlogs". If it is a bit higher then you want or you just want as much free space as possible login to WHM and click Tweak Settings. Within that menu will "Delete each domain's access logs after stats run" which you enable and click save. Now at the end of the stats run every night it will wipe out the directory so you should not have the logs grow very large, unless of course your server is very busy.

Lenovo X60t tablet with SXGA ordering woes -- shipping delayed for parts

***Update*** It took 3 months but I finally received the x60 tablet and love it! While there certainly were a LOT of delays earlier on Lenovo seems to have fixed them and now everything should be going smoothly. I hope they learn from this and in the future do a better job keeping in contact with clients.


I am trying something a bit different for my site with this post. While I normally do some sort of technical article I am going to also do more blog style posts, in this case on a laptop that I am in the process of purchasing.


Problems with RBL lists

While I do not think that anybody is going to say that ALL RBL lists for email are a bad thing there are some problems with using them that if you are not careful can cause end users problems. In general they will help a lot but depending on how your mailserver is configured they have the potential to cause just as many heart aches.

The other day we had a few clients complaining that when they sent emails it would take 5-10 seconds most times before they were able to send from their local computer. While not a lot of time it is enough that people were complaining about it. What ended up being the problem was that an RBL list the server was using was having trouble so every time somebody sent an email the RBLs were queried and the 10 seconds was the amount of time it took for the RBL to timeout.

This particular server was Plesk so the /etc/rc.d/init.d/smtp_psa and smtps_psa is where the actual RBLs are stored. The server_args line (shown below) contains all of the lists currently being used to scan email:

php up2date problems with cPanel

While I am not sure why recently I have seen a few cPanel servers with the php rpms installed on them. If you have this problem the following can be done to add php back to the skip list:



up2date --config
20


paste in this:


spamassassin*;httpd*;perl;mysql*;php*;mod_ssl*;courier*;kernel*;exim*;proftpd*;pure-ftpd*;squirrelmail*;

to exit and save

Now go ahead and rpm -qa |grep php and remove the php rpms that are installed. Additionally if you are on a 64bit Redhat Enterprise (RHEL) or CentOS version 3 or 4 you may also need to run:



ln -s /usr/lib64/libmysqlclient.so /usr/lib/libmysqlclient.so


to fix a problem this:

configure: error: Cannot find libmysqlclient library under /usr

rpmdb: fatal region error detected; run recovery

I cam across this error when running anything with rpm:

rpmdb: fatal region error detected; run recovery
error: db4 error(-30982) from dbenv->open: DB_RUNRECOVERY: Fatal error, run database recovery
error: cannot open Packages index

It comes from a lock file and some old datbase files that have been left over. Just clear out the /var/lib/rpm directory, rebuild rpm and it should work fine.

#cd /var/lib/rpm
#rm -f /var/lib/rpm/__db*
#rpm --rebuilddb

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.

php spammer

1. Open exim.conf
pico /etc/exim.conf

2) Find this;
Ctrl + W: hostlist auth_relay_hosts = *

#########################
Runtime configuration file for Exim #
#########################

3) After hostlist auth_relay_hosts = *

add the following

log_selector = +address_rewrite +all_parents +arguments +connection_reject +delay_delivery +delivery_size +dnslist_defer +incoming_interface +incoming_port +lost_incoming_connection +queue_run +received_sender +received_recipients +retry_defer +sender_on_delivery +size_reject +skip_delivery +smtp_confirmation +smtp_connection +smtp_protocol_error +smtp_syntax_error +subject +tls_cipher +tls_peerdn

4) The final result should look like this

hostlist auth_relay_hosts = *

log_selector = +address_rewrite +all_parents +arguments +connection_reject +delay_delivery +delivery_size +dnslist_defer +incoming_interface +incoming_port +lost_incoming_connection +queue_run +received_sender +received_recipients +retry_defer +sender_on_delivery +size_reject +skip_delivery +smtp_confirmation +smtp_connection +smtp_protocol_error +smtp_syntax_error +subject +tls_cipher +tls_peerdn

Powered by Drupal - Theme created by Danger4k