Skip to content

How to install spotweb on Fedora 33 (english)

Hr46ph edited this page Jan 24, 2021 · 4 revisions

Spotweb on Fedora 33

This Spotweb installation is tested on Fedora (server) 33 as a virtual machine without GUI (console only). This VM has been given 2 cores and 4GB RAM and runs a headless torrent client, Jackett and NZBHydra2 alongside spotweb. Performance and resources are not an issue but obviously, 2 more cores would help somewhat if you can spare them. Installation on a desktop system should work similarly (but is not tested). These instructions should suffice with minimal changes for Fedora Workstation 32/33, and RHEL / CentOS 8 or derivatives.

Enable necessary and optional repositories

sudo dnf install https://mirrors.rpmfusion.org/free/fedora/rpmfusion-free-release-$(rpm -E %fedora).noarch.rpm https://mirrors.rpmfusion.org/nonfree/fedora/rpmfusion-nonfree-release-$(rpm -E %fedora).noarch.rpm
sudo dnf config-manager --add-repo=https://negativo17.org/repos/fedora-multimedia.repo

Update the system

Update the system and reboot for a fresh start. Answer Yes when asked to accept the new repo's

sudo dnf update
sudo reboot

Install spotweb dependencies

sudo dnf install git httpd php php-mysqlnd mariadb mariadb-server php-pear-Net-Curl php-gd php-gmp php-xml php-mbstring php-pecl-zip

Configure the PHP timezone

sudo sed -i "s/^;date.timezone =.*/date.timezone = Europe\/Amsterdam/" /etc/php.ini

Enable and start Apache and MariaDB

sudo systemctl enable --now httpd.service
sudo systemctl enable --now mariadb.service

Configure MariaDB

sudo mysql_secure_installation

Read the onscreen messages carefully. You can rerun the command if you make a mistake. Following answers provide sane defaults.

If this is the first time you run this command, you will have no password, so just hit enter

Enter current password for root (enter for none):

Answer Y to switch to socket authentication

Switch to unix_socket authentication [Y/n] y

If this is the first time, answer Y and enter a secure random password and save it in your password manager. This is NOT your system root password, but the root password for MySQL/MariaDB. If this is NOT the first time, and you have already set a password and you know its good, answer with No. If you lost it or in doubt, just reset it now

Change the root password? [Y/n] Y

The following can/should be answered as follows, unless you know what you are doing

Remove anonymous users? [Y/n] y
Disallow root login remotely? [Y/n] y
Remove test database and access to it? [Y/n] y
Reload privilege tables now? [Y/n] y

Create database (MariaDB / MySQL) - OPTIONAL STEP

We can do this manually on the CLI, or let Spotweb do it for us during the initial setup. During setup of Spotweb is preferred, but in some weird case that doesn't work or you like making things complicated for yourself, by all means and do it now

Open MySQL CLI Prompt

sudo mysql -u root -p (hit enter and use the password entered during the previous steps)

Enter the following commands on the MySQL CLI:

CREATE DATABASE spotweb;
GRANT ALL PRIVILEGES ON spotweb.* TO "spotweb"@"localhost" IDENTIFIED BY "use_some_random_password_and_save_it_in_your_password_safe";
FLUSH PRIVILEGES;
quit;

Installing Spotweb source files

cd /var/www
sudo git clone https://github.com/spotweb/spotweb.git
cd spotweb
sudo mkdir cache
sudo chmod 777 cache

Configuring HTTPD for a SINGLE DOCUMENT ROOT / TODO: ADD Virtual Host config in /etc/httpd/conf.d/spotweb.conf

sudo vim /etc/httpd/conf/httpd.conf

Find the line beginning with DocumentRoot and change it to:

DocumentRoot "/var/www/spotweb"

Configuring SELinux

SELinux is an awesome security feat and should never be disabled. We don't disable firewalls anymore, do we? Take the following steps to configure SELinux for Spotweb:

sudo setsebool httpd_can_network_connect on
sudo setsebool httpd_can_network_connect_db on
sudo semanage fcontext -a -t httpd_sys_rw_content_t "/var/www/spotweb/cache(/.*)?"
sudo restorecon -Rv /var/www

Configure the firewall - SKIP in case you're installing on your local machine

sudo firewall-cmd --add-service=http
sudo firewall-cmd --runtime-to-permanent

Configure spotweb

Open http://ip-or-hostname/install.php in your browser. If you are doing a local install, replace ip or hostname with "localhost".

PHP settings

  • Make sure everything is "OK", except "DB::pgsql", "bcmath" and "Own settings file", they may be "NOT OK".
  • Select: Next

Database settings

  • Enter the username 'spotweb', database name 'spotweb' and use the MySQL root password you used earlier to create and prepare the database
  • Select: Verify database

If you manually created the database to complicate things for yourself, do not use the root password but enter the spotweb user password you used with the 'grant privileges' command earlier.

Usenet server settings

  • Usenet server: (select your usenet provider here
  • username: (fill in your usenet username here)
  • password: (fill in your provider password here)
  • Select: Verify usenet server

Spotweb type

  • Select the best "type", according to the settings you wish to have
  • Fill in the "Administrative user".
  • Select: Create system

Installation succesful

Copy the whole displayed text, including the "<?php"! Edit the file below and paste the text there.

sudo vi /var/www/spotweb/dbsettings.inc.php
press 'i'
press 'shift-ins'
press 'escape'
press ':'
type 'wq!' and hit enter

Or alternatively, install 'nano' and get a more noob-friendly editor 🤣.

Second alternative is to become root (sudo -i) and paste the following with your own text from the spotweb:

cat <<EOF > /var/www/spotweb/dbsettings.inc.php
<?php
$dbsettings['engine'] = 'pdo_mysql';
$dbsettings['host'] = 'localhost';
$dbsettings['dbname'] = 'spotweb';
$dbsettings['user'] = 'spotweb';
$dbsettings['pass'] = 'edit_with_your_own_password';
$dbsettings['port'] = '3306';
$dbsettings['schema'] = '';
EOF

You may need to press enter once after pasting the above.

You can now close the installer wizard page or continue to spotweb. It will be empty.

Spotweb database

Initial fill of the database

This will take some time, even with a fast connection. I suggest you execute this command in a "screen".

php /var/www/spotweb/retrieve.php

Backup your database (optional)

sudo mysqldump spotweb | bzip2 -c > spotweb-`date +"%Y-%m-%d"`.mysql.bz2

DO NOT EXECUTE (until you want to restore a backup)

sudo -i
bzip2 -c -d spotweb-2012-08-02.mysql.bz2 | mysql spotweb

Refresh the database every 4 hours

sudo crontab -e
0	*/4	*	*	*	/usr/bin/php /var/www/spotweb/retrieve.php >> /var/log/spotweb

Spotweb !

Now go to your spotweb site. The "localhost" part can be a url or an IP number, according to your settings

http://localhost/spotweb/

HAPPY SPOT HUNTING!

Ok, the installation is complete now.

Clone this wiki locally