All posts tagged 'linux'

rpm quick hints

As I am recently dealing a lot with rpm I want to share some useful commands:

To view a list of files within an rpm file use:

To extract the files from the rpm use this command

(use cpio -t to list the files)

To extract the pre/post install scripts from the rpm use:

Happy hacking & have fun with rpm!

Multiple Tomcat instances on RHEL (rpm-installed)

Usually Tomcat is really simple to handle – download, extract, start and forget about it. If you need multiple instances of Tomcat on the same machine for performance reasons (if i.e. the database or the file system is the bottleneck) then you usually simply copy the extracted tree, modify some config (server.xml to have different HTTP ports), start it and forget it.

However if you want to rely on the standard rpm (“yum install tomcat5″) this approach does not work very well – the rpm install distributes the tomcat files across the file system. Some parts are in /usr/share, some in /etc/ and the logs are of course in /var/log/. So how do you modify this system to be able to run multiple instances and also benefit from updates that Redhat releases? (And btw, this guide should also apply for other systems, i.e. Ubuntu or CentOS.)

Here is how to do it:

  1. Copy the config files from /etc/tomcat5 to this folder: /etc/tomcat5.1
  2. Modify the /etc/tomcat5.1/server.xml to have unique ports
  3. Create a log directory: /var/log/tomcat5.1 and make sure the group is set to tomcat
  4. Create cache directories /var/cache/tomcat5.1/temp and /var/cache/tomcat5.1/work and make sure the group is set to tomcat
  5. Create a copy of the /usr/share/tomcat5 directory as /usr/share/tomcat5.1 and modify the symlinks in there to point to the newly created folders (conf, logs, temp, work) and remove the bin/ directory and symlink it to /usr/share/tomcat5/bin
  6. Copy /etc/sysconfig/tomcat5 as /etc/sysconfig/tomcat5.1 and replace all instances of “tomcat5″ with “tomcat5.1″ within that file
  7. Copy the /etc/init.d/tomcat5 as /etc/init.d/tomcat5.1 and  replace all instances of “/tomcat5″ with “/tomcat5.1″ within that file

Once these steps are executed you can start the new instance using “service tomcat5.1 start”. This works for any number of instances and will share the Web apps as well (so no multiple deployments needed) and should improve performance if you use Apache + mod_jk in front of Tomcat.

mbaierl is not in the sudoers file

Hm… finally I know where all those incidents are reported…

Thanks xkcd & Merry Christmas everyone!

kmem russian roulette

Aquillar> hey, you guys ever play kmem russian roulette?
Agnostos> I don’t believe I have. care to explain the details?
Aquillar> dd if=/dev/urandom of=/dev/kmem bs=1 count=1 seek=$RANDOM
Aquillar> keep executing until system crashes
Aquillar> person that crashes system has to buy beer
Agnostos> lol
Agnostos> I wonder if I can sneak that into a server startup script here.

(from bash.org)

Taco Bell Programming

32 concurrent parallel parsing processes and zero bullshit to manage. Requirement satisfied.

Lots of work can be achieved by using existing tools… so use them, even if they are not fancy, new or hip. That’s true Unix Zen!

Read the full article.

Linux Geeks beißen nicht!

Auf so einem Linux-Event beißt keiner, auch wenn sie alle bleich im Gesicht und schwarz gekleidet sind. ;)

Martin über die Linuxtage.