Extra:Install

From NinanWiki

Jump to: navigation, search

To do: clean up text, remove old pukiwiki tags, convert to mediawiki. Update install guide.

This install guide will help you to install Ninan on ClarkConnect 4.x

Contents

Running Ninan on your Clark Connect home server

As many users already know, Ninan is one of the best Usenet downloaders. It works as a server, is stable and free. Therefore it's an ideal application to install on an actual server.~ Since broadband is becomming the standard way to connect to the internet more and more users run a homeserver. This wiki will take you through the steps of installing Ninan on Clark Connect 4.x:http://www.clarkconnect.com including the setup of Java, unrar and par2repair.

Will you need a domain? That depends. If you only want to connect to your server (and Ninan) locally you don't, otherwise you do. Ninan can easily be set to run on a subdomain so you won't need an extra domain if you already own one.~ The steps of installing Clark Connect are up to you. In most cases you would use a redundant pc which can act as the gateway for your network. To avoid any problems with p2p programs your modem is best set to bridged and let Clark Connect take care of all the ports etc.

Java install

Ninan needs Java so lets start by installing Java on your CC server. Using PuTTy:http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html login as root. Create the dir needed for Java:

# mkdir /usr/java

Move to the new dir:

# cd /usr/java

Download:http://java.com/en/download/linux_manual.jsp Java (RPM self-extracting file) at and upload it using ftp or whatever you use for uploading files to /usr/java. Run the following commands in PuTTy to install Java:

# chmod a+x jre-6u2-linux-i586-rpm.bin
# ./jre-6u2-linux-i586-rpm.bin

Follow the installer and install Java.

New Java install: Create a symlink:

# ln -sf /usr/java/jre1.6.0_02 /usr/local/java

Updating Java version: Remove the old symlink and install the new one. After this your done when upgrading!

# rm -rf /usr/local/java
# ln -sf /usr/java/jre1.6.0_02 /usr/local/java

We do this so that if a new Java version comes out, we can install the RPM and only change the directory that the symlink points to (see Updating Java version above). It's more upgrade-friendly this way.

To make Java usable by all users on the system we'll create /etc/profile.d/java.sh

# nano /etc/profile.d/java.sh

Nano opens an empty file. Enter these lines and save it (Ctrl+o)

export JAVA_HOME="/usr/local/java/bin"
export JAVA_PATH="$JAVA_HOME"
export PATH="$PATH:$JAVA_HOME"

Java has been installed and configured. Test it by running the following command in a terminal:

# java -version

The output should look like:

java version "1.6.0_02"
Java(TM) SE Runtime Enviroment (build 1.6.0_02-b05)
Java Hotspot(TM) Client VM (build 1.6.0_02-b5, mixed mode, sharing)

Shell access

To get shell access as a normal user we need to configure CC by hand. Since version 4 normal user can't be given shell access by using the web-based administration tool. We do want shell access for out user, running Ninan as root is a security risk and not recommended!

First create a new user by using the web-based administration tool. Then using PuTTy give the user shell access:

# usermod -s /bin/bash <username>
# passwd <username>

Setting up the subdomain

Login CC using the web-based administration tool. Select Software --> Web --> Webserver.~ If you already run a website you need to edit the settings a small bit to make the subdomain accessable. Select your domain and edit the settings. In this wiki we'll call your domain example.com. Remove the * at Server aliases and replace it with www. This way example.com can be reached at http://www.example.com and http://example.com. Leaving the * would make creating a subdomain useless. Save your settings by clicking Update.~ Return to Software --> Web --> Webserver. At Configure Virtual Hosts enter ninan.example.com and click add. Your subdomain has been created and we are ready to install Ninan in /var/www/virtual/ninan.example.com.

Now upload ninan-1.1.3.tar.gz to /var/www/virtual/ninan.example.com.~ Using PuTTy we'll extract the contents, make it owned by our user with shell access and create a symlink (again for easy upgrade purposes):

# cd /var/www/virtual/ninan.example.com
# tar -zxvf ninan-1.1.3.tar.gz
# ln -s ninan-1.1.3 ninan
# chown user:user ninan
# chown -R user:user ninan-1.1.3 (where user is your created user with shell access!)

Parchive install

Ninan does all the repair and extracting work for you so we need to install Par2cmdline and Unrar aswell. Let's start by downloading Par2cmdline:http://sourceforge.net/project/showfiles.php?group_id=30568.~ To keep things tidy we'll create a dir to extract and compile Par2cmdline. Using PuTTy create a dir:

# mkdir /home/install
# cd /home/install

Using your preferred tool upload par2cmdline-0.4.tar.gz to /home/install on your CC box. Using PuTTy extract the contents and enter the dir:

# tar -zxvf par2cmdline-0.4.tar.gz
# cd par2cmdline-0.4

Before we can compile Par2cmdline we need to install the tools on CC:

# apt-get install cc-devel

After the installation of these tools are done we can compile and install Par2cmdline:

# ./configure
# make # make install

For safety we'll remove the devel tools by entering the command:

# cd /usr/sbin
# ./remove-cc-devel.sh

Unrar install

Download:http://www.rarlabs.com/download.htm the Linux version of Unrar. The installation is simple, no compile is needed. Upload rarlinux-3.7.0.tar.gz to /home/install and enter the following commands:

# cd /home/install
# tar-zxvf rarlinux-3.7.0.tar.gz
# cd rar
# cp rar /usr/local/bin/
# cp unrar /usr/local/bin/
# cp rar_static /usr/local/bin/
# cp default.sfx /usr/local/bin/

We don't need all 4 for Ninan but they could come in handy for other tasks.

    • Ninan final setup [#l58328b5]

We need to make some Ninan files executable with the following commands in PuTTy:

# su user (change from root to the normal user)
$ cd /var/www/virtual/ninan.example.com/ninan
$ chmod o+x ninancore.sh ninanstop.sh createMYSQLDB.sh

Ninan will create the download, nzbfiles and temp dirs the first time we'll run Ninan. The location of those dirs is not ideal in this setup so I'll show you how to change them.~ Give your user a home dir with the web-based administration tool. On the CC server you'll now have a /home/user dir. This folder in CC 4 can be shared with flexshares and so on. You can also use a second disk in your system for downloads and share it with flexshares it's all up to you.

Make sure you actually create those dirs! If they are outside of the /home/user dir this has to be done as root and the owner has to be changed afterwards. If the ownership is not set to your user Ninan won't be able to write any data in the dirs. This is very importent not to forget!!!~ Example for creating a folder outside the home dir for your user with PuTTy:

$ su (change to root)
# mkdir /location/where/you/want/download
# chown user:user /location/where/you/want/download

Repeat those steps for all 3 dirs.

Now its time to start Ninan and see if all is working. First we have to change back to the normal user and change to the Ninan dir.

# su user
$ cd /var/www/virtual/ninan.example.com/ninan
$ nohup ./ninancore.sh &

Ninan will fire up. Point your browser to: http://www.ninan.example.com:9090/ninan You can close the PuTTy session, Ninan will keep on running on the server. For connections outside your local network make sure to open port 9090 in the firewall.

If you created new folders for download, nzbfiles and temp do not forget to enable them in the config pages of Ninan.

If you want to stop Ninan open a PuTTy session, log in as normal user and use the following commands:

$ cd /var/www/virtual/ninan.example.com/ninan
$ ./ninanstop.sh
    • Support [#we7c5301]

If you have any problems set Ninan in [[Debug Mode>Ninan/Debug]] and have a look at the [[Log file>Ninan/LogFile]]. Of course you can also get support in our Forum:http://www.ninan.org/modules/newbb [/en]