Installing The Software



Now that we have a working server we need to get all of our software onto it. For most things this will be made a lot easier by using apt-get. Using this command, you can download a list of packages that volunteers have made available for Debian that take the guesswork out of installing applications. First, we need to download a list of the latest available packages:

apt-get -y update
If you type that command at the command line of your server, the computer will have downloaded a list of all the latest packages. The place were the packages are downloaded from are listed in the file /etc/apt/sources.list, FYI.

Next, we want to make sure that we don't already have any out-of-date packages installed as part of the base Debian installation, so we'll upgrade all our packages to the latest like so:

apt-get -y upgrade
If the server asks you any questions when you run this, just pick whatever the default is- It shouldn't matter.

Ok, now unfortunately Tomcat (our java web server) does not exist on the base version of Debian, aka "Woody". This is because tomcat was still considered too unstable to run inside Debian when this version of the OS was frozen. Because of this, we'll need to change our base Debian setting to be the "unstable" version, which does have Tomcat. To do this, we will download a program called netselect like so:

apt-get -y install netselect
Alright- Now let's use this program to build a new "unstable" version of the sources.list file (this program will also optimize the file for the fastest software downloads as well...)

netselect-apt unstable
...and then let's move that file into place:

mv sources.list /etc/apt/
Now we'll want to upgrade our packages again:

apt-get -y update
apt-get -y upgrade

Phew, doing good so far!


Installing Java


Installing Java is a bit more of a challenge on Debian: Since it is not GPL software, it is not, by default, accessible through the apt-get system. But if we add a new source to our sources.list we can make Debian obey our wishes.




To do this, we'll want to download a text editor first:

apt-get -y install emacs21-nox

(Make sure not to spell the package name with a v or an i or it will give an error.)

Now we will load our sources.list into emacs:

emacs /etc/apt/sources.list

Ok, now go to the bottom of the file and add the following line of text:

deb ftp://ftp.tux.org/java/debian/ sarge non-free
To save the file, type Control+x, Control+s in emacs. To exit emacs, type Control+x, Control+c.

Now we're ready to re-update our package list and install Java:

apt-get udpate
apt-get -y install j2sdk1.4


Installing Tomcat


Tomcat is a web-server for Java classes: It funnels the page info to a Java class and the Java class sends back a web page. Let's install it:

apt-get -y install tomcat4 tomcat4-webapps tomcat4-admin

After the program has been downloaded, you should now be able to view the Tomcat home page through the internet! Try typing the following into your web browser from home:

http://123.234.345.456:8180

(replace the IP address with the address from your own server...)




Next, we'll want to add a new user to Tomcat that has managment rights

emacs /var/lib/tomcat4/conf/tomcat-users.xml
Add the following new user to this file: (with your own username and password)

<user username="foo" password="bar" roles="manager"/>

Next, we need to tell Tomcat where to go to find our Java class (which will be a wrapper for our Scheme code). We do this by creating a pointer to a directory (which will hold the java) with an entry in the web.xml file:

emacs /var/lib/tomcat4/webapps/ROOT/WEB-INF/web.xml
Add the following lines right after the <web-app> line in the web.xml:

  <servlet-mapping>
     <servlet-name>invoker</servlet-name>
     <url-pattern>/servlet/*</url-pattern>
  </servlet-mapping>

So far so good... is this ever going to end?


<< PREVIOUS                 NEXT >>