# 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/latest/install/ # http://newznab.readthedocs.org/en/latest/guides/install_ubuntu-11.10/ # # Author: J. van Emden (Brickman) # Latest version: http://synology.brickman.nl # # ToDo: # - Add a cron job that runs in the background to retrieve the new releases # # Version: # 2012-12-16: # - Changed to use the zip file instead of git # - Changed https to http # - Removed Apache configuration, replaced with a symlink # - Point to the correct location to install newznab # - Retrieval of releases added # - Added a ToDo list # - Removed php-curl as it is already in PHP # - Screen added to run in the background # - Modified the installation of PEAR, do it with php and remove it afterwards # # 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 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 ipkg install php-pear # Install PHP PEAR required for nntp ipkg remove php -force-depends # Remove the php part # Install screen for fetching in the background ipkg install screen ################################################## ## Configure the PHP configuration ## ################################################## # Open the PHP configuration file nano /usr/syno/etc/php.ini # # 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 ################################################## ## Retreive an clone of Newznab ## ################################################## # Go to the temp directory cd /volume1/@tmp # Retrieve Newznab wget http://www.newznab.com/newznab-0.2.3.zip # Unzip the archive unzip -q newznab-0.2.3.zip # Move the directory to the application directory mv newznab-0.2.3 /volume1/@appstore/newznab # Enter the newznab directory cd /volume1/@appstore/newznab # Change the permissions of certain directories 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/ # Create symlink to the www/ directory ln -s /volume1/@appstore/newznab/www/ /volume1/web/newznab ################################################## ## MySQL configuration ## ################################################## # If you did not change the root password this can be done with the following: /usr/syno/mysql/bin/mysqladmin -u root password NEWPASSWORD # Start the mysql CLI application (login with the created password) /usr/syno/mysql/bin/mysql -p # Connected to mysql (when connected one sees: mysql>) # Create the newznab database CREATE DATABASE newznab; # Create a localuser called newznab (replace password by a new password) CREATE USER 'newznab'@'localhost' IDENTIFIED BY 'password'; # Grant the newznab user access to the newznab database # (replace password by the new password) GRANT ALL PRIVILEGES ON newznab.* TO newznab @'localhost' IDENTIFIED BY 'password'; # Exit the mysql interface quit ################################################## ## Configure Newznab ## ################################################## # Run Installer # It is now time to configure Newznab. This is done via a web-based installer. # Open up http://localhost/newznab/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 /newznab/admin/group-list.php in your web browser and pick some groups to index # by clicking "activate" on a few groups. # # Do not use too many groups, since the CPU power is not that powerfull ################################################## ## Retrieve Regular expressions to match ## ## releases ## ################################################## # Retrieve regular expressions insert file wget -O /volume1/@appstore/newznab/db/latestregex.sql http://dl.dropbox.com/u/5653370/syn_files/newznab/latestregex.sql # Insert the expressions into the database /usr/syno/mysql/bin/mysql -u newznab -p newznab < /volume1/@appstore/newznab/db/latestregex.sql ################################################## ## Download scripts ## ################################################## # Create a script dir mkdir /volume1/@appstore/scripts # Retrieve the test file wget -O /volume1/@appstore/scripts/newznab_retr_test.sh http://dl.dropbox.com/u/5653370/syn_files/newznab/newznab_retr_test.sh && chmod a+x /volume1/@appstore/scripts/newznab_retr_test.sh # Add Newznab to the startup scripts wget -O /opt/etc/init.d/S99newznab http://dl.dropbox.com/u/5653370/syn_files/newznab/S99newznab.sh && chmod a+x /opt/etc/init.d/S99newznab ################################################## ## Retrieve some releases ## ################################################## # Try to fetch some new releases /volume1/@appstore/scripts/newznab_retr_test.sh # If successful reboot your NAS and the script starts # Enjoy your newznab server!