LAMP


During a domain transfer, while DNS was still propogating I needed to retrieve mail from the old server to the new.

I did so thusly…
# yum install fetchmail

$ touch .fetchmailrc
$ chmod 600 .fetchmailc

I then added the following lines to .fetchmailrc

poll <remote_ip> with proto POP3
user <remoteemail@example.com> there with password "<password>" is "<localemail@example.com" here

Then once ensuring you can POP3 out of the server (port 110) through the firewall, you can just run ‘fetchmail’ from the command line to grab the mail.

Topping it off with a cronjob for the duration of DNS propogation would probably be a sensible finish.

References:

http://theos.in/news/howto-configure-fetchmail-linux-or-unix-client-program-to-fetch-emails/

http://www.catb.org/~esr/fetchmail/fetchmail-FAQ.html

I’ve been playing with CentOS 5 lately, and really needed KeePassX on it. I ran into a few problems…

No rpms for Centos means you have to try and build from source. You also need qt-devel on the machine but it has to be version 4.3 or greater to compile.

So I had to enable atrpms-testing and use their bleeding edge qt44-devel.

This conflicts with qt-devel, so you need to ditch that first if it’s around. It also needed a few other dependencies that weren’t picked up.

# yum remove qt-devel qt4 dt4-devel
# yum install gcc-c++ libXtst-devel.x86_64 qt44 qt44-devel

For some reason, even though I didn’t have qt-devel on the machine, the command line yum found conflicts between atrpms-testing qt44-devel and qt-devel, and it took the GUI package manager to actually install it.

Once all that lot is in place, you should be able to unzip the tar and enter the keepassx directory.
# qmake-qt44
# make
# make install

All seems happy now.

www.keepassx.org/downloads
atrpms.net/install.html

When installing memcached on my CentOS 5.2 box using the rpmforge repo, I found apache/php complaining of API version problems.

To get round it I first used PECL to install memcached, then used yum to set memcached to work nicely with the Redhat style environment.
# pecl install memcache
# yum --enablerepo=rmpforge install memcached
# yum install php-pecl-memcache

Thinking back, I believe I needed libevent, libevent-devel, zlib and zlib-devel to get the PECL install to work too.
# yum install libevent libevent-devel zlib zlib-devel
I saw the errors initially when version checking PHP.. after restarting apache the following command seems happy…
# php -v
and there are a couple of config files you can play with here…
/etc/sysconfig/memcached
/etc/php.d/memcache.ini
Happy speed hunting!

I had to enable quota support to my hard disk mounts on one of my new Plesk boxes today. This lets Plesk manage how much space is given to whomever… very necessary for a virtual hosting box.

I found these instructions on the Plesk forum, but not all in one place, hence…

Add ‘usrquota’ to the options in fstab. Mine looked like this before and after…
before
/dev/md0 / ext3 defaults 1 1

after
/dev/md0 / ext3 defaults,usrquota 1 1

Then run these to get quotas working…
# mount -o remount /
# quotaoff -av
# quotacheck -avum
# quotaon -av

..and that should be you good to go.

In the event that Linux has a rare turn and decides to crash on you, you might want the machine to reboot if at all possible. The following will give you that ability. It should probably be paired with dumping any crash info out to a network server (hence the long pause – 300 secs), but very useful in any event for remote webservers.

Add the following entries to your sysctl.conf…

# vi /etc/sysctl.conf

kernel.panic_on_oops = 1
kernel.panic = 300

Then run these commands as root to enable these changes without needing to reboot:
# sysctl -w kernel.panic_on_oops=1
# sysctl -w kernel.panic=300

Next Page »