Last updated: 5th January 2015

 

AUF DEUTSCH LESEN

 

THIS GUIDE HAS ONLY BEEN WRITTEN TO MAKE IT CLEARLY, HOW „EASY“ OR „HARD“ THE SETUP OF OPENBAY WOULD REALLY BE BECAUSE A LOT OF SITES SPREAD INVALID INFORMATION ABOUT THAT. IF YOU AS READER USE THIS GUIDE OR YOU DON’T, IS YOUR OWN RESPONSIBILITY. EVERYTHING YOU DO WITH THIS GUIDE IS AT YOUR OWN RISK. I AM NOT RESPONSIBLE FOR ANY DAMAGE THAT COULD BE CAUSED DUE TO THE USE OF THIS GUIDE. HOW ALREADY SAID: EVERYTHING YOU DO IS AT YOUR OWN RISK.

IF YOU CONTINUE READING THIS GUIDE, YOU AGREE OR ACCEPT THE HOLE RED TEXT ON THIS SITE.

WITH MYSQL, WITHOUT SPHINX ENGINE

1. Preparation

apt-get update

apt-get -y upgrade

apt-get -y install nano unzip php5-fpm wget php5-mysql

wget http://nginx.org/keys/nginx_signing.key && apt-key add nginx_signing.key && rm nginx_signing.key

nano /etc/apt/sources.list

Append…

-for Debian:

Spoiler

deb http://nginx.org/packages/mainline/debian/ [Codename] nginx
deb-src http://nginx.org/packages/mainline/debian/ [Codename] nginx

[collapse]

-for Ubuntu:

Spoiler

deb http://nginx.org/packages/mainline/ubuntu/ [Codename] nginx
deb-src http://nginx.org/packages/mainline/ubuntu/ [Codename] nginx

[collapse]

to the end of the file and replace the square brackets (e.g. with „wheezy“ for Debian 7.x or „trusty“ for Ubuntu 14.x).

apt-get update

apt-get install nginx

openbay1

2. Preconfiguration

mkdir -p /var/www/openbay

nano /etc/nginx/conf.d/openbay.conf

Insert the following spoiler and replace the squared brackets:

Spoiler

server {
listen 80;
server_name [Sub- / Domain or IP];

root /var/www/openbay/www;
index index.php;

set $yii_bootstrap „index.php“;

charset utf-8;
gzip on;
gzip_comp_level 5;
gzip_types text/plain text/css text/javascript application/javascript application/json application/x-javascript text/xml application/xml application/xml+rss;

location / {
index index.php $yii_bootstrap;
try_files $uri $uri/ /$yii_bootstrap?$args;
}

location ~ \.(js|css|png|jpg|gif|swf|ico|svg)$ {
fastcgi_hide_header Set-Cookie;

open_file_cache max=10000 inactive=14d;
open_file_cache_errors on;
open_file_cache_min_uses 3;
open_file_cache_valid 1m;
output_buffers 1 2m;

expires 14d;
}

location ~* \.php$ {
fastcgi_split_path_info ^(.+\.php)(.*)$;
set $fsn /$yii_bootstrap;
if (-f $document_root$fastcgi_script_name){
set $fsn $fastcgi_script_name;
}
fastcgi_pass localhost:9000;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root$fsn;
fastcgi_param PATH_INFO $fastcgi_path_info;
fastcgi_param PATH_TRANSLATED $document_root$fsn;
# fastcgi_param HTTPS $https_value;
}
}

[collapse]

Ctrl + O, Enter, Ctrl + X

nano /etc/php5/fpm/php.ini

Ctrl + W, enter „cgi.fix“, Enter

Replace:

;cgi.fix_pathinfo=1

by:

cgi.fix_pathinfo=0

Now keep Strg + V pressed until you’re at the end of the file. Then paste the following:

extension=pdo.so

extension=pdo_mysql.so

Ctrl + O, Enter

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

Search for

listen = /var/run/php5-fpm.sock

and replace by

listen = localhost:9000

Ctrl + O, Enter

service php5-fpm restart

2. Downloading OpenBay and preparing it

Download the „master.zip“ from GitHub of OpenBay.

To download the archive directly to the server:

wget [complete url to the .zip]

Extract it:

unzip master.zip

cd openbay-master/src

Move both folders. If you prefer copying them, enter „cp -r“ instead of „mv“.

mv * /var/www/openbay/

cd /var/www/openbay

chown -R www-data:www-data *

service nginx restart

3. The final steps

Enter what you entered in the /etc/nginx/conf.d/openbay.conf as server_name in your browser. You should see the following:

openbay2

 

And PDO and PDO_MYSQL should have green ticks.

openbay3

 

If so – great, you’re nearly done 😉

If not: please follow this guide EXACTLY and don’t skip any step or if you made something intentionally different, customize the guide in the following according to your changes too. If it’s still not working: the comments are down below :p

ATTENTION: If you wanna use IsoHunt’s Remote Database – just continue. Otherwise, continue with attachment 1 down below!

Below General and Name we have to enter a name for our own „Pirate Bay“. This name is beeing shown e.g. in browsers in the tab.

Keep Database, Sphinx, Cache and Log switched on.

Finally hit the „Deploy“ button…

openbay4

 

And you should see this:

openbay5

 

A really final click on „Browse Torrents“ shows you, if the connection to IsoHunt’s remote database works. If so:

openbay6

 

Congrats, you got your own OpenBay Frontend running on your server!

 

If any issues should appear: I enjoy answering comments as long as they’re constructive and seriously. 🙂


 

Attachment 1 (HowTo host the database on your own server):

apt-get install mysql-server screen

You’ll then be prompted to set a password for the MySQL root user.

mysql_install_db

mysql_secure_installation

Enter your MySQL root password, n + Enter and then just hit enter until you’re in the command prompt again.

mysql -u root -p[MySQL Root password]

create database openbaydb;

create user openbayusr@localhost identified by ‚[another, new password]‘;

grant all privileges on openbaydb.* to openbayusr@localhost;

flush privileges;

exit

Continue with the installation in your browser. Give your OpenBay a name, leave everything „switched on“, just switch off „Database“.

Enter the following in the fields:

127.0.0.1

3306

openbaydb

openbayusr

[the set password for the new user]

And finish the installation. Now you’ll only have a db with 5 torrents, but no worries, this isn’t the end of that attachment yet 😉

mysql -u root -p[MySQL Root password]

drop database openbaydb;

create database openbaydb;

exit

screen

[Press Ctrl + a and then c]

This will open a new „screen“. Don’t wonder, that everything looks like before. Screen just creates „new terminals“ which are running over the main terminal and can be put in the background and will continue to run – even when you disconnect from your server. This is pretty useful because the following step will take some time.

mysqldump -u openpiratebay -p046b3SVJN9TlG5X58z4lMTNxI opb -h 46.28.69.238 --port=443 --single-transaction > opb.sql && mysql -u openbayusr -p[Password of the new user] openbaydb < opb.sql

Thanks to @NewEraCracker at GitHub for the command before the &&!

This command will first dump the database from IsoHunt and then load it into the local openbaydb database. This will take some time and there should be no output.

[Press Ctrl + a and then d]

This will deattach you from the overlay and bring you back to your main terminal. You may now disconnect from your server, if you want to. Just don’t shut it down, reboot it or kill any mysql or screen process :p

All you can do now is to wait.

To check, if it finished, (connect again and) enter

screen -r

What will reattach you to the screen overlay. If you’re back in the command prompt, it has finished. If not – give it some more time. MySQL will tell you if something’s wrong.

When it’s finished, visit your site again and hit „Browse torrents“. And now, you should have the hole 8 million torrents db hosted on your own server. That’s it.

[HowTo] Setup OpenBay on Debian / Ubuntu with NGINX 1.7.10
Markiert in:                                                                                                                                                                 

37 Gedanken zu „[HowTo] Setup OpenBay on Debian / Ubuntu with NGINX 1.7.10

  • 24. Februar 2017 um 09:53
    Permalink

    Hello!
    When i click „browse“ i get error 500.
    I can’t find any answer to a rachel, or on the internet.
    Please help, i will pay 5 bucks 😉

    Antworten
  • 9. Juli 2015 um 07:39
    Permalink

    I get an error when restarting nginx. Please help.

    nginx: [emerg] BIO_new_file(„/opt/certs/opb.crt“) failed (SSL: error:02001002:system library:fopen:No such file or directory:fopen(‚/opt/certs/opb.crt‘,’r‘) error:2006D080:BIO routines:BIO_new_file:no such file)
    nginx: configuration file /etc/nginx/nginx.conf test failed

    Antworten
    • 11. Juli 2015 um 20:11
      Permalink

      You obviously configured nginx to use SSL and use the certificated located at /opt/certs/opb.crt but there is no such file. If you wanted to use SSL, confirm the path. If you didn’t want to use SSL remove / comment the lines in your config starting with „ssl on;“, „ssl_certificate“ and „ssl_certificate_key“. Hope this helps.

      Antworten
  • 21. Januar 2015 um 05:02
    Permalink

    I get this message when trying to search for torrents (Hosted installation, not DP + sphinx.)
    Using Apache. Is that a problem? Is the php-fpm config the problem here?
    I thaught the hosted installation should be very simple. Not an expert though. Thanks for any help! -)

    Not Found
    The requested URL /src/www/search was not found on this server.
    Apache/2.4.10 (Ubuntu) Server at 10.0.0.101 Port 80

    Antworten
    • 26. Januar 2015 um 19:35
      Permalink

      Have you got mod_rewrite enabled? Pls paste the last lines of your /var/log/apache2/error.log file somewhere as well.

      Antworten
  • 12. Januar 2015 um 18:32
    Permalink

    Hi
    I installed openbay with default database , but still I get an „404 shit happens“ error.

    Antworten
    • 16. Januar 2015 um 19:34
      Permalink

      Hello,
      this will be because of IsoHunt’s Remote DB was down. Try to follow the attachment on how to host the db on your own server as well.

      Antworten
  • 29. Dezember 2014 um 18:46
    Permalink

    Hi,

    Why do you recommend to add a third-party repository for nginx ??? The debian or ubuntu version should be enough.
    All modifications to php-fpm is not necessary.

    Openbay+local mysql+local sphinx works for me, on FreeBSD. I’m currently trying to make it work with debian.

    Antworten
    • 30. Dezember 2014 um 14:59
      Permalink

      What exactly is „third party“ for you? This is the official nginx repository, man. Take a look at here http://nginx.org/en/linux_packages.html#stable and there it stands. Sure, it „should“ be enough. But these repos its version 1.2.1, with adding the official 1.6.2 Little difference, huh. And the modifications ARE necessary. Otherwise php5-fpm listens to a sock somewhere but nginx passes php’s to a sock under /tmp (with the official nginx config sample). And even if you make these equal, there will be problems when connecting to the socket.

      Antworten
    • 30. Dezember 2014 um 23:58
      Permalink

      Hey buddy if you can make it on the debian with a local database please show me also how or post a tutorial online! Thanks buddy

      Antworten
      • 31. Dezember 2014 um 17:19
        Permalink

        Hi,
        sure, in the meantime I think I got it working properly. Will test again now and then extend the guide!

        Antworten
  • 29. Dezember 2014 um 15:24
    Permalink

    Hey,
    It’s all working but when I click on ‚Recent torrents‘ or ‚browse torrents‘ or even when I try to search for something it shows me „500 Internal Server Error“, what am I doing wrong?

    Antworten
    • 31. Dezember 2014 um 17:21
      Permalink

      Hi,

      please see my answer to Rachel, thanks.

      Antworten
  • 29. Dezember 2014 um 11:38
    Permalink

    Still getting 403 Forbidden errors using your /etc/nginx/conf.d/openbay.conf

    Antworten
    • 29. Dezember 2014 um 11:49
      Permalink

      Strange, it has fixed it for everyone else. Did you do what I wrote to the others?

      Antworten
      • 29. Dezember 2014 um 11:54
        Permalink

        I have removed all web servers other than nginx.
        I have checked permissions.
        I have also cleared „/etc/nginx/conf.d/openbay.conf“ and replaced it with your one from above.

        Antworten
  • 27. Dezember 2014 um 13:16
    Permalink

    Hello, thanks for this guide.

    I got a problem, i tried on debian and centos, i always jave the same.

    When i finish the step2 (restart php5 and nginx), when i go on my serv (ipadress) i have this message ‚403 Forbidden‘. I’m trying to find since 2 days, but nothing.

    Here you can see my openay.conf

    server {
    listen 80;
    server_name IP_OF_MY_SERVER;

    root /var/www/openbay/www;
    index index.php;

    set $yii_bootstrap “index.php”;

    charset utf-8;
    gzip on;
    gzip_comp_level 5;
    gzip_types text/plain text/css text/javascript application/javascript application/json application/x-javascript text/xml application/xml application/xml+rss;

    location / {
    index index.html $yii_bootstrap;
    try_files $uri $uri/ /$yii_bootstrap?$args;
    }

    location ~ \.(js|css|png|jpg|gif|swf|ico|svg)$ {
    fastcgi_hide_header Set-Cookie;

    open_file_cache max=10000 inactive=14d;
    open_file_cache_errors on;
    open_file_cache_min_uses 3;
    open_file_cache_valid 1m;
    output_buffers 1 2m;

    expires 14d;
    }

    location ~* \.php$ {
    fastcgi_split_path_info ^(.+\.php)(.*)$;
    set $fsn /$yii_bootstrap;
    if (-f $document_root$fastcgi_script_name){
    set $fsn $fastcgi_script_name;
    }
    fastcgi_pass localhost:9000;
    include fastcgi_params;
    fastcgi_param SCRIPT_FILENAME $document_root$fsn;
    fastcgi_param PATH_INFO $fastcgi_path_info;
    fastcgi_param PATH_TRANSLATED $document_root$fsn;
    # fastcgi_param HTTPS $https_value;
    }
    }

    Thanks 🙂

    Antworten
    • 27. Dezember 2014 um 15:59
      Permalink

      Hi,

      you’re welcome 🙂
      Same problem like I wrote to @Bernardo above you. Change the line „index index.html $yii_bootstrap;“ to „index index.php“ and so on. So just replace the .html by .php
      Save, exit and restart nginx.
      Cheers

      Antworten
  • 27. Dezember 2014 um 02:38
    Permalink

    I’m getting error 403 forbidden, what am I doing wrong?

    Antworten
    • 27. Dezember 2014 um 15:56
      Permalink

      Please try the new nginx config code. I had exactly the same problem. Clear your existing config with „> /etc/nginx/conf.d/openbay.conf“ and paste the new. That should fix it 🙂
      (The error in the config was obviously by IsoHunt and its the line „index index.html $yii_bootstrap;“ This needs to be index index.php and so on)

      Antworten
  • 26. Dezember 2014 um 06:28
    Permalink

    This is the guide for using isohunt’s / openbay’s remote db config. Any guide for the local db setup ?

    Antworten
    • 26. Dezember 2014 um 13:37
      Permalink

      Like written in the last line: not yet, but I’m working on getting it working by myself. After that, this post will be expanded asap.

      Antworten

Schreibe einen Kommentar

Deine E-Mail-Adresse wird nicht veröffentlicht. Erforderliche Felder sind mit * markiert.