-
Notifications
You must be signed in to change notification settings - Fork 182
How to install spotweb on Fedora 33 (english)
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.
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
sudo dnf update
sudo reboot
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
sudo sed -i "s/^;date.timezone =.*/date.timezone = Europe\/Amsterdam/" /etc/php.ini
sudo systemctl enable --now httpd.service
sudo systemctl enable --now mariadb.service
sudo mysql_secure_installation
Read the onscreen messages carefully. You can rerun the command if you make a mistake. Following answers provide sane defaults.
Enter current password for root (enter for none):
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
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
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
sudo mysql -u root -p (hit enter and use the password entered during the previous steps)
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;
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"
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
sudo firewall-cmd --add-service=http
sudo firewall-cmd --runtime-to-permanent
Open http://ip-or-hostname/install.php in your browser. If you are doing a local install, replace ip or hostname with "localhost".
- Make sure everything is "OK", except "DB::pgsql", "bcmath" and "Own settings file", they may be "NOT OK".
- Select: Next
- 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: (select your usenet provider here
- username: (fill in your usenet username here)
- password: (fill in your provider password here)
- Select: Verify usenet server
- Select the best "type", according to the settings you wish to have
- Fill in the "Administrative user".
- Select: Create system
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.
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
sudo mysqldump spotweb | bzip2 -c > spotweb-`date +"%Y-%m-%d"`.mysql.bz2
sudo -i
bzip2 -c -d spotweb-2012-08-02.mysql.bz2 | mysql spotweb
sudo crontab -e
0 */4 * * * /usr/bin/php /var/www/spotweb/retrieve.php >> /var/log/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/
Ok, the installation is complete now.