Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Hey all -- apologies if this is a n00b question, I am a super n00b at Linux administration.

So, I'm on Amazon EC2, using Amazon Linux, which I believe is Redhat-derived. I have an EBS volume mounted to /mnt/vol5 and I want to install Tomcat there. However, all the tutorials say that Tomcat likes to be in /usr/bin. Anyway, I downloaded the Tomcat package and untarred it to /mnt/vol5. I executed the run script, and everything runs like it should. I hit my server on port 80 and I see the Tomcat test page.

However, I know there are probably things that will expect my Tomcat instance to be in /usr/bin, and in general, it seems like a good idea to make my server "look and act" as if Tomcat is in /usr/bin and not /mnt/vol5. How do I do this? Is it something that involves mounting? Something that involves changing /etc/fstab?

Once again, apologies for the n00b question -- if you can suggest any good online tutorials that would help me understand filesystem stuff like this, I'd totally appreciate it.

Thank you!

share|improve this question

2 Answers 2

up vote 0 down vote accepted

Tomcat has no requirement to run in /usr/bin. I use tomcat on many of my production machines and I prefer to not have my middleware cohabitate with basic system binaries in /usr/bin (I generally pick /opt or /usr/local). I think what you did is just fine and nothing should expect it to be any place but where it is. I believe many of the config files use variables for path based on environment from where the application is started.

Though, I would like to point out that if your tomcat setup ran on port 80 out of the box like that, then you are running tomcat as root and should not do this. The best practice for a single tomcat instance is to run on a port > 1024 as a non-privileged user and then use iptables to forward traffic from 8080 (for example) to 80. Same goes for 443.

share|improve this answer
    
Good call! Thanks for the tip. –  sangfroid Jun 4 '11 at 4:01

Check out the Linux Filesystem Hierarchy Standard. It in particular prescribes optional application software packages such as Tomcat to be placed under /opt.

The "official" Tomcat packages found in today's Linux distros often have their contents scattered across the filesystem: configuration files go under /etc, webapps and logs under /var, and so on, and the main directory contains just the binaries and symbolic links to those other locations.

There are detailed instructions for Java and Tomcat installation on Amazon Linux in Part II of my Cat in the Cloud series.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.