**** 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
Perform a clean installation of Ubuntu 12.04 64-bit.
Login as root and perform an 'apt-get update'.
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
Run: bash minstall.sh install-extra-repositories bash minstall.sh clean-packages bash minstall.sh install-ssh
Reboot
'cd minstall' and run: bash minstall.sh install-extra-packages
Run: bash minstall.sh configure-general bash minstall.sh configure-ssh bash minstall.sh configure-upgrade bash minstall.sh configure-user
gpg --keyserver hkp://keys.gnupg.net --recv-keys 1C4CBDCDCD2EFD2A gpg -a --export CD2EFD2A | apt-key add -
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"
nano /etc/apt/preferences.d/percona and put this inside:
Package: * Pin: release l=percona Pin-Priority: 700
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
mkdir -p /var/log/nginx chmod 755 /var/log/nginx
mkdir -p /var/www/newznab chmod 777 /var/www/newznabnano /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;
}
}
unlink /etc/nginx/sites-enabled/default ln -s /etc/nginx/sites-available/newznab /etc/nginx/sites-enabled/newznab
nano /etc/php5/cli/php.ini edit: max_execution_time = 120 edit: memory_limit = -1 edit: date.timezone = Europe/Amsterdam (for example)
nano /etc/php5/fpm/php.ini edit: max_execution_time = 120 edit: memory_limit = -1 edit: date.timezone = Europe/Amsterdam (for example)
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
- 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/
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
Reboot
Open Webbrowser http://yourip/install and follow instructions
Delete install dir: rm -rf /var/www/newznab/www/install