Use Openshift as a free Shoutcast server

So you want to set up your own radio station? I spent a lot of time looking for a free VPS. Yes there are free Shoutcast servers out there but most servers are outdated. I remembered that Openshift is a server per se so I decided to give it a try. Before we go ahead, I assume you have the basic skills when it comes to terminal stuff. I also expect that Linux is your preferred OS. You can do this on windows too but installing the client tools is a pain in the ass. Here are the things you gonna need to do.

Create a Do-It-Yourself application in Openshift. On the search box, look for custom. Fill out the necessary fields. Once done, install RHC client tools in your machine. You may head over to Installing Openshift RHC Client Tools page for further info on how. After that, you need to pull the application’s source code to your machine so you can reach it via browser. The git URL (source code) is found in your application’s console. Here’s the link on how to do all that git stuff.

Now that you’re ready, you need to make changes to your app. Download the respective Shoutcast DNAS 2.2 archive in the forums. Extract it to your diy directory. If you did everything right, you should see something like this.

Run the setup.sh and access it in your browser. The URL should be http://127.0.0.1:8000. Set the Listener Access in the setup page to 8080. Once done, do not run the server. You may need to find your internal IP first in Openshift. Log in to your application’s shell using the RHC tool by entering ‘rhc ssh -a ‘. After you see the Openshift shell, check the environment variables and look for OPENSHIFT_DIY_IP. You can find a guide here on how to remotely access your app. Now that you already know your IP, Edit the sc_serv.conf file and add these following lines.

portbase=8080
publicport=80
portlegacy=0
destip=<your-ip>
srcip=any

Next is the action hooks. You can find them in /.openshift/action_hooks. Edit your start and stop action hook.

#start action hook

nohup $OPENSHIFT_REPO_DIR/diy/sc_serv $OPENSHIFT_REPO_DIR/diy/sc_serv.conf > $OPENSHIFT_DIY_LOG_DIR/server.log 2>&1 &

#stop action hook

kill `ps -ef | grep sc_serv | grep -v grep | awk ‘{ print $2 }’` > /dev/null 2>&1
exit 0

You can now git commit your changes and push them to Openshift. You can test if the server started by accessing it in your browser via http://<appname>-<username>.rhcloud.com/. If everything is fine. Install the Shoutcast DSP plugin in your Winamp. Untick the `Make this stream public` and follow this Login configuration.

In the terminal, run ‘rhc port-forward -a ‘. Now you’re done! You can press the connect button and start broadcasting!

Tags : , , , ,

0 thoughts on “Use Openshift as a free Shoutcast server”

Leave a Reply

%d bloggers like this: