• Post Reply Bookmark Topic Watch Topic
  • New Topic

Deployment on a Linux server  RSS feed

 
Timothy Sam
Ranch Hand
Posts: 751
  • Mark post as helpful
  • send pies
  • 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
 
Lewin Chan
Ranch Hand
Posts: 214
  • Mark post as helpful
  • send pies
  • 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 ]
     
    Tim Holloway
    Saloon Keeper
    Posts: 18800
    74
    Android Eclipse IDE Linux
    • Mark post as helpful
    • send pies
    • 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
    • Quote
    • Report post to moderator
    I can't seem to get the download URL FOR JDK update 7...

     
    • Post Reply Bookmark Topic Watch Topic
    • New Topic
    Boost this thread!