How to use your account
Basics
Every team has a special account on one of the servers we have set up for this course. You have received the login data (machine name, user, and password) by e-mail.
To login you can use any SSH client from within the EPFL network (you need VPN or Tremplin SSH tunnels from the outside). In this example we will assume that you are using one of the machines in INF1. Obviously you need to replace the user and machine names with the ones assigned to your team.
in1sun1# ssh user01@lsir-cis-pc1 The authenticity of host 'lsir-cis-pc1 (128.178.156.150)' can't be established. RSA key fingerprint is 1e:b6:99:fd:82:8a:20:37:78:2d:8f:28:57:a8:bb:f8. Are you sure you want to continue connecting (yes/no)? yes Warning: Permanently added 'lsir-cis-pc1,128.178.156.150' (RSA) to the list of known hosts. user01@lsir-cis-pc1's password: XXXXXX user01@lsir-cis-pc1:~$
The message about the fingerprint will only appear once.
Prompt
If you like the yellow prompt, you can skip this paragraph. :-) If your terminal doesn't have a black background, you may want to change it back to its normal form. To do this add the following line to the end of the .bash_profile file in your home directory (the contents of this file are automatically executed by the shell on each login):
export PS1='\u@\h:\w\\$ '
Postgres
Your Postgres database cluster (also see the Postgres tutorial below) resides in the following directory (where XX is the number of your user):
/var/lib/pgsql/dataXX/
In this directory you can also find the configuration files of your Postgres server. Ordinarily you shouldn't need to change anything, but if you're interested take a look at the corresponding documentation for postgres.conf and pg_hba.conf.
Just in case you screw up your Postgres installation, there is a backup file of the entire dataXX directory in your home directory called pg_backup.tar.gz.
By default your Postgres server listens on TCP port 54XX, where XX is once again your user number. You need this information to connect to your databases e.g. from Java applications. The corresponding JDBC URL looks something like this:
jdbc:postgresql://lsir-cis-pcY:54XX/mydatabase
As long as you use the psql client you don't need to worry about this. We have set up the environment variable PG_PORT for you, so that the program automatically knows the right port number.
Java
To use the PostgreSQL JDBC driver you must specify the .jar file containing it (/opt/j2eeXX/lib/postgresql-8.0-310.jdbc3.jar) when you run a Java program like this:
java -cp /opt/j2eeXX/lib/postgresql-8.0-310.jdbc3.jar:. MyProgram
(Note that you will not usually need this for compilation because JDBC drivers are loaded in a dynamic way using the Class.forName method.)
Since you will be using the Postgres driver for most of your Java programs you may want to add it directly to the classpath, so you can omit the longish -cp option every time. To do this, just add the following line to your .bash_profile file:
export CLASSPATH=/opt/j2ee${USER:4}/lib/postgresql-8.0-310.jdbc3.jar:.
J2EE
Your copy of J2EE can be found in the following directory:
/opt/j2eeXX/
The most important subdirectory is the one called bin. It contains the programs that you're going to need for phases 2 and 3 of the project. It may come in handy to add the directory to your path variable, so you can e.g. run asant directly without prepending the entire path. You can achieve this by changing the corresponding line in your .bash_profile file like this:
PATH=/opt/j2ee${USER:4}/jdk/bin:$PATH:$HOME/bin:/opt/j2ee${USER:4}/bin
You will learn more about J2ee in the J2EE tutorial later on.
Startup script
Normally the servers should be running 24/7, but in some cases it may become necessary for us to restart them. Under certain circumstances you may want to have a script run automatically on machine startup.
If you need such functionality you can create a script called autorun.sh in your home directory. This script will then be executed in the context of your user with the working directory set to your home directory. All you need to do is make sure that it is executable (at least chmod 700).
For the technically interested, here is how your script is started:
runuser -l userXX -c "/home/userXX/autorun.sh > /dev/null 2>&1 &"
Copyright © Martin Rubli & Patrik Bless –
Last change:
This page uses
valid XHTML 1.0 Strict and
valid Cascading Style Sheets, Level 2.
This page uses
valid XHTML 1.0 Strict.
This page uses
valid Cascading Style Sheets, Level 2.