< home | projects | six-degrees
The Six degrees of Wikipedia implementation
Download source code:
The server is made up of the following parts:
- linksd, the backend server,
- linksc, the command-line client,
- mkcache, a program to build the cache linksd needs from the database,
- liblinksc_jni.so, the JNI (Java Native Interface) shared library
- linksc.jar, a Java interface to the links server
- sixdeg.war, a JSP front-end
- python/six_degrees, a Python front-end
To compile it, do the following:
- Extract linksd.tar.gz (gzcat linksd.tar.gz | tar xvf -)
- Ensure you have installed:
- Change directory to ./linksd/
- Edit linksc.h to change the DOOR and CACHE files to a suitable location.
- Type "make". The Solaris version will only build on Solaris. The portable version
should build on any Unix-like operating system, but has only been tested on Debian Linux.
- You may need to change some paths in the Makefile to build correctly.
- Assuming there are no errors, you should end up with the files above. Run
"mkcache <dbname>" to create the database cache, then start "linksd". To
test it, run "linksc" from the command line, and type two article names on
separate lines. You should get back a path between them. Note that "mkcache"
requires the database user and password to be specified in the "[linksd]"
section of ~/.my.cnf.
If you want one of the web front-ends:
- For the Python frontend, copy python/six_degrees to a cgi-bin directory
on your web server. You will also certainly need to edit the script to
change the hard-coded paths.
- For the JSP frontend, edit the Makefile to edit the --user and other parameter
in the "deploy" target, then run "make deploy". (Note: This will only work if
you use Sun's Java Application Server. For other servlet containers, look at
the documentation for details on how to deploy .war files.) You will need to
ensure that liblinksc_jni.so is somewhere in the library path so the JVM can
find it.
Note that for both web front-ends, the web server or application server (i.e.
whichever user the front-end runs as) needs write access to the DOOR file that
linksd create.