How to install Sonerezh Music Streaming Server on Ubuntu 18.04 LTS

Sonerezh is a free, open source and web-based music streaming server that can be used to access media from anywhere. It is simple, lightweight and easy to use application written in PHP and HTML5. You can add titles, albums and artists to your playlists and listen to them according to your mood. Sonerezh gives you a user management system with two access levels so that your friends could enjoy your music too.

In this tutorial, we will explain how to install Sonerezh on Ubuntu 18.04 server.

Requirements

  • A server running Ubuntu 18.04.
  • A non-root user with sudo privileges.

Install Apache, MariaDB and PHP

Sonerezh is a web-based application, so you will need to install Apache web server and MariaDB database server to your system. You can install them by running the following command:

sudo apt-get install apache2 mariadb-server -y

Next, you will need to add Ondrej PHP repository to your system. You can do this with the following command:

sudo apt-get install software-properties-common
sudo add-apt-repository ppa:ondrej/php -y

Next, update the repository and install PHP and all the required dependencies with the following command:

sudo apt-get install php7.2 php7.2-mysql php7.2-intl php7.2-cli php7.2-gd php7.2-mbstring php-pear php7.2-curl php7.2-mysqlnd php7.2-mcrypt libav-tools git -y

Once all the packages are installed, start Apache and MariaDB service and enable them to start on boot time with the following command:

sudo systemctl start apache2
sudo systemctl enable apache2
sudo systemctl start mysql
sudo systemctl enable mysql

Configure MariaDB

By default, MariaDB installation is not secure, so you will need to secure it first. You can do this with the following command:

sudo mysql_secure_installation

Answer all the questions as shown below:

    Enter current password for root (enter for none):
    Set root password? [Y/n]: N
    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

Once the MariaDB is secured, log in to MariaDB shell:

mysql -u root -p

Enter your root password when prompt, then create a database and user for Sonerezh:

MariaDB [(none)]> CREATE DATABASE sonerezhdb;
MariaDB [(none)]> GRANT ALL PRIVILEGES ON sonerezhdb.* TO 'sonerezh'@'localhost' IDENTIFIED BY 'password';

Next, flush all privileges with the following command:

MariaDB [(none)]>FLUSH PRIVILEGES;
MariaDB [(none)]>\q

Install Sonerezh

First, download the latest version of Sonerezh from Git repository with the following command:

cd /var/www/html
sudo git clone --branch master https://github.com/Sonerezh/sonerezh.git

Next, give proper permission to the Sonerezh directory with the following command:

sudo chown -R www-data:www-data /var/www/html/sonerezh
sudo chmod -R 755 /var/www/html/sonerezh

Next, create an Apache virtual host file for sonerezh with the following command:

sudo nano /etc/apache2/sites-available/sonerezh.conf

Add the following lines:

<VirtualHost *:80>
ServerAdmin [email protected]
DocumentRoot /var/www/html/sonerezh
ServerName example.com
<Directory /var/www/html/sonerezh/>
Options FollowSymLinks
AllowOverride All
</Directory>
ErrorLog /var/log/apache2/sonerezh-error_log
CustomLog /var/log/apache2/sonerezh-access_log common
</VirtualHost>

Save the file, then enable virtual host with the following command:

sudo a2ensite sonerezh

Finally, restart Apache web server to make the changes:

sudo systemctl restart apache2

Access Sonerezh

Now, open your web browser and type the URL http://example.com. You will be redirected to the following page:

Database configuration

Username and password

Here, provide your database details and admin user details, then click on the Run button. You will be redirected to the Sonerezh login page:

Sign in to Sonerezh

Now, provide your admin username and password. Then, click on the Sign In button. You should see the Sonerezh dashboard in the following page:

Sonerezh Dashboard

Sonerezh song list

Hitesh Jethva

About Hitesh Jethva

Over 8 years of experience as a Linux system administrator. My skills include a depth knowledge of Redhat/Centos, Ubuntu Nginx and Apache, Mysql, Subversion, Linux, Ubuntu, web hosting, web server, Squid proxy, NFS, FTP, DNS, Samba, LDAP, OpenVPN, Haproxy, Amazon web services, WHMCS, OpenStack Cloud, Postfix Mail Server, Security etc.

Share this page:

Suggested articles

3 Comment(s)

Add comment

Comments

By: ustoopia at: 2018-09-14 14:44:06

When I want to open Sonerezh nothing happens. Error log shows the following:

[Fri Sep 14 16:38:29.131052 2018] [:error] [pid 7744] [client 192.168.2.10:16040] FastCGI: server "/var/www/web17/cgi-bin/php-fcgi-*-443-stream.mydomain.nl" stderr: PHP message: PHP Fatal error:  CakePHP core could not be found. Check the value of CAKE_CORE_INCLUDE_PATH in APP/webroot/index.php. It should point to the directory containing your /cake core directory and your /vendors root directory. in /var/www/web17/web/sonerezh/app/webroot/index.php on line 99I havent investigated this myself yet but it looks to me that I also have to install CakePHP or something related

By: sanled at: 2018-10-21 21:36:00

Some listed packages are not available in the repository of ubuntu 18.04

By: till at: 2018-10-22 07:42:37

Check that you have all Ubuntu repositories enabled incl. universe and multiverse.