Newznab+ Settings

Door MrOizo2005 op zaterdag 15 december 2012 11:36 - Reacties (3)
Categorie: Newznab+, Views: 5.497

Omdat toch wel aardig wat mensen vragen om de settings van newznab deel ik ze hier maar. Ook ik ben hier geen guru in, dus alle aanvullingen zijn welkom:

Admin Ľ Site Edit:

3rd Party Application Paths

Unrar Path/usr/bin/unrar
Temp Unrar File Path/var/www/newznab/nzbfiles/tmpunrar
Mediainfo Path/usr/bin/mediainfo
Ffmpeg Path/usr/local/bin/ffmpeg
Lame Path/usr/bin/lame


Usenet Settings

Nzb File Path/var/www/newznab/nzbfiles/
Header Retention1
Release Retention1200
Minimum Files to Make a Release1
Minimum File Size to Make a Release52428800
Minimum Completion Percent to Make a Release95
Remove SpamYes
Spam - Accepted Exe Categories4000,4010,4020,4030,4040,4050,4060,4070,7010
Use Compressed HeadersYes
Max Messages20000
Where to start new groupsDays - 1


Lookup Settings

Lookup NfoYes
Lookup TV RageYes
Lookup TheTVDBYes
Lookup MoviesYes
Lookup AniDBYes
Lookup MusicYes
Lookup GamesYes
Lookup BooksYes
Lookup PreviewYes
Save Audio PreviewNo


Password Settings

Check For Passworded ReleasesDeep (requires unrar)
Delete Passworded ReleasesYes
Show Passworded ReleasesDont show passworded or potentially passworded


Sphinx Settings

Use SphinxYes
Index NZB ContentsYes
Index NFO ContentsYes
Index ReleaseFilesYes
Index PreDBYes
Search Server Host127.0.0.1:9306
Sphinx Configuration Path/var/www/newznab/db/sphinxdata/sphinx.conf
Sphinx Binaries Path
Default Search Field(s)name,searchname
Merge Frequency0200 or 10000
Rebuild FrequencyMonday - 0300


Groups

a.b.boneless
a.b.etc
a.b.hdtv
a.b.hdtv.x264
a.b.misc
a.b.movies
a.b.mp3
a.b.mp3.full_albums
a.b.multimedia
a.b.multimedia.tv
a.b.teevee
a.b.town
a.b.tv
a.b.tvseries
a.b.x264

Newznab+ installatie (ubuntu / nginx / percona)

Door MrOizo2005 op dinsdag 11 december 2012 23:08 - Reacties (51)
Categorie: Newznab+, Views: 16.812

Deze RAW howto heb ik gebruikt met Ubuntu 12.10 mini ISO (met alleen open-ssh server)
Let wel op dat je hiervoor een gedoneerde versie van newznab nodig hebt.
opmerkingen en aanvullingen zijn welkom. Ik zal deze blog morgen even netjes neerzetten.

Eerst zorgen dat de server up to date is.
sudo apt-get update
sudo apt-get -y upgrade
sudo apt-get -y dist-upgrade
sudo reboot


Installeer nu de benodigde paketten
sudo apt-get install build-essential checkinstall python-software-properties software-properties-common ssh


Maak alvast de document root aan voor newznab
sudo mkdir -p /var/www/newznab
sudo chmod 777 /var/www/newznab


Installatie van percona

gpg --keyserver  hkp://keys.gnupg.net --recv-keys 1C4CBDCDCD2EFD2A
gpg -a --export CD2EFD2A | sudo apt-key add -

sudo sh -c "echo  \"\n#Percona\" >> /etc/apt/sources.list"
sudo sh -c "echo  \"deb http://repo.percona.com/apt quantal main\" >> /etc/apt/sources.list"
sudo sh -c "echo  \"deb-src http://repo.percona.com/apt quantal main\" >> /etc/apt/sources.list"

sudo apt-get update
sudo apt-get install -y percona-server-client-5.5 \
                        percona-server-server-5.5 \
                        libmysqlclient-dev


Installeren van Nginx

sudo apt-get install -y nginx
sudo apt-get install -y php5-fpm


in de php.ini moeten een aantal dingen veranderd worden
sudo nano /etc/php5/fpm/php.ini

verander: max_execution_time = 120
verander: memory_limit = 256M
verander: date.timezone = Europe/Amsterdam (let op dat je wel de ";" aan het begin weg haalt)


Restart PHP5-fpm
sudo /etc/init.d/php5-fpm restart


Maak een nieuwe nginx site aan
sudo nano /etc/nginx/sites-available/newznab


server {
    # Change these settings to match your machine
    listen 80 default_server;
    server_name localhost;

    # Everything below here doesn't need to be changed
    access_log /var/log/nginx/access.log;
    error_log /var/log/nginx/error.log;

    root /var/www/newznab/www/;
    index index.html index.htm index.php;

    location ~* \.(?:ico|css|js|gif|inc|txt|gz|xml|png|jpe?g) {
            expires max;
            add_header Pragma public;
            add_header Cache-Control "public, must-revalidate, proxy-revalidate";
    }

    location / { try_files $uri $uri/ @rewrites; }

    location @rewrites {
            rewrite ^/([^/\.]+)/([^/]+)/([^/]+)/? /index.php?page=$1&id=$2&subpage=$3 last;
            rewrite ^/([^/\.]+)/([^/]+)/?$ /index.php?page=$1&id=$2 last;
            rewrite ^/([^/\.]+)/?$ /index.php?page=$1 last;
    }

    location /admin { }
    location /install { }

    location ~ \.php$ {
            include /etc/nginx/fastcgi_params;
            fastcgi_pass 127.0.0.1:9000;

            # The next two lines should go in your fastcgi_params
            fastcgi_index index.php;
            fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
    }
}


Zorg ervoor dat de logs netjes weg geschreven kunnen worden
sudo mkdir -p /var/log/nginx
sudo chmod 755 /var/log/nginx


Default site is niet meer nodus, dus een nette newznab site aanmaken
sudo unlink /etc/nginx/sites-enabled/default
sudo ln -s /etc/nginx/sites-available/newznab /etc/nginx/sites-enabled/newznab


Installeer alle PHP packages
sudo apt-get install -y php5 php5-dev php-pear php5-gd php5-mysql php5-curl


restart nginx
sudo service nginx restart


installeer unrar

sudo apt-get install -y unrar



FFmpeg / X264

# verwijder bestaande paketten
sudo apt-get remove ffmpeg x264 libav-tools libvpx-dev libx264-dev


Installeer benodigde paketten
sudo apt-get -y install autoconf build-essential checkinstall git libfaac-dev libgpac-dev \
  libmp3lame-dev libopencore-amrnb-dev libopencore-amrwb-dev librtmp-dev libsdl1.2-dev libtheora-dev \
  libtool libvorbis-dev pkg-config texi2html yasm zlib1g-dev


# x264
Installeer x264 vanaf git
cd
git clone --depth 1 git://git.videolan.org/x264
cd x264
./configure --enable-static
make
sudo checkinstall --pkgname=x264 --pkgversion="3:$(./version.sh | \
  awk -F'[" ]' '/POINT/{print $4"+git"$5}')" --backup=no --deldoc=yes \
  --fstrans=no --default


# fdk-aac
cd
git clone --depth 1 git://github.com/mstorsjo/fdk-aac.git
cd fdk-aac
autoreconf -fiv
./configure --disable-shared
make
sudo checkinstall --pkgname=fdk-aac --pkgversion="$(date +%Y%m%d%H%M)-git" --backup=no \
  --deldoc=yes --fstrans=no --default


# libvpx
cd
git clone --depth 1 http://git.chromium.org/webm/libvpx.git
cd libvpx
./configure
make
sudo checkinstall --pkgname=libvpx --pkgversion="1:$(date +%Y%m%d%H%M)-git" --backup=no \
  --deldoc=yes --fstrans=no --default


# FFmpeg
cd
git clone --depth 1 git://source.ffmpeg.org/ffmpeg
cd ffmpeg
./configure --enable-gpl --enable-libfaac --enable-libfdk-aac --enable-libmp3lame \
  --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-librtmp --enable-libtheora \
  --enable-libvorbis --enable-libvpx --enable-libx264 --enable-nonfree \
  --enable-version3
make
sudo checkinstall --pkgname=ffmpeg --pkgversion="7:$(date +%Y%m%d%H%M)-git" --backup=no \
  --deldoc=yes --fstrans=no --default
hash x264 ffmpeg ffplay ffprobe


Installeer lame codec voor de muziek preview optie
sudo apt-get install -y lame


MediaInfo
cd
sudo add-apt-repository ppa:shiki/mediainfo
sudo apt-get update
sudo apt-get install -y mediainfo


Sphinx
sudo add-apt-repository ppa:chris-lea/sphinxsearch
sudo apt-get update && sudo apt-get install sphinxsearch


Zorg ervoor dat sphinx automatisch start tijdens een verse herstart van de server
sudo nano /etc/default/sphinxsearch 
verander "START=no" naar "START=yes"


Newznab

verander bij username de login die je hebt gehad in de mail van newznab
sudo apt-get install -y subversion
svn co svn://{USERNAME}@svn.newznab.com/nn/branches/nnplus /var/www/newznab


Zet alle rechten goed

sudo chown -R  www-data:www-data /var/www/newznab/


sudo chmod 755 /var/www/newznab/www/lib/smarty/templates_c
sudo chmod 755 /var/www/newznab/www/covers/movies
sudo chmod 755 /var/www/newznab/www/covers/anime
sudo chmod 755 /var/www/newznab/www/covers/music
sudo chmod 755 /var/www/newznab/www
sudo chmod 755 /var/www/newznab/www/install
sudo chmod 755 /var/www/newznab/nzbfiles/



php5-fpm nginx fix

Bij mij deed nginx webserver het standaard niet, dit was voor mij de fix.

sudo nano /etc/php5/fpm/pool.d/www.conf

verander: listen = /var/run/php5-fpm.sock
naar : listen = 9000


restart php5-fpm
sudo /etc/init.d/php5-fpm restart



maak een database aan

sudo mysql -p
CREATE DATABASE newznab;
CREATE USER 'newznab'@'localhost' IDENTIFIED BY 'password';
GRANT ALL PRIVILEGES ON newznab.* TO newznab @'localhost' IDENTIFIED BY 'password';
quit



Newznab

Newznab installeren via de web install


Sphinx fix

Eerst settings in newznab doen (use sphinx aanzetten)

cd /var/www/newznab/misc/sphinx
./nnindexer.php generate
./nnindexer.php daemon
./nnindexer.php index full all
./nnindexer.php index delta all
./nnindexer.php daemon --stop
./nnindexer.php daemon


InnoDB

De meeste snelheid met Percona word gewonnen d.m.v. InnoDB, deze zetten we dan op de tabellen die het meest gebruikt worden.

sudo mysql -p
use newznab;
ALTER TABLE parts ENGINE = INNODB;
ALTER TABLE binaries ENGINE = INNODB;
ALTER TABLE partrepair ENGINE = INNODB;
quit


Update script

cd /var/www/newznab/misc/update_scripts/nix_scripts
sudo cp newznab_screen.sh newznab_screen_local.sh
sudo nano newznab_screen_local.sh


verander de NEWZNAB_PATH naar:
export NEWZNAB_PATH="/var/www/newznab/misc/update_scripts"


Nu kan je hem draaien als alles ingesteld is in newznab
screen sh /var/www/newznab/misc/update_scripts/nix_scripts/newznab_screen_local.sh