Tweaks / Addons A.K.A. The Underground > Download mods
[Handleiding] Newznab op Synology
LukeVredeveld:
In een ander topic had ik nog beloofd om een tutorial te plaatsen voor het opzetten van een eigen newznab-indexer. Dit naar aanleiding van het sluiten van steeds meer sites, zoals recentelijk NZBMatrix. Nu is er zojuist door iemand van Github al een tutorial gemaakt, dus die gebruik ik bij deze maar :-).
De credits gaan dus naar Jeroen van Emden via GitHub.
# HowTo install Newznab on Synology
#################################
#
# Newznab: https://github.com/kop1/newznab
# Newznab is a PHP/Smarty application, which supports the indexing of usenet headers
# into a mysql database and provides a simple web based search interface onto the data.
#
# It includes simple CMS facilities, SEO friendly URLs and is designed with the intention
# of allowing users to create a community around their index.
#
# For information on how to install, please refer to INSTALL.txt
#
# To discuss use irc.synirc.net #newznab
#
# Thanks to:
# Gizmo - https://github.com/SynoCommunity/spksrc/issues/249
# Newznab - http://newznab.readthedocs.org/en/lates ... requisites
# http://newznab.readthedocs.org/en/lates ... ntu-11.10/
#
# Author: J. van Emden (Brickman)
# Latest version: http://synology.brickman.nl
#
# Version:
# 2012-12-15:
# - Initial release
#
#################################
##############################################################
##############################################################
## ##
## This installation requires a bootstrapped Synology, ##
## more info can be found on: ##
## http://bit.ly/l2Hx5a ##
## ##
##############################################################
##############################################################
##################################################
## Configure the Web Services in DSM ##
##################################################
# Go to your DSM:
# Control Panel -> Web Services -> Web Applications ->
# Check "Enable Web Station" and "Enable MySQL"
# Control Panel -> Web Services -> PHP Settings:
# Under "Select PHP extension": Make sure that
# the following items are checked: gd, mysql, openssl, zip, zlib
# Control Panel -> Web Services -> PHP Settings:
# Check "Customize PHP open_basedir"
# Add ':/opt/share/pear:/volume1/@appstore/newznab' at the end of open_basedir
#
# Press the Ok button
##################################################
## ipkg package install ##
##################################################
# Connect to your Synology DiskStation using SSH, and login
# as root (password is the same as admin!)
# If you have not installed Sick Beard or CouchPotato,
# install git on your system
--- Code: ---ipkg update # Download the latest package list
ipkg upgrade # Upgrade installed packages to the latest version
ipkg install git # Install git if it is not on your system
ipkg install textutils # Needed to use git pull to update from the source
ipkg install nano # Install Nano text editor or use vi
--- Einde van code ---
# Packages required for Newznab
--- Code: ---ipkg install php-pear -nodeps
--- Einde van code ---
# Install PHP PEAR without the php-package
--- Code: ---ipkg install php-curl -nodeps
--- Einde van code ---
# Install PHP curl without the php-package
##################################################
## Configure the PHP configuration ##
##################################################
# Open the PHP configuration file
--- Code: ---nano /usr/syno/etc/php.ini
--- Einde van code ---
#
# Go to line 469 which starts with 'memory_limit'
# change it to 'memory_limit = 256M'
#
# Go to line 804 which starts with ';include_path'
# change it to 'include_path = ".:/php/includes:/opt/share/pear"'
# to include the PEAR directory
##################################################
## Apache configuration ##
##################################################
# To enable the Newznab web interface the DocumentRoot
# has to be added to apache. When you installed Spotweb
# already, continue with point 2.
# 1) Edit the apache config
--- Code: ---nano /usr/syno/apache/conf/httpd.conf-user
--- Einde van code ---
# 1) Add the following lines after the following entry: <Directory "/var/services/web"> ...... </Directory>
# Include external config
Include /volume1/@appstore/.apache_conf/apache.conf
# 1) Create a directory to store the configuration files (saves you some work after an upgrade of DSM)
--- Code: ---mkdir /volume1/@appstore/.apache_conf
--- Einde van code ---
# 1) Retrieve configuration file
--- Code: ---wget -O /volume1/@appstore/.apache_conf/apache.conf https://dl.dropbox.com/u/5653370/syn_files/apache_conf/apache.conf --no-check-certificate
--- Einde van code ---
# 2) Retrieve newznab configuration file
--- Code: ---wget -O /volume1/@appstore/.apache_conf/newznab.conf https://dl.dropbox.com/u/5653370/syn_files/apache_conf/newznab.conf --no-check-certificate
--- Einde van code ---
# 2) Restart apache
--- Code: ---/usr/syno/etc.defaults/rc.d/S97apache-user.sh restart
--- Einde van code ---
##################################################
## Retreive an clone of Newznab ##
##################################################
# Go to the website directory
--- Code: ---cd /volume1/@appstore
--- Einde van code ---
# Retrieve a version of the repository
--- Code: ---git clone git://github.com/kop1/newznab.git /volume1/@appstore/newznab
--- Einde van code ---
# Enter the newznab directory
--- Code: ---cd newznab
--- Einde van code ---
# Change the permissions of certain directories
--- Code: ---chmod 777 /volume1/@appstore/newznab/www/lib/smarty/templates_c
chmod 777 /volume1/@appstore/newznab/www/covers/movies
chmod 777 /volume1/@appstore/newznab/www/covers/console
chmod 777 /volume1/@appstore/newznab/www/covers/music
chmod 777 /volume1/@appstore/newznab/www
chmod 777 /volume1/@appstore/newznab/www/install
chmod 777 /volume1/@appstore/newznab/nzbfiles/
--- Einde van code ---
##################################################
## MySQL configuration ##
##################################################
EDIT: de installer van Newznab via de webinterface kun je ook gebruiken. Deze kan zelf de MySQL aanmaken.
# If you did not change the root password this can be done with the following:
--- Code: ---/usr/syno/mysql/bin/mysqladmin -u root password NEWPASSWORD
--- Einde van code ---
# Start the mysql CLI application (login with the created password)
--- Code: ---/usr/syno/mysql/bin/mysql -p
--- Einde van code ---
# Connected to mysql (when connected one sees: mysql>)
# Create the newznab database
--- Code: ---CREATE DATABASE newznab;
--- Einde van code ---
# Create a localuser called newznab (replace password by a new password)
--- Code: ---CREATE USER 'newznab'@'localhost' IDENTIFIED BY 'password';
--- Einde van code ---
# Grant the newznab user access to the newznab database
# (replace password by the new password)
--- Code: ---GRANT ALL PRIVILEGES ON newznab.* TO newznab @'localhost' IDENTIFIED BY 'password';
--- Einde van code ---
# Exit the mysql interface
--- Code: ---quit
--- Einde van code ---
##################################################
## Configure Newznab ##
##################################################
# Run Installer
# It is now time to configure Newznab. This is done via a web-based installer.
# Open up http://localhost/install in a web browser (or whatever the address/IP address
# is of your server) and follow the guided steps.
# Enable Groups
# Head over to /admin/group-list.php in your web browser and pick some groups to index
# by clicking "activate" on a few groups.
##################################################
## Retrieve Regular expressions to match ##
## releases ##
##################################################
# Go to the temp directory
--- Code: ---cd /volume1/@tmp
--- Einde van code ---
# Retrieve the SQL file
--- Code: ---wget https://raw.github.com/kop1/newznab/master/db/latestregex.sql --no-check-certificate
--- Einde van code ---
# Insert the expressions into the database
--- Code: ---/usr/syno/mysql/bin/mysql -u newznab -p newznab < latestregex.sql
--- Einde van code ---
##################################################
## Download scripts ##
##################################################
# Create a script dir
--- Code: ---mkdir /volume1/@appstore/scripts
--- Einde van code ---
# Download the update file for Newznab
--- Code: ---wget -O /volume1/@appstore/scripts/newznab_back.sh https://dl.dropbox.com/u/5653370/syn_files/newznab/newznab_back.sh --no-check-certificate && chmod a+x /volume1/@appstore/scripts/newznab_back.sh
wget -O /volume1/@appstore/scripts/newznab_retr.sh https://dl.dropbox.com/u/5653370/syn_files/newznab/newznab_retr.sh --no-check-certificate && chmod a+x /volume1/@appstore/scripts/newznab_retr.sh
--- Einde van code ---
Achtergrond:
Het is goed om iets te vertellen over de achtergrond en hoe newznab te werk gaat.
Newznab download zogenaamde binaries van je eigen usenet server. Een binary is een 'part' van een geheel.
--- Code: ---Homeland.Defense.National.Security.Patrol-SKIDROW - [1/7] - Homeland.Defense.National.Security.Patrol-SKIDROW.rar" yEnc (1/37)
--- Einde van code ---
Zoals je in het voorbeeldje ziet, bestaan bestanden altijd (meestal) uit verschillende delen,. In het voorbeeld uit 37 delen. Newznab zal dus 37 losse delen (binaries) downloaden. Vervolgens moeten deze 37 binaries samengevoegd worden, dan heeft het een 'release'. Op die manier hoef je niet 37 NZB's te downloaden (voor iedere binary 1), maar slechts 1 NZB voor deze release. Dat scheelt dus een hoop. Om van de binaries te matchten tot releases, gebruikt newznab een 'regex' systematiek. Dat is simpel gezegd een soort zoekstring, die verschillende binaries met elkaar probeert te koppelen. En daar zit wel een catch, want met de gratis versie worden slechts 2 regex strings meegeleverd. Die bij mij allebei helemaal niet werkte... Newznab wil je laten betalen voor de volledige versie (newznab-plus genaamd) die meer dan 700 regex strings heeft. Gelukkig heeft Martijn85 hier al een oplossing voor gevonden, de regex strings zijn hier te vinden:
--- Code: ---https://github.com/kop1/newznab/tree/master/db
--- Einde van code ---
Hier download je een sql-bestand dat je kunt invoegen in je MySQL-database. Als je niet weet hoe dat moet, even op googlen. Ik heb SQLBuddy geïnstalleerd om dit te doen.[/color]
edit: de regex zijn ouder dan die genoemd hierboven. Deze stap hoef je niet uit te voeren.
Onderhoud:
Als alles werkt, moet je je database gaan vullen. Eerst kies je een beperkt aantal nieuwsgroepen (begin met 2 of 3) via het admin-gedeelte van de website. Activeer hier een paar groepen. Open vervolgens een telnet sessie en geef deze code in:
--- Code: ---cd /volume1/web/nnplus/misc/update_scripts && /usr/bin/php update_binaries.php
--- Einde van code ---
De binaries worden nu binnen gehaald. Deze worden beperkt tot 1 dag.
Vervolgens geef je deze code in van de binaries ook releases te kunnen maken:
--- Code: ---cd /volume1/web/nnplus/misc/update_scripts && /usr/bin/php update_releases.php
--- Einde van code ---
Als je een krachtige NAS hebt, of tijd over, kun je de backfill optie gebruiken. Zie hiervoor het groepenoverzicht in het admin-gedeelte van je newznab site. Backfill betekent dat het systeem meerdere dagen terug gaat zoeken. Zet dit niet te hoog om te beginnen!! 5 dagen op populaire groepen levert al vlug 1.000.000 binaries op!! Gebruik, als je de backfill per active groep hebt ingesteld, de volgende code:
--- Code: ---cd /volume1/web/nnplus/misc/update_scripts && /usr/bin/php backfill.php
--- Einde van code ---
Dit is de basis. Ik krijg vaak een foutmelding: "Failed to write to socket". Ik denk nu te weten waar dit vandaan komt. Ik zal dat verder uitzoeken en deze tutorial aanpassen als ik er achter ben.
Edit: ik dacht dat de timeouts voortkwamen uit een te lage php_execution waarde. Dat bleek niet het geval. Ik gebruikte bintube als usenet provider. Nu heb ik een testabonnement bij een andere provider genomen en het timeout probleem is weg.
Succes met de installatie!
mikev:
Dank voor deze manual.
Ik loop alleen vast op een puntje.
Na het downloaden van de conf files en het plaatsen in de juiste dir (gaat niet met wget op mijn synology DS411+II trouwens https not working) loop ik tegen deze error aan bij het herstarten van apache.
--- Code: ---Syntax error on line 14 of /volume1/@appstore/.apache_conf/newznab.conf:
<Location not allowed here
/usr/syno/etc.defaults/rc.d/S97apache-user.sh: user httpd could not be started
--- Einde van code ---
Enig idee wat is hier mis mee is? Heeft iemand het al draaien middels deze tutorial?
de config apache.conf is correct en de newznab.conf ook.
Ik kijk uit naar enige reacties
thecell:
--- Citaat van: "LukeVredeveld" ---
##############################################################
## ##
## This installation requires a bootstrapped Synology, ##
## more info can be found on: ##
## http://bit.ly/l2Hx5a ##
## ##
##############################################################
--- Einde van citaat ---
Ik liep al vast maar na wat zoeken vind ik hier een package voor. Makkelijker kan niet. :)
thecell:
Ik zit ook vast :cry:
--- Code: ---wget -O /volume1/@appstore/.apache_conf/apache.conf https://dl.dropbox.com/u/5653370/syn_files/apache_conf/apache.conf --no-check-certificate
--- Einde van code ---
--- Citaat ---wget unrecognized option --no-check-certificate
--- Einde van citaat ---
Brickman:
De HowTo verspreid zich sneller dan gedacht :D. Er zaten nog wat fouten in, maar die zijn er nu uitgehaald.
De laatste versie van de handleiding is hier te vinden.
Navigatie
[0] Berichtenindex
[#] Volgende pagina
Naar de volledige versie