Installation as a standalone server

Prerequisites

Installing the Java Runtime Environment

You can download the Java Runtime Environment directly at http://java.sun.com/ or as a debian archive at http://www.debian-unofficial.org/index.html . If you're downloading the original package from Sun, this is the way how you may install it on your system:

  1. Download Java SE Runtime Environment (JRE) for Linux from http://java.sun.com/ (jre-6-linux-i586.bin was the latest version at the time when this guide was written).
  2. Install JRE in directory /opt .
    # cd /opt/
    # sh /tmp/jre-6-linux-i586.bin
    # ln -s jre1.6.0 jre
  3. Use Debian update-alternatives to include the Java binaries into the system path.
    # update-alternatives --install /usr/bin/java java /opt/jre/bin/java 200
  4. You may also include the following lines in /etc/profile:
    JAVA_HOME=/opt/jre
    export JAVA_HOME

Installing Japt-Proxy

  1. Download Japt-Proxy from http://sourceforge.net/project/showfiles.php?group_id=160609
  2. Unpack the archive
    # cd /tmp
    # tar xfz japt-proxy-1.4-standalone-bin.tar.gz
  3. System set-up
    # adduser --system japt-proxy --home /dev/null --no-create-home
    # cp /tmp/japt-proxy-1.4/japt-proxy.sh /etc/init.d
    # chmod 755 /etc/init.d/japt-proxy.sh
    # update-rc.d japt-proxy.sh defaults
    # mkdir -m 0750 /var/log/japt-proxy /var/cache/japt-proxy
    # chown japt-proxy /var/log/japt-proxy /var/cache/japt-proxy
    # cp /tmp/japt-proxy-1.4/japt-proxy-1.4-standalone.jar /usr/share/java
  4. Configure the proxy
    # cp /tmp/japt-proxy-1.4/japt-proxy.conf.xml /etc

    Now edit /etc/japt-proxy.conf.xml to your needs. See Configuration section for details.

  5. Starting Japt-Proxy
    # /etc/init.d/japt-proxy.sh start

    See /var/log/japt-proxy.log if the server started successfully.

Using Japt-proxy

  1. Adjust /etc/apt/sources.list and edit the entries to use Japt-Proxy
    1. Example for Debian 4.0 (Etch):
      deb http://localhost:8080/japt-proxy/debian etch main contrib
      deb http://localhost:8080/japt-proxy/debian-security etch/updates main contrib
    2. Example for Debian Lenny:
      deb http://localhost:8080/japt-proxy/debian lenny main contrib
      deb http://localhost:8080/japt-proxy/debian-security lenny/updates main contrib
  2. Now, that everything is set up you can use apt-get as usual
    # apt-get update
    # apt-get upgrade

    ...everything is now downloaded by the proxy. You can do a tail -f /var/log/japt-proxy.log to see what the proxy is doing.