Deploy cherrymusic using Nginx, Supervisord and Virtualenv on Ubuntu

Cherrymusic is a music streaming server written in python.

We assume the deployment is done in /home/user/music.domain.com

Cherrymusic

1. Go to the deployment folder and clone the cherrymusic repo

2. Create and enable the virtualenv

3. Test if the cherrymusic server starts and stop it afterwords

4. If you executed this commands under another user than the one under which you want to run cherrymusic

(eg: you ran the commands as root but you want to run under the user user)

5. Edit cherrymusic.conf from the user‘s home and set the basedir with the path where your music collection is stored.
eg: /var/music

Supervisord

1. Install supervisord

2. Create the file /etc/supervisor/conf.d/music.conf with this content

Ajust the path /home/user/music.domain.com and the value of the user with your values.

3. Reload supervisor service:

4. Check if the music service shows in the supervisor status:

You should see something like

5. Start the music service

6. Check if there is any error in the logs and if you can access the service

(ctrl+c)

Try to check the connectivity:

Should see something like:

( press: ctrl \ )

Also, if there is no firewall, should work to access from the browser: http://music.domain.com:8081/

Nginx

1. Install nginx webserver

2. Create the configuration file in /etc/nginx/sites-enabled/music.domain.com.conf

 

(Adjust the domain name and paths)

3. Reload nginx web server:

Test if everythings works from your browser: http://music.domain.com/

Firewall

Do not allow direct access to the application, but only through nginx.

 

You can find this tutorial on github.

Leave a Reply

Your email address will not be published. Required fields are marked *