Installing Freenet 0.7 on Linux
- If you are already running an older version of Freenet, for example Freenet 0.5, shut it down. You can turn it back on later, but it simplifies the install to turn it off at this point.
- Run the installer from the command line:
wget http://downloads.freenetproject.org/alpha/installer/new_installer.jar
java -jar new_installer.jar
- Follow the prompts.
- The installer will start Freenet automatically. But if you need to start Freenet manually in the future, use the run.sh script. You will need to use this script to start it (./run.sh start).
- When it opens the web page, click on the big link. Follow the prompts through the wizard to complete the configuation of your node. If you have any problems, go to http://127.0.0.1:8888/wizard/ to complete the setup.
- Freenet 0.7 uses a proxy so your standard web browser can access the pages on Freenet. Open a browser pointing to http://127.0.0.1:8888/ (you should already have one having completed the wizard). This is called FProxy, the primary built-in interface to Freenet 0.7.
- If you have another node on port 8888 fproxy, then:
- Shut down the node (use the Fproxy homepage, it has a big fat shutdown button).
- Edit freenet.ini manually, and change fproxy.port=8888 to some other port, say 9888.
- Start the node back up.
- Start the other node back up.
- Some config settings can be changed from the Freenet Node Configuration page. For those that cannot, you have to shut the node down as above and edit freenet.ini. The Configuration page will at least give you the basic documentation for each option, so it is still useful even if you have to shut down the node. You have already specified your bandwidth limit, port number, and IP address, if necessary, in the installer; you can change them in the config file or through the Configuration page.
- There are some optional tips and tricks which might make your life easier.
- BuildingFromSource
Installing Freenet 0.7 on Linux Without X (headless systems)
wget http://downloads.freenetproject.org/alpha/installer/freenet07.tar.gz
cat freenet07.tar.gz | gzip -d | tar xv
cd freenet
./bin/1run.sh
./run.sh start
cat freenet07.tar.gz | gzip -d | tar xv
cd freenet
./bin/1run.sh
./run.sh start
You can also telnet to port 2323 to get to the console interface:
$ telnet localhost 2323
Securing the Freenet installation on Debian Linux
The following will work on Debian, not tested elsewhere!Create a new user for Freenet:
adduser freenet
Make the Freenet node you just installed be owned by it:
chown -R freenet.freenet /usr/local/freenet
Add it to your startup scripts:
ln -s /usr/local/freenet/run.sh /etc/init.d/freenet-new
update-rc.d freenet-new defaults
update-rc.d freenet-new defaults
Now edit the run.sh to make it setuid to the new user:
# RUN_AS_USER
should become:
RUN_AS_USER=freenet
Then the node will run in its own user, and it will start when your computer starts. You can start it now by:
/etc/init.d/freenet-new start
This will become easier when we have some proper linux packages!!
Installing the node manually
It is possible to install freenet without using the Installer package, but it is not reccomended.
wget http://downloads.freenetproject.org/alpha/freenet-ext.jar∞
wget http://downloads.freenetproject.org/alpha/freenet-cvs-snapshot.jar.url∞
wget -i freenet-cvs-snapshot.jar.url
mv freenet-*-snapshot.jar freenet-cvs-snapshot.jar
java -Xmx100M -cp freenet-ext.jar:freenet-cvs-snapshot.jar freenet.node.Node freenet.ini
Freenet uses a wrapper program, to perform init.d like behavior.
If you are not installing freenet using the installer, you may want to configure the wrapper manually. The wrapper is not necessary to run freenet, but is necessary to allow the node to automatically restart itself, as well as to auto-update.
To install the wrapper:
1) Create two directories under your freenet directory- bin and lib
2) In the bin directory, download the appropriate version of the wrapper binary for your platform/Architecture-
You can either get this in one of two places-
The freenet project at https://emu.freenetproject.org/svn/trunk/apps/installer/installclasspath/bin/
Inside the wrapper/bin directory in a package from the wrapper developers- http://sourceforge.net/project/showfiles.php?group_id=39428
Inside the wrapper/bin directory in a package from the wrapper developers- http://sourceforge.net/project/showfiles.php?group_id=39428
3) In the lib directory, you need to add the wrapper libs. You can get these from one of two places-
To download them from the freenet project, add all the files from https://emu.freenetproject.org/svn/trunk/apps/installer/installclasspath/lib/ to your lib directory.
You could also copy the lib directory from the platform specific archive you downloaded from Sourceforge in Step 2.
You could also copy the lib directory from the platform specific archive you downloaded from Sourceforge in Step 2.
4) Place a version of either run.sh or run.cmd in your freenet directory. USe run.cmd for Windows, run.sh for linux
You can download run.sh and run.cmd from https://emu.freenetproject.org/svn/trunk/apps/installer/installclasspath/
5) In your main freenet directory, place a copy of wrapper.conf
You can download a version of wrapper.conf pre-configured for freenet at https://emu.freenetproject.org/svn/trunk/apps/installer/installclasspath/config/wrapper.conf
6) Modify the parameters of wrapper.conf as needed- Changing the java command, max memory or min memory as desired.
7) make sure the freenet user can read the wrapper.conf directory, and can execute run.sh
run.sh functions like an init script.
"run.sh start" starts the node
"run.sh stop" stops the ndoe
"run.sh status" will tell you if the node is running, and the process number of the JVM.
"run.sh stop" stops the ndoe
"run.sh status" will tell you if the node is running, and the process number of the JVM.
Running a node - Tips and Tricks
Testnet Ports
In able to help with testing of the net, you will need to open/forward the testnet port. It is specified in your node ID under the 'testnetPort' tag.
Exchanging node references over IRC
When your chat program displays the node references like this:
12:34AM <IRCUSERNAME> lastGoodVersion=Fred,0.7,1.0,332
12:34AM <IRCUSERNAME> physical.udp=1.1.1.1:1111
12:34AM <IRCUSERNAME> identity=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
12:34AM <IRCUSERNAME> myName=you_should_set_your_nodes_name_to_something_useful
12:34AM <IRCUSERNAME> location=0.1237634786324
12:34AM <IRCUSERNAME> testnetPort=2111
12:34AM <IRCUSERNAME> testnet=true
12:34AM <IRCUSERNAME> version=Fred,0.7,1.0,336
12:34AM <IRCUSERNAME> End
12:34AM <IRCUSERNAME> physical.udp=1.1.1.1:1111
12:34AM <IRCUSERNAME> identity=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
12:34AM <IRCUSERNAME> myName=you_should_set_your_nodes_name_to_something_useful
12:34AM <IRCUSERNAME> location=0.1237634786324
12:34AM <IRCUSERNAME> testnetPort=2111
12:34AM <IRCUSERNAME> testnet=true
12:34AM <IRCUSERNAME> version=Fred,0.7,1.0,336
12:34AM <IRCUSERNAME> End
... just enter "connect:" and [enter], and then paste the text like seen above, it works!
Exchanging node references using a pastebin service
A better solution than pasting a node reference into an IRC channel is to use a pastebin, such as http://dark-code.bulix.org. After submitting your node ref to the pastebin service, you will be given a URL pointing to your node ref. With bulix.org, "?raw" can be appended to the URL to force it to point to a raw text version of your ref. For example, if your ref URL is http://dark-code.bulix.org/foo, you can change it to http://dark-code.bulix.org/foo?raw. The reference can then be exchanged by simply posting the URL into the IRC channel rather than flooding it with whole references.
Use this to find out the version number without starting the node
java -cp freenet-ext.jar:freenet-cvs-snapshot.jar freenet.node.Version
Starting your Freenet node manually on your Linux box
Navigate to where Freenet is installed which is usually ~/Freenet and enter ./run.sh start enter ./run.sh to see the different commands that you can send to run.sh