root - Installing TOMCAT on Debian without apt-get

08
2014-07
  • Daniele B

    I have access to a machine on a scientific hpc, and I'm setting up an environemnt to create a web application, made up basically of TOMCAT and postgresql. I cannot use another web server.

    The OS is linux with Debian (squeeze) and I don't have root access to the machine.

    After googling a bit around, I only found methods which required root access to the machine for installing TOMCAT (apt-get ....).

    Is it possible to install TOMCAT in a local directory where I have full permissions? Or Does it necessarily requires root access to be installed? Why?

  • Answers
  • fornwall

    There is no requirement for tomcat to be run as a different user, you can just download a package from e.g. Tomcat 7 Downloads, unpack and use.

    Of course, if you want to bind to a privileged port you need permissions for it.

  • terdon

    I general, when you don't have root access, you need to compile from source. This is usually done with the following steps:

    1. Download the package

      wget http://www.example.com/tomcat.tgz
      
    2. Extract it, this should create a directory with the name of the package.

      tar xvzf tomcat.tgz
      
    3. Move into the newly created directory and run the provided configure script, giving it your $HOME as the install prefix

      cd tomcat
      ./configure --prefix=$HOME
      
    4. Compile ad install

      make && make install
      

    That will install the program's files in subdirectories of your $HOME, for example $HOME/bin, $HOME/lib etc. Now, whether this will work for something as large/complex as a web server I cannot tell you, but it would surprise me if it does. While this approach may well install it, getting access to it and having it function correctly as a web server is probably going to be more complex. If you get this far, post another questions with any new issues you face. Good luck!


  • Related Question

    linux - Installing Mercurial on Debian using apt-get
  • Elias Zamaria

    I am trying to install Mercurial using apt-get on a web server running Debian. I would prefer to have the latest stable version of Mercurial but I would be happy with anything reasonably recent. I tried entering the command sudo apt-get install mercurial and I got the following response:

    Reading package lists... Done
    Building dependency tree... Done
    You might want to run `apt-get -f install' to correct these:
    The following packages have unmet dependencies:
      mercurial: Depends: libc6 (>= 2.4) but 2.3.6.ds1-13etch10 is to be installed
                 Depends: python (>= 2.5) but 2.4.4-2 is to be installed
                 Depends: python-support (>= 0.90.0) but 0.5.6 is to be installed
                 Depends: mercurial-common (= 1.7.5-1) but it is not going to be installed
      trac: Depends: python-genshi but it is not installable
    W: Couldn't stat source package list http://debian.newdream.net etch/main Packages (/var/lib/apt/lists/debian.newdream.net_dists_etch_main_binary-amd64_Packages) - stat (2 No such file or directory)
    W: Couldn't stat source package list http://debian.newdream.net etch/non-free Packages (/var/lib/apt/lists/debian.newdream.net_dists_etch_non-free_binary-amd64_Packages) - stat (2 No such file or directory)
    W: Couldn't stat source package list http://debian.newdream.net etch/contrib Packages (/var/lib/apt/lists/debian.newdream.net_dists_etch_contrib_binary-amd64_Packages) - stat (2 No such file or directory)
    W: Couldn't stat source package list http://www.backports.org etch-backports/main Packages (/var/lib/apt/lists/www.backports.org_debian_dists_etch-backports_main_binary-amd64_Packages) - stat (2 No such file or directory)
    W: Couldn't stat source package list http://volatile.debian.org etch/volatile/main Packages (/var/lib/apt/lists/volatile.debian.org_debian-volatile_dists_etch_volatile_main_binary-amd64_Packages) - stat (2 No such file or directory)
    W: Couldn't stat source package list http://volatile.debian.org etch/volatile/contrib Packages (/var/lib/apt/lists/volatile.debian.org_debian-volatile_dists_etch_volatile_contrib_binary-amd64_Packages) - stat (2 No such file or directory)
    W: Couldn't stat source package list http://volatile.debian.org etch/volatile/non-free Packages (/var/lib/apt/lists/volatile.debian.org_debian-volatile_dists_etch_volatile_non-free_binary-amd64_Packages) - stat (2 No such file or directory)
    W: You may want to run apt-get update to correct these problems
    E: Unmet dependencies. Try 'apt-get -f install' with no packages (or specify a solution).
    

    I tried running sudo apt-get -f install and got some more stat-related errors and a suggestion to run apt-get update. (Let me know if you need to know more details)

    I tried sudo apt-get update and got several 404 errors followed by this:

    Reading package lists... Done
    W: GPG error: http://debian.di.newdream.net etch Release: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 8E4BD8EB613A210F
    W: Couldn't stat source package list http://debian.newdream.net etch/main Packages (/var/lib/apt/lists/debian.newdream.net_dists_etch_main_binary-amd64_Packages) - stat (2 No such file or directory)
    W: Couldn't stat source package list http://debian.newdream.net etch/non-free Packages (/var/lib/apt/lists/debian.newdream.net_dists_etch_non-free_binary-amd64_Packages) - stat (2 No such file or directory)
    W: Couldn't stat source package list http://debian.newdream.net etch/contrib Packages (/var/lib/apt/lists/debian.newdream.net_dists_etch_contrib_binary-amd64_Packages) - stat (2 No such file or directory)
    W: Couldn't stat source package list http://www.backports.org etch-backports/main Packages (/var/lib/apt/lists/www.backports.org_debian_dists_etch-backports_main_binary-amd64_Packages) - stat (2 No such file or directory)
    W: Couldn't stat source package list http://volatile.debian.org etch/volatile/main Packages (/var/lib/apt/lists/volatile.debian.org_debian-volatile_dists_etch_volatile_main_binary-amd64_Packages) - stat (2 No such file or directory)
    W: Couldn't stat source package list http://volatile.debian.org etch/volatile/contrib Packages (/var/lib/apt/lists/volatile.debian.org_debian-volatile_dists_etch_volatile_contrib_binary-amd64_Packages) - stat (2 No such file or directory)
    W: Couldn't stat source package list http://volatile.debian.org etch/volatile/non-free Packages (/var/lib/apt/lists/volatile.debian.org_debian-volatile_dists_etch_volatile_non-free_binary-amd64_Packages) - stat (2 No such file or directory)
    W: Couldn't stat source package list http://debian.newdream.net etch/main Packages (/var/lib/apt/lists/debian.newdream.net_dists_etch_main_binary-amd64_Packages) - stat (2 No such file or directory)
    W: Couldn't stat source package list http://debian.newdream.net etch/non-free Packages (/var/lib/apt/lists/debian.newdream.net_dists_etch_non-free_binary-amd64_Packages) - stat (2 No such file or directory)
    W: Couldn't stat source package list http://debian.newdream.net etch/contrib Packages (/var/lib/apt/lists/debian.newdream.net_dists_etch_contrib_binary-amd64_Packages) - stat (2 No such file or directory)
    W: Couldn't stat source package list http://www.backports.org etch-backports/main Packages (/var/lib/apt/lists/www.backports.org_debian_dists_etch-backports_main_binary-amd64_Packages) - stat (2 No such file or directory)
    W: Couldn't stat source package list http://volatile.debian.org etch/volatile/main Packages (/var/lib/apt/lists/volatile.debian.org_debian-volatile_dists_etch_volatile_main_binary-amd64_Packages) - stat (2 No such file or directory)
    W: Couldn't stat source package list http://volatile.debian.org etch/volatile/contrib Packages (/var/lib/apt/lists/volatile.debian.org_debian-volatile_dists_etch_volatile_contrib_binary-amd64_Packages) - stat (2 No such file or directory)
    W: Couldn't stat source package list http://volatile.debian.org etch/volatile/non-free Packages (/var/lib/apt/lists/volatile.debian.org_debian-volatile_dists_etch_volatile_non-free_binary-amd64_Packages) - stat (2 No such file or directory)
    W: You may want to run apt-get update to correct these problems
    E: Some index files failed to download, they have been ignored, or old ones used instead.
    

    Am I doing something wrong? How can I install Mercurial?


  • Related Answers
  • Arrowmaster

    You are running Etch which is not one but two versions out of date. Etch has been removed from all the official mirrors. Additionally backports.org has moved to backports.debian.org and volatile has been discontinued.

    If you want a recent version of mercurial without having to compile it yourself, I suggest you upgrade from etch to lenny, and then from lenny to squeeze.

    Also from what you posted I noticed this "Depends: mercurial-common (= 1.7.5-1)" and that is the version from unstable. What kind of franken-system are you running with both etch and sid mixed?

  • caliban

    If you are getting these messages while doing an 'apt-get update' then it means apt is not able to connect or pull from some of the repos in your sources.list.

    This could be caused by many things, but the most likely reason is that the repos are under maintenance and are temporarily unavailable.

    Might want to try later?