How to install GNU FM on Fedora Server
GNU FM is a free web-based music metadata server that enables you to build your own music platform. This tutorial will guide you through the installation of GNU FM on the latest version of Fedora Server.
First, you need to update your system using the following commands:
sudo dnf update
sudo dnf upgrade
Install Apache web server
Apache is a widely used open-source web server that is compatible with GNU FM. To install Apache, run the following command:
sudo dnf install httpd
Once the installation is completed, start Apache and enable it to run at system boot:
sudo systemctl start httpd
sudo systemctl enable httpd
Install PHP and its extensions
GNU FM is built on PHP, a server-side scripting language that is used to create dynamic web pages. To install PHP and its extensions, run the following command:
sudo dnf install php php-pgsql php-mbstring php-gd
The above command installs the following extensions:
php-pgsql: PostgreSQL database supportphp-mbstring: Multibyte string support for Asian languagesphp-gd: Graphics library for image processing
Install PostgreSQL server
GNU FM uses PostgreSQL as its database server. To install PostgreSQL, run the following command:
sudo dnf install postgresql-server
Once the installation is completed, initialize the PostgreSQL database and start the PostgreSQL service:
sudo postgresql-setup initdb
sudo systemctl start postgresql
sudo systemctl enable postgresql
By default, PostgreSQL is configured to use md5 authentication, which requires a password to access the database server. You can change this by editing the pg_hba.conf file:
sudo nano /var/lib/pgsql/data/pg_hba.conf
Find the line that contains host all all 127.0.0.1/32 md5 and change md5 to trust. This will allow local users to access PostgreSQL without a password. If you're running GNU FM on a public server, it's recommended that you use more secure authentication methods.
Install GNU FM
To install GNU FM, download the latest release from the official website:
wget https://ftp.gnu.org/gnu/gnufm/gnufm-latest.tar.gz
Extract the contents of the archive to your web server document root directory:
sudo tar xzf gnufm-latest.tar.gz -C /var/www/html/
Next, create a new PostgreSQL database and user for GNU FM:
sudo -u postgres createdb gnufm
sudo -u postgres createuser gnufm -P
When prompted, enter a password for the PostgreSQL user.
Then, import the GNU FM tables into the new database:
sudo -u postgres psql -d gnufm -f /var/www/html/gnufm/sql/gnufm.sql
Finally, edit the configuration file at /var/www/html/gnufm/config.php and update the database connection details to match your PostgreSQL settings:
$db_conf = array(
'dbhost' => 'localhost',
'dbname' => 'gnufm',
'dbuser' => 'gnufm',
'dbpass' => 'password'
);
Replace password with the password you set for the PostgreSQL user.
Set file permissions
Make sure that the web server has write access to the gnufm directory and its subdirectories:
sudo chown -R apache:apache /var/www/html/gnufm/
Access GNU FM
You're now ready to access GNU FM. Open a web browser and navigate to http://your-server-ip/gnufm/. You should see the GNU FM welcome screen.
Conclusion
This tutorial has shown you how to install GNU FM on Fedora Server. With GNU FM, you can easily build your own music metadata server and listen to your favorite tunes without relying on commercial music streaming services.