This week's giveaway is in the JDBC forum.
We're giving away four copies of Java Database Connections & Transactions (e-book only) and have Marco Behler on-line!
See this thread for details.
Win a copy of Java Database Connections & Transactions (e-book only) this week in the JDBC forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Devaka Cooray
  • Knute Snortum
  • Paul Clapham
  • Tim Cooke
Sheriffs:
  • Liutauras Vilda
  • Jeanne Boyarsky
  • Bear Bibeault
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Ron McLeod
  • Piet Souris
  • Frits Walraven
Bartenders:
  • Ganesh Patekar
  • Tim Holloway
  • salvin francis

Logical directory to install Tomcat and Jdk on Linux (X-Post)  RSS feed

 
Ranch Hand
Posts: 47
1
Eclipse IDE Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have my Tomcat and Java installation in /opt but to be honest I don't really understand the Linux directories. I know I can technically get them to work almost anywhere. However, I would like to stick to convention. Where would these typically be installed? If it helps, only one user and root should be able to modify them. This server's only reason for existence is to run a Java application.

FYI this is cross-post from Reddit. No one replied at the time of this new thread. https://www.reddit.com/r/linux4noobs/comments/9up9ja/logical_directory_to_install_tomcat_and_jdk_on/

Thanks.
 
Marshal
Posts: 64495
225
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Depends how you are installing them, and who should be able to use those programs.
If you install them with rpm -Uvih or apt-get install or dnf install, they would be in /usr/bin but probably only as symbolic links.
 
Carl Byrd
Ranch Hand
Posts: 47
1
Eclipse IDE Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Campbell,

Thank you for your reply. I should have mentioned how I'm installing them. I'm FTP-ing tar.gz files for each to the Linux environment, I'm not using the package manager. Should I still put them in /usr/bin? Thanks.
 
Sheriff
Posts: 21747
102
Chrome Eclipse IDE Java Spring Ubuntu VI Editor Windows
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
No, /bin and /usr/bin are definitely not the correct place for non-managed programs. You can use /usr/local/bin, but I think /opt is used a lot more these days.

An interesting read: http://www.pathname.com/fhs/pub/fhs-2.3.html
 
Bartender
Posts: 20766
124
Android Eclipse IDE Java Linux Redhat Tomcat Server
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If you're running a personal test copy of Tomcat, you can simply plop it in your home directory. For system servers, I usually use /usr/local, although /opt is the place I'd probably put an app-specific or Spring Boot based Tomcat server.

Then there's /srv, but nobody really knows what to do with /srv.

For JREs and JDKs, Sun/Oracle has long had the standard that their Red Hat (RPM) release would install each JDK or JRE under /usr/java. I like that approach. Not least because I often make it a mountpoint so that it's relatively unaffected when I do major system upgrades. Basically, other than making an entry in the RPM software inventory database, the only thing different than unzipping an archive-form JDK/JRE under /usr/java is that the RPM kindly creates a /usr/java/latest alias to the latest JVM release installed.

Red Hat themselves also have an RPM install for Tomcat. I think it actually places Tomcat is /usr/local, but then creates softlinks so that TOMCAT_HOME (/usr/local/tomcat...)/config goes under /etc/tomcat/config, TOMCAT_HOME/logs links to /var/log/tomcat, /TOMCAT_HOME/webapps links to /var/lib/tomcat/webapps, and so forth. Essentially leaving CATALINA_BASE alone, but creating a softlink-based CATALINA_HOME.

Note that /usr/local is - according to the LSB - supposed to be read-only, which is one reason for all the aliasing. The other being that the alias locations are the standard location for generic Red Hat Linux application installed files.
 
Tim Holloway
Bartender
Posts: 20766
124
Android Eclipse IDE Java Linux Redhat Tomcat Server
  • Likes 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
p.s. Create a userid/group named "tomcat". Don't run Tomcat as root!
 
Hey, sticks and stones baby. And maybe a wee mention of my stuff:
how do I do my own kindle-like thing - without amazon
https://coderanch.com/t/711421/engineering/kindle-amazon
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!