• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Jeanne Boyarsky
  • Liutauras Vilda
Sheriffs:
  • Rob Spoor
  • Bear Bibeault
  • Tim Cooke
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Piet Souris
Bartenders:
  • Frits Walraven
  • Himai Minh

Deployment on a Linux server

 
Ranch Hand
Posts: 751
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi guys, I'm still getting used to Linux (even after 1 year of using it, yes I am). Well... I can use Linux on my desktop, but now I have to use it to deploy an app. I'm using SSH, and I think our server is Red Hat EL. Well, the things I want to ask is...


1. Where's the default Java install directory
2. Where's the default Tomcat install directory
3. Where's the default MySQL install directory
4. I'm thinking of using wget, is it possible to specify on which directory I can download files? Is it possible to download the java sdk through wget since when I visit the site(via browser), we are always asked to agree to some sort of agreement(radio button). Will I have any restrictions when it comes to that?
5. Is "su" sufficient enough when I want to change user since I wouldn't wanna be running my app as root?


Thank you
 
Ranch Hand
Posts: 214
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I imagine that most defaults are really up to you, we generally install stuff in /opt, e.g. /opt/java/jdk1.5.0_04, /opt/java/apache-tomcat-5.0.30, and then make symbolic links to more memorable names which are used in the scripts

I think's much nicer to keep *all* your java-ery stuff in one location be it /usr/java/ or /var/java or /opt/java

But to specifically answer your questions

1) I believe the RPM for 1.4 from sun's site used to install it to /usr/java
2) When you used to able to download the RPM for tomcat (I haven't seen this since 4.1.18), this installed it to /var/tomcat4, with the following symbolic links
  • /var/tomcat4/logs -> var/log/tomcat4
  • /var/tomcat4/temp -> var/cache/tomcat4/temp
  • /var/tomcat4/work -> var/cache/tomcat4/work
  • /var/tomcat4/conf -> /etc/tomcat4


  • 3) If you install from the RPMS, then the binaries are installed on your path (do a 'which mysql' to find out), and the "database directories" are by default in /var/lib/mysql, but you can always change this from /etc/my.cnf

    4.1) wget -O "MyOutputFileName" "http://somewhere.com/somedownload.bin" will create the file "MyOutputFileName" regardless of what you're trying to download. Download the contents of an entire directory, no, I don't believe you can do that.
    4.2) Yes you can do it, if you *look* at the link it generates for you when you highlight "download"...

    5) Yes, with the usual caveats, I presume you are intending to do something along the lines of
    su - tomcat5 -c "/opt/tomcat5/bin/catalina.sh start". Although if you're intending to do it as an init script, then on RHEL, you have the option of daemon --user tomcat5 /opt/tomcat5/bin/catalina.sh start if you source /etc/rc.d/init.d/functions first.

    Of course, you *would have to* run your app "as root" if you needed to listen on a port < 1024, but you would probably do that via "jsvc" which is documented on the tomcat docs site.
    [ July 26, 2006: Message edited by: Lewin Chan ]
     
    Saloon Keeper
    Posts: 23742
    161
    Android Eclipse IDE Tomcat Server Redhat Java Linux
    • Mark post as helpful
    • send pies
      Number of slices to send:
      Optional 'thank-you' note:
    • Quote
    • Report post to moderator
    In traditional Unix[tm], you usually install to the /usr/local directory subtree. More recently, /opt is the preferred place.

    However, RPM-based installs normally use "/" as the install root. RPM installs maintain an inventory (the RPM database) so it's easier to find and yank the parts out when no longer needed, and shared components don't need to be duplicated. Thus, mysql is installed into /bin, /var/log, etc.

    The Tomcat RPM install was quite interesting. Tomcat normally contains both read-only and read-write parts of the system in a common directory tree, a la /usr/local/tomcat. But the RPM version worked around this by replacing the various subdirectories with softlinks to Linux-friendly locations. So for example, TOMCAT_HOME/logs links to /var/log/tomcat, TOMCAT_HOME/work links to /var/tomcat/work, etc.

    There's no one "right" location for the JDK, but I like the /usr/java/jdkx.y.z_rr convention. It puts all the JDKs in a central spot where they can easily be pointed to bt setting JAVA_HOME. And doesn't artifically constrain one version of Java to be the One and Only Java, which on a major server with apps of different vintages, can be very important.
     
    Timothy Sam
    Ranch Hand
    Posts: 751
    • Mark post as helpful
    • send pies
      Number of slices to send:
      Optional 'thank-you' note:
    • Quote
    • Report post to moderator
    I can't seem to get the download URL FOR JDK update 7...

     
    You showed up just in time for the waffles! And this tiny ad:
    Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
    https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
    reply
      Bookmark Topic Watch Topic
    • New Topic