Ampache is a web-based audio and video streaming application that allows you to access your music and video from anywhere. This tutorial will guide you through the installation process of Ampache on the Fedora CoreOS Latest.
Ampache requires the Apache web server to function correctly. To install Apache on Fedora CoreOS, run the following command:
sudo rpm-ostree install httpd
Once the installation finishes, start and enable Apache by running:
sudo systemctl start httpd
sudo systemctl enable httpd
Ampache is developed in PHP, so you will require PHP and its extensions to run it. Run the following command to install PHP and required extensions:
sudo rpm-ostree install php php-pdo php-gd php-xml php-mbstring php-json
After the installation, restart the Apache service:
sudo systemctl restart httpd
You can install Ampache by downloading the latest stable version from their website or by cloning the GitHub repository. In this tutorial, we will use the GitHub repository to install Ampache:
sudo dnf install git
cd /var/www/html
sudo git clone https://github.com/ampache/ampache.git
Once the cloning is complete, change the ownership of the ampache
directory to the apache
user:
sudo chown -R apache:apache ampache/
To store the metadata of your media files, you need to create a MySQL/MariaDB database for Ampache. Run the following command to install MariaDB on your Fedora CoreOS server:
sudo rpm-ostree install mariadb-server mariadb
After the installation completes, start and enable MariaDB:
sudo systemctl start mariadb
sudo systemctl enable mariadb
Now, run the following command to secure the installation and create a database and user for Ampache:
sudo mysql_secure_installation
Follow the on-screen instructions to set up the root password, remove anonymous users, disallow remote root login, and remove test databases.
Next, log in to the MariaDB server as a root user:
sudo mysql -u root -p
Create a new database and user for Ampache:
CREATE DATABASE ampache;
CREATE USER 'ampacheuser'@'localhost' IDENTIFIED BY 'password';
GRANT ALL PRIVILEGES ON ampache.* TO 'ampacheuser'@'localhost';
FLUSH PRIVILEGES;
EXIT;
Replace ampacheuser
with your preferred username and password
with a strong password.
To configure Ampache, rename the config file:
cd /var/www/html/ampache
cp ./config/ampache.cfg.php.dist ./config/ampache.cfg.php
Open the configuration file with a text editor and make the following edits:
nano ./config/ampache.cfg.php
Set database connection settings:
define('DB_TYPE', 'mysql');
define('DB_HOST', 'localhost');
define('DB_PORT', '3306');
define('DB_NAME', 'ampache');
define('DB_USER', 'ampacheuser');
define('DB_PASS', 'password');
Set media folders:
define('SCAN_DIRS', "/path/to/your/music /path/to/your/videos");
Set the temporary folder for transcoding:
define('TEMP_DIR', '/var/tmp/');
Save and exit the configuration file.
The Apache web server requires proper permissions to access the directories and files in your Ampache installation folder.
Change the apache
user as the owner of the installation directory by running:
sudo chown -R apache:apache /var/www/html/ampache
Next, set the correct permissions:
sudo chmod -R 755 /var/www/html/ampache
sudo setsebool -P httpd_can_network_connect 1
You can now access Ampache in your web browser by using your server's IP address or domain name.
For example, if your server's IP address is 192.168.1.100
, visit http://192.168.1.100/ampache
to access Ampache.
On the login page, enter the username and password you set in the Ampache configuration file. After successful authentication, you can browse and stream your music and video files.
Congratulations! You have successfully installed and configured Ampache on your Fedora CoreOS server.
If you want to self-host in an easy, hands free way, need an external IP address, or simply want your data in your own hands, give IPv6.rs a try!
Alternatively, for the best virtual desktop, try Shells!