Freenet Installation and Administration

Peter demonstrates how to take advantage of the World Wide Web alternative, Freenet.

Freenet, quite possibly the most exciting file-sharing technology out there, is unfortunately a little difficult to install and administer. Your intrepid author spent a weekend with literally no sleep (strong tea and death metal can do wonders) figuring it out when he first got his hands on it back in September 2000. Fortunately, Freenet's ease of use has come a long way since then. With an hour or two of work, anyone competent in Linux system administration should be able to get their own Freenet node up and running.

The installation of a Java runtime is out of the scope of this article. However, a list of recommended JDKs (Java Development Kit) and some warnings about them can be found in the Resources section.

If you want to run a full-time, contributing node you'll need 100MHz 486 or greater with at least 32MB of RAM. There are no minimum requirements (other than about 1MB for the actual software) for hard drive space, but in this age of 20GB drives, it'd be nice if you set aside a few GBs for Freenet data. For your internet connection, a static IP address or dynamic DNS is required. Anything faster than a dial-up is fine. As for uptime, if your node is on 24/7 you can contribute (downtimes of up to an hour or so are okay, but try to avoid anything more than that). Anything less and your node will still work just fine for you, but you won't be contributing anything to the network.

For a part-time, noncontributing node, similar system and memory requirements apply, but you can use whatever internet connection you like.

Basic Installation

First of all, you need to actually download Freenet. Here you have two main options. You can download a binary or choose the source package. If you run Debian, Mr. Bad has created a Debian package (see Resources). Because Freenet is written in Java, you don't have to worry about binary compatibility, so it's easiest simply to download a binary package. After that the question is which version do you want. A release (current is 0.3.5) or CVS copy? You'll probably want to go with a release at first. Do make sure you download the Linux tarball, not the Windows executable.

The Linux version of Freenet doesn't have any installation scripts. Instead you simply untar the tarball into a directory of your choice. Personally I'd suggest creating a special Freenet user and putting the Freenet software and data store in the Freenet user's home directory.

Next you'll want to make your node automatically start at boot up. Unfortunately, not all distributions handle the startup scripts quite the same way. If you want to use dæmontools, follow the instructions at freenet.netunify.com/25. Otherwise, use something like:

su - -c "cd ~/freenet ; rm freenet.log nohup.out ; nohup ./freenet_server & >/dev/null" freenet

This changes the user to the Freenet user. The “-” sets the environment to that of a login shell so the environment is set up as though running from a normal shell. Finally, the command -c changes the directory to the Freenet directory, removes old log files and runs the Freenet server in nohup mode directing any non-errors to /dev/null. You'll need to insure the Java program itself is in your path. Try running Java from a room shell to test this.

Configuration

The Freenet node software uses two configuration files: .freenetrc, the configuration for the node; and .fproxyrc, the configuration for the fproxy module. Of the two, .freenetrc contains all but one of the options; .fproxyrc just tells fproxy which Freenet node it should connect to.

The first thing you'll want to set is the transient option up at the top of the .freenetrc file. The default, “no”, means that your node will tell other nodes about its existence. This is probably what you want if you plan on running a 24/7 node with a good internet connection and a static IP address or dynamic DNS service. If you set transient to “yes”, your node won't tell other nodes about its existence. If you have spotty uptime, a slow internet connection or a dynamic IP address without dynamic DNS, set transient to “yes”.

You'll want to change the port used by Freenet to a random port between 5,000 and 65,535. If everyone ran their node on the same port it would be far easier for Freenet to be filtered out, which is not a good thing. To do this, change the listenPort value in .freenetrc and the serverAddress in .fproxyrc to reflect the new port. Also, remember to use the -serverAddress option when running the command-line clients or set the FREENET environment variable to the address of your node.

If you have a dynamic IP address but use dynamic DNS you can still contribute to Freenet by setting nodeAddress to your dynamic DNS name. Instead of telling other Freenet nodes the IP address of your machine, it will tell them the address in the nodeAddress setting.

______________________

White Paper
Linux Management with Red Hat Satellite: Measuring Business Impact and ROI

Linux has become a key foundation for supporting today's rapidly growing IT environments. Linux is being used to deploy business applications and databases, trading on its reputation as a low-cost operating environment. For many IT organizations, Linux is a mainstay for deploying Web servers and has evolved from handling basic file, print, and utility workloads to running mission-critical applications and databases, physically, virtually, and in the cloud. As Linux grows in importance in terms of value to the business, managing Linux environments to high standards of service quality — availability, security, and performance — becomes an essential requirement for business success.

Learn More

Sponsored by Red Hat

White Paper
Private PaaS for the Agile Enterprise

If you already use virtualized infrastructure, you are well on your way to leveraging the power of the cloud. Virtualization offers the promise of limitless resources, but how do you manage that scalability when your DevOps team doesn’t scale? In today’s hypercompetitive markets, fast results can make a difference between leading the pack vs. obsolescence. Organizations need more benefits from cloud computing than just raw resources. They need agility, flexibility, convenience, ROI, and control.

Stackato private Platform-as-a-Service technology from ActiveState extends your private cloud infrastructure by creating a private PaaS to provide on-demand availability, flexibility, control, and ultimately, faster time-to-market for your enterprise.

Learn More

Sponsored by ActiveState