Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!


[How To] Install NewzNab on Ubuntu 12.04
New on LowEndTalk? Please Register and read our Community Rules.

All new Registrations are manually reviewed and approved, so a short delay after registration may occur before your account becomes active.

[How To] Install NewzNab on Ubuntu 12.04

FreekFreek Member
edited December 2012 in Tutorials

**** Basic Tutorial on How To Install NewzNab on Ubuntu 12.04 64 bit. ****
This tutorial is optimized for speed and intended to be setup on a server dedicated to Newznab ONLY

  1. Perform a clean installation of Ubuntu 12.04 64-bit.

  2. Login as root and perform an 'apt-get update'.

  3. Download minstall:
    cd ~; rm -rf minstall; mkdir minstall; cd minstall; wget --no-check-certificate -O minstall.tar.gz http://www.github.com/downloads/KnightSwarm/Minstall/Latest.tar.gz; tar zxvf minstall.tar.gz; rm minstall.tar.gz

  4. Run: bash minstall.sh install-extra-repositories
    bash minstall.sh clean-packages
    bash minstall.sh install-ssh

  5. Reboot

  6. 'cd minstall' and run: bash minstall.sh install-extra-packages

  7. Run: bash minstall.sh configure-general
    bash minstall.sh configure-ssh
    bash minstall.sh configure-upgrade
    bash minstall.sh configure-user

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

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

  10. nano /etc/apt/preferences.d/percona
    and put this inside:

Package: *
Pin: release l=percona
Pin-Priority: 700

  1. apt-get update
    apt-get install -y php5 php5-dev php-pear php5-gd php5-curl nginx php5-fpm mc percona-server-client-5.5 percona-server-server-5.5 libmysqlclient-dev php5-mysql

  2. mkdir -p /var/log/nginx
    chmod 755 /var/log/nginx
    mkdir -p /var/www/newznab
    chmod 777 /var/www/newznab

  3. nano /etc/nginx/sites-available/newznab

server {
# Change these settings to match your machine
listen 80 default_server;
server_name SERVER_IP_HERE or 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;
}

}

  1. unlink /etc/nginx/sites-enabled/default
    ln -s /etc/nginx/sites-available/newznab /etc/nginx/sites-enabled/newznab

  2. nano /etc/php5/cli/php.ini
    edit: max_execution_time = 120
    edit: memory_limit = -1
    edit: date.timezone = Europe/Amsterdam (for example)

  3. nano /etc/php5/fpm/php.ini
    edit: max_execution_time = 120
    edit: memory_limit = -1
    edit: date.timezone = Europe/Amsterdam (for example)

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

Each process takes about 60Mb. Keep this in mind when configuring FPM. These settings are for a 512MB Linode. Adjust as necessary.

pm = dynamic
pm.max_children = 7
pm.start_servers = 1
pm.min_spare_servers = 1
pm.max_spare_servers = 2
pm.max_requests = 500
listen = 127.0.0.1:9000

  1. wget http://www.newznab.com/newznab-0.2.3.zip
    unzip newznab-0.2.3.zip
    mv newznab-0.2.3 newznab
    mv newznab /var/www/

19.chmod 777 /var/www/newznab/www/lib/smarty/templates_c
chmod 777 /var/www/newznab/www/covers/movies
chmod 777 /var/www/newznab/www/covers/music
chmod 777 /var/www/newznab/www
chmod 777 /var/www/newznab/www/install
chmod 777 /var/www/newznab/nzbfiles/

  1. nano /var/www/newznab/www/lib/framework/basepage.php
    Find: $this->serverurl = (isset($_SERVER["HTTPS"]) ? "https://" : "http://").$_SERVER["SERVER_NAME"].($_SERVER["SERVER_PORT"] != "80" ? ":".$_SERVER["SERVER_PORT"] : "").WWW_TOP.'/';
    Replace HTTPS with HTTP

  2. Reboot

  3. Open Webbrowser http://yourip/install and follow instructions

  4. Delete install dir: rm -rf /var/www/newznab/www/install

«1

Comments

  • FreekFreek Member
    edited December 2012

    AaarrGGhhh, Markdown seriously. Why can't we be friends!?
    How do I properly list code? I now used < pre > tags but look at the mess.
    The ' trick isn't working properly when using code on multiple lines
    < code > is crappy too.

  • Indent code, should work

  • Cool, what are you gonna use newznab for?

  • @kamalnasser said: Indent code, should work

    Isn't indent code the ' trick?

    @djvdorp said: Cool, what are you gonna use newznab for?

    In combination with SickBeard and CouchPotato to automatically download my favorite TV Shows/Series and Movies from Usenet :)

  • Thanks Freek.

  • Nice tutorial. Thanks Freek :)

  • @Freek said: In combination with SickBeard and CouchPotato to automatically download my favorite TV Shows/Series and Movies from Usenet :)

    @Freek: Ah I see, its like running your own nzbsrus for SickBeard / CouchPotato?

  • @djvdorp said: Ah I see, its like running your own nzbsrus for SickBeard / CouchPotato?

    Correct!

    PS: If a mod could fix the Markdown in my TS that would be great!

  • @Freek said: In combination with SickBeard and CouchPotato to automatically download my favorite TV Shows/Series and Movies from Usenet :)

    Why go with a self-hosted one instead of NZBMatrix, DogNZB, etc etc?

  • @gsrdgrdghd said: Why go with a self-hosted one instead of NZBMatrix, DogNZB, etc etc?

    Newzbin recently closed it's door so the only real alternative right now is NZBMatrix, sinds NZB.org & DogNZB is on invite basis only. NZBsRus does not have backlog functionality.
    And ofcourse, because you can! Playing with servers is fun :D

    Bear in mind it consumes pretty much RAM. 512MB is probably only enough for personal use.

  • If you want an invite for DOGnzb just PM me your email address. Btw SickBeard has an integrated Newznab service that works pretty well

  • @gsrdgrdghd said: If you want an invite for DOGnzb just PM me your email address. Btw SickBeard has an integrated Newznab service that works pretty well

    PM Sent
    True but it doesn't support backlog searches.

  • Has anyone tried to install on Ubuntu 12.10? After I run bash minstall.sh clean-packages and reboot all I get is a blank desktop with the default wallpaper...no icons nothing. Does this only work on 12.04?

  • FreekFreek Member
    edited December 2012

    Only designed to work with 12.04 server!
    Since I can't edit the OP anymore, updated version available here:
    http://freek.ws/2012/12/02/basic-tutorial-on-how-to-install-newznab-on-ubuntu-12-04-64-bit/

  • I think I know what I'm doing with my Kimsufi tonight, thanks!

  • Hi

    Just followed this to the letter, but seem to have a permissions issue ...

    403 Forbidden when trying to get to the install page, and this in the logs:

    2012/12/10 20:09:38 [error] 2151#0: *2 open() "/var/www/newznab/www/install" failed (13: Permission denied), client: IP, server: IP, request: "GET /install HTTP/1.1", host: "IP"

    I have double checked and re-ran:

    chmod 777 /var/www/newznab/www/install

    Any ideas ?

    Thanks

    Nik

  • @nikc You need to change the owner of the folder to that of your web server:

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

  • I'd love to see a config for an nginx server running multiple sites. I'm tinkering around with it but I'm far from an nginx config expert.

  • lenny?

  • I've setup newznab with these settings on a 1GB RAM VPS, and during the update, the MySQL process takes up more and more ram and eventually crashes. Is there a way of limiting the amount of resources the DB takes up?

  • Just configure it as a vhost, @mattgrif.

  • @funtek Yes, try and limit pm.max_children to lets say 3 for testing.

  • Anyone had any luck with generating releases? Everything else upto and including getting the binaries seems to be working, but when I run the script to generate releases, it runs through but none are created.

  • @telephone said: @nikc You need to change the owner of the folder to that of your web server:

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

    Didn't help :( Any other suggestions ?

  • For folks not getting any releases....you need to pay for the plus version which comes with the REGEXS needed to create releases out of the headers. The free version is worthless without these.

  • erhwegesrgsrerhwegesrgsr Member
    edited December 2012

    @Freek

    The trick is to put the code tag inside the pre tag ;-)
    To achieve multiline properly
  • @ssaeed said: For folks not getting any releases....you need to pay for the plus version which comes with the REGEXS needed to create releases out of the headers. The free version is worthless without these.

    A hefty bit of googling brought me to the same conclusion (probably would have worked it out quicker if the SABnzbd forums hadn't been temporarily closed), seems a bit weird that the free version doesn't processes anything though, it's hardly an incentive to buy.

  • I ran the classic version before I bought the plus version and it worked fine? I was getting releases so...

  • NekkiNekki Veteran
    edited December 2012

    @Freek said: I ran the classic version before I bought the plus version and it worked fine? I was getting releases so...

    I guess it may depend on the groups you chose to index, and how far back you went. Obviously nothing in the classic version could match to the groups I tested it with, because I grabbed the headers just fine.

  • @Nekki said: I guess it may depend on the groups you chose to index, and how far back you went. Obviously nothing in the classic version could match to the groups I tested it with, because I grabbed the headers just fine.

    The 16USD for the plus version (one off fee) wouldnt be the problem for me if it could replace nzbmatrix and such in my sickbeard ea :P

Sign In or Register to comment.