Howdy, Stranger!

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

Sign In with OpenID
Advertise on LowEndTalk.com

In this Discussion

[How To] Install NewzNab on Ubuntu 12.04

[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

Linux noob willing to learn.

«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.

    Linux noob willing to learn.

  • Indent code, should work

  • Cool, what are you gonna use newznab for?

    I use http://tuxlite.com to configure all my VPSes and I love it!

  • @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 :)

    Linux noob willing to learn.

  • Nice tutorial. Thanks Freek :)

    My blog | Server Uptime | I'm not working for any providers in here, all my comments just my own opinion.image
  • @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?

    I use http://tuxlite.com to configure all my VPSes and I love it!

  • @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!

    Linux noob willing to learn.

  • @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.

    Linux noob willing to learn.

  • 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.

    Linux noob willing to learn.

  • 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/

    Linux noob willing to learn.

  • NekkiNekki Moderator

    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.

  • 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.

    -- BOFH

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

    Linux noob willing to learn.

  • NekkiNekki Moderator

    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
  • NekkiNekki Moderator

    @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...

    Linux noob willing to learn.

  • NekkiNekki Moderator
    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

    I use http://tuxlite.com to configure all my VPSes and I love it!

  • NekkiNekki Moderator

    @djvdorp said: 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

    I took a gamble on it and it's paid off, tons of releases after I paid up - looks like it's the regex database that comes with the paid version that makes the difference, as the older one in the free version's no good at matching up the newer releases. It's going to take a long time for the initial indexing though (even going back 10 days as a test means upto 2 million binaries to process in some groups), I'm not sure how far back I actually want to start now.

  • @Nekki said: It's going to take a long time for the initial indexing though

    I've read somewhere that they (the NN devs) provide a downloadable database for that, IIRC you need to join their IRC and ask them

  • Been looking into running this but does anyone have any figures regarding usage/resources? From what i gather it's pretty intensive during indexing and not something that's going to run well on a 128mb vps.

    Also, what's the stance on using Newznab with a LEB provider? I'm assuming, even if it was private/restricted access (to one or two users), it'd be against most providers TOS.

    Another Newznab tutorial - http://newznab.readthedocs.org/en/latest/guides/install_ubuntu-11.10/

  • NekkiNekki Moderator

    @gsrdgrdghd said: I've read somewhere that they (the NN devs) provide a downloadable database for that, IIRC you need to join their IRC and ask them

    There's a slightly cryptic comment about joining IRC to get your index built quickly, I presume that's what's alluded to.

    @Dom said: Been looking into running this but does anyone have any figures regarding usage/resources? From what i gather it's pretty intensive during indexing and not something that's going to run well on a 128mb vps.

    The documentation states that there needs to be 256MB available to PHP as a minimum, so I guess realistically you're looking at a 512MB VPS most likely.

    @Dom said: lso, what's the stance on using Newznab with a LEB provider? I'm assuming, even if it was private/restricted access (to one or two users), it'd be against most providers TOS.

    My guess is that most won't be too happy with it, especially if you're running a public instance. Given some of the conversations recently about providers disallowing even legal activities if it could get them into trouble, you'd be better off asking before buying. BuyVM are probably OK, and if you let them know what you're doing in advance, they'll probably stick you on a Canadian IP.

  • @Freek - maybe instead of using Percona repos for lenny use those for precise

    gpg --keyserver hkp://keyserver.ubuntu.com --recv-keys 1C4CBDCDCD2EFD2A gpg -a --export CD2EFD2A | apt-key add -

    if [ -f "/etc/apt/sources.list.d/percona.list" ]; then echo "Percona repository list exists ... skiping"; else echo "deb http://repo.percona.com/apt precise main" >> /etc/apt/sources.list.d/percona.list echo "deb-src http://repo.percona.com/apt precise main" >> /etc/apt/sources.list.d/percona.list fi;

  • @gbshouse said: @Freek - maybe instead of using Percona repos for lenny use those for precise

    Crap, good one. How do I fix this error on my already live installation? I installed Percona Lenny on Precise...

    Linux noob willing to learn.

  • I finally got it working with the + version .... and its indexing, but all the NZB's I produce are empty :(

  • NekkiNekki Moderator

    @nikc said: I finally got it working with the + version .... and its indexing, but all the NZB's I produce are empty :(

    Mine's working fine since upgrading to plus, the odd issue with a couple of groups aside. How do you mean the NZB's are empty, nothing downloads? If so, could be the items you're downloading have been DCMA'd and the parts removed.

  • when i click download NZB, it just takes me to a blank web page, and when i select multiple NZB's then chose download NZB's I get an empty zip file.

  • NekkiNekki Moderator

    That's odd - have you changed the location nn+ saves the nzbnfiles to and not changed that folder's permissions or something like that?

  • Running in VMWare, after step 5 I get a kernel panic. I went back to the old kernel by scrolling down through the grub menu. Then I logged in and ran "apt-get remove 3.2.0-34", deleted all the 3.2.0-34 files in /boot, and ran "update-grub".

  • Minstall tries to upgrade your kernel for no reason, yes.

    If you know how to setup your own webserver, skip it. It's not rocket science ;)

    -- BOFH

  • Is there any way to slow down the indexing? I have a 256mb being unused right now. Might help if you aren't indexing all groups.

    Too bad nzbmatrix is gone. Just wish there was an easier way to get into dognzb or some of the other privates.

  • NekkiNekki Moderator

    @Fizeau said: Too bad nzbmatrix is gone. Just wish there was an easier way to get into dognzb or some of the other privates.

    Apparently the chances of getting into any of the closed sites are nil at the moment, they're completely shutdown to new users. TBH, I've quite enjoyed putting together my own and working out what groups to index and what not to. Backfiling the groups is a real pain, but it'll be worth it in the end.

  • @Nekki said: Apparently the chances of getting into any of the closed sites are nil at the moment, they're completely shutdown to new users. TBH, I've quite enjoyed putting together my own and working out what groups to index and what not to. Backfiling the groups is a real pain, but it'll be worth it in the end.

    Well thanks, wish me luck! :) I might look into something like ulimit to try and limit the processses memory usage. Maybe can slow it down a bit as to not overwhelm!

  • NekkiNekki Moderator

    @Fizeau You could try setting the memory_limit value in PHP to 256M instead of -1. You could also try reducing the number of headers downloaded simultaneously from 20k to somewhere between 10k & 15k.

  • I'm going to rewrite this tutorial this weekend. Getting lots of mails regarding the minstall part. I will also include some more steps what to do afterwards such as cron jobs etc.

    Linux noob willing to learn.

  • What workload will the Newznab database typically process? OLTP (general-purpose transactional, web application), OLAP (data warehousing, analytics, business intelligence), or read-mostly (forums, blogs, static data)?

    Linux noob willing to learn.

  • @Freek said: I'm going to rewrite this tutorial this weekend. Getting lots of mails regarding the minstall part. I will also include some more steps what to do afterwards such as cron jobs etc.

    Did you ever re-write it ?

  • @nikc said: Did you ever re-write it ?

    No, not yet. Thanks for the reminder. I will try and see if I have time next week, but I can't make any promises. As we speak I'm having issues with my newznab installation as well.

    Linux noob willing to learn.

Sign In or Register to comment.