14 September 2011 23:14
Had a need to quickly (and easily) replace some yum packages this evening, namely getting mysql5.0 to 5.5 and php5.1 up to 5.3. I wasn’t looking forward to doing this manually as keeping the dependencies in check is a faff at best. A quick Google however led me to the package yum-plugin-replace. This very easily sorts all the plugins out, flips them in out, shakes them all about and quicker than you can say Robert’s your mother’s brother sorts it all out.
Getting it going is easy:
yum install yum-plugin-replace
yum replace mysql --replace-with mysql55
Do the usual confirmations and you’re done! Same goes with php to php53. This does of course assume you’ve already installed the EPEL and IUS channels to get this packages from.
On a side note, if you do mysql don’t forget to run the upgrade script.
mysql_upgrade --password
Filed: Technology // Tagged: centos, mysql, php, yum //
16 May 2011 22:21
Just because I can really I setup Dropbox syncing on one of my CentOS 5 servers. It’s a little bit of a faff, but, not that hard. The official guide is online, but, this is a shorten version and might not cover everything but it worked on my headless VM just fine.
First up su to whichever user you want to install Dropbox as. You’ll need two terminal’s open so fire them both up now. You’ll also need lynx, gcc and python installed so if you don’t have, sort that out with yum.
In your home directory grab the correct binary for you (x86 or x86_64).
wget -O dropbox.tar.gz http://www.dropbox.com/download/?plat=lnx.x86
wget -O dropbox.tar.gz http://www.dropbox.com/download/?plat=lnx.x86_64
Now unpack it and start it up in your first terminal window.
tar xvfz dropbox.tar.gz
~/.dropbox-dist/dropboxd
Now in your second terminal go to http://dropbox.com using lynx (lynx http://dropbox.com) and login, then using the key shortcut “g” paste in the URL that your first window should now be prompted you to go to. This is to register the machine with your Dropbox account. You’ll need to scroll down the page to re-enter your password. Once done the first window should say hello to you and it’ll quit.
Next up sort out the init.d script. Put the following in /etc/init.d/dropbox and chown 755 it when you’re done.
# chkconfig: 345 85 15
# description: Startup script for dropbox daemon
#
# processname: dropboxd
# pidfile: /var/run/dropbox.pid
# config: /etc/sysconfig/dropbox
#
### BEGIN INIT INFO
# Provides: dropboxd
# Required-Start: $local_fs $network $syslog
# Required-Stop: $local_fs $syslog
# Should-Start: $syslog
# Should-Stop: $network $syslog
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Start up the Dropbox file syncing daemon
# Description: Dropbox is a filesyncing sevice provided by dropbox.com
# This service starts up the dropbox daemon.
### END INIT INFO
# Source function library.
. /etc/rc.d/init.d/functions
# To configure, add line with DROPBOX_USERS="user1 user2" to /etc/sysconfig/dropbox
# Probably should use a dropbox group in /etc/groups instead.
[ -f /etc/sysconfig/dropbox ] && . /etc/sysconfig/dropbox
prog=dropboxd
lockfile=${LOCKFILE-/var/lock/subsys/$prog}
config=${CONFIG-/etc/sysconfig/dropbox}
RETVAL=0
start() {
echo -n $"Starting $prog"
if [ -z $DROPBOX_USERS ] ; then
echo -n ": unconfigured: $config"
echo_failure
echo
rm -f ${lockfile} ${pidfile}
RETURN=6
return $RETVAL
fi
for dbuser in $DROPBOX_USERS; do
daemon --user $dbuser /bin/sh -c "/home/$dbuser/.dropbox-dist/dropboxd&"
done
RETVAL=$?
echo
[ $RETVAL = 0 ] && touch ${lockfile}
return $RETVAL
}
status() {
for dbuser in $DROPBOX_USERS; do
dbpid=`pgrep -u $dbuser dropbox | grep -v grep`
if [ -z $dbpid ] ; then
echo "dropboxd for USER $dbuser: not running."
else
echo "dropboxd for USER $dbuser: running (pid $dbpid)"
fi
done
}
stop() {
echo -n $"Stopping $prog"
for dbuser in $DROPBOX_USERS; do
killproc /home/$dbuser/.dropbox-dist/dropbox
done
RETVAL=$?
echo
[ $RETVAL = 0 ] && rm -f ${lockfile} ${pidfile}
}
# See how we were called.
case "$1" in
start)
start
;;
status)
status
;;
stop)
stop
;;
restart)
stop
start
;;
*)
echo $"Usage: $prog {start|status|stop|restart}"
RETVAL=3
esac
exit $RETVAL
Edit /etc/sysconfig/dropbox and add the following line to match your linux account where you’ve installed Dropbox.
DROPBOX_USERS="linux_user_name"
Make sure it starts on boot.
chkconfig dropbox on.
That’s it. Enjoy.
Filed: Technology // Tagged: centos, dropbox, sync //
23 January 2011 21:05
There’s a bunch of stuff that you can’t always find in the standard CentOS/Redhat repositories. The main repositories I’ve used are EPEL, IUS, REMI and in a specific case Cloudera’s. I used the Cloudera one for flume, but, it’s a quick way to get it installed and the various Hadoop odd’s and end’s. The IUS one is good for MySQL 5.1 and Percona builds, also Git 1.7. The EPEL repo has stuff like Redis and also other newer versions.
If you don’t want to use one you can alias commands to use repos, so, for instance if you have a CentOS build with all the above install you’d get output from yum repolist something like this:
addons CentOS-5 - Addons
base CentOS-5 - Base
cloudera-cdh3 Cloudera's Distribution for Hadoop, Version 3
epel Extra Packages for Enterprise Linux 5 - i386
extras CentOS-5 - Extras
ius IUS Community Packages for Enterprise Linux 5 - i38 enabled
updates CentOS-5 - Updates
If you want to install/search from a specific repo you can either disable them all in the /etc/yum.repos.d/*.repo files and then enable them when you run yum, or, you can leave them all enabled and disable them one by one. Something like this:
alias yum-ius='yum --disablerepo=addons,base,epel,extras,updates,cloudera-cdh3'
alias yum-cloudera='yum --disablerepo=addons,base,epel,extras,updates,ius'
alias yum-epel='yum --disablerepo=addons,base,extras,updates,ius,cloudera-cdh3'
Filed: Technology // Tagged: centos, redhat, repositories, yum //
23 January 2011 20:56
If you’ve installed CentOS 5.x using Oracle (Sun) VirtualBox then you’ll have probably had fun getting the guest additions to work. After doing this a few times, each time forgetting which commands I need I’m going to blog it if for nothing but refence!
sudo yum -y install gcc kernel-devel kernel-headers
After you’ve rebooted you should be good to go, again. If you don’t have the right kernel it will moan about OpenGL support, but, you don’t need it.
Filed: Technology // Tagged: centos, virtualbox, vm //
30 August 2010 17:43
Not a particularly exciting first post back after so long with nothing but hopefully it’s useful none the less. On a CentOS box you can’t get MySQL 5.1 or PHP 5.3 easily from yum. Luckily a chap known as remi as a handy repo that contains both said packages.
To get the repo running you’ll need to install a couple of RPM’s:
epel-release-5-4.noarch.rpm
remi-release-5.rpm
To install them:
rpm -Uvh epel-release-5*.rpm remi-release-5*.rpm
After that jump into /etc/yum.repos.d where you should now have a remi.repo file. Edit that and change enabled=0 to enabled=1 and you’re good to go. Do a yum check-updates and install away.
Filed: Technology // Tagged: centos, mysql, remi, yum //
12 June 2009 23:06
I’ve finally got resin, railo and caucho playing together in a nice, no longer ripping each other’s hair, out kind of way. I have to say my biggest comment (and probably one of the more tricky things to do) is that for Railo to become a big player in trying to take away Adobe’s CF user base installers are going to be essential. That said railo does seem quicker on processing CFML (need to do more tests to verify that).
I’ve got apache 2.2.3 running on CentOS 5.3. I have railo 3.1.0.015 (not updated to 016 yet) and caucho.
My resin.conf has this addition (multiple times for the different domains):
<host id="www.domain.co.uk" root-directory="/home/domain/public_html">
<host-name>www.domain.co.uk</host-name>
<host-alias>domain.co.uk</host-alias>
<web-app id="/" document-directory="."/>
</host>
The apache virtual hosts are just normal vhosts. No extras.
My caucho.conf (in /etc/httpd/conf.d) looks like this:
LoadModule caucho_module /usr/lib64/httpd/modules/mod_caucho.so
ResinConfigServer localhost 6800
CauchoConfigCacheDirectory /tmp
CauchoStatus yes
<Location /caucho-status>
SetHandler caucho-status
</Location>
Hopefully that might help someone out. I’m going to try and do a from scratch CentOS build guide for The Rackspace Cloud sometime next week. I’ve started migrating some sites over to the cloud server and so far not hit any issues.
Filed: Technology // Tagged: apache, caucho, centos, railo, resin //