cloud goes social

Icon

computer, travel, movies, music, cuisine and more

ROR on Xampp on Win

For those who don’t understand the title don’t worry, this is a “technical” post: installing Ruby on Rails (ROR) over an existing XAMPP (Apache, PHP, MySQL, …) installation in Windows. For all of those who have somehow a Windows “server” used to test websites and want to install Ruby and the fantastic Ruby on Rails framework.

Prerequisites: a working installation of XAMPP, in my example installed under: C:\xampp.

  1. Install ROR via the “one click installer” which can be found on the ROR site: installers list. To have everything in one “web-development directory” when prompted by the installer choose C:\xampp\ruby
  2. Open the dreaded DOS-prompt or cmd: Start->Run->cmd
  3. First off update gem, The version installed will stop whenever an update fails, to solve this update gem first. Let’s navigate to the ruby bin directory:
    cd C:\xampp\ruby\bin
    and then the command:
    gem update --system
  4. Now all the gems are updated, install rails with this command:
    gem install rails --include-dependencies
    This will take a while especially for generating the whole documentation, don’t worry, everything is going all right, wait and be patient
  5. Create a test application with the command:
    rails C:/xampp/htdocs/testapp
    If all went fine you will see some output saying that some files have been created. Rails is installed all fine
  6. Now it’s time to create a Virtual Host in apache to test out our installation. Edit the file: C:xamppapacheconfextrahttpd-vhosts.conf with your favourite good editor. I always have installed Notepad++ and at the end add the following lines:
    ## ROR
    Listen 3000
    <VirtualHost *:3000>
    	ServerName ROR
    	DocumentRoot "C:\xampp\htdocs"
    	<Directory "C:\xampp\htdocs">
    		Options ExecCGI FollowSymLinks
    		AllowOverride all
    		Allow from all
    		Order allow,deny
    		AddHandler cgi-script .cgi
    		AddHandler fastcgi-script .fcgi
    	</Directory>
    </VirtualHost>
    ## END-ROR
    
  7. Restart apache from the XAMPP control panel and then go, on your favorite browser to:
    http://localhost:3000/testapp/public
    To see if everything went fine, the page should look like this screenshot
    ROR installed on XAMPP in Windows

    ROR installed on XAMPP in Windows

Versions

At the moment of this writing this is the list of version numbers for the installed applications running and working as configured in this post:

  • XAMPP: 1.6.6a
  • ruby -v: ruby 1.8.6 <2008-08-11 patchlevel 287> [i386-mswin32]
  • gem -v: 1.3.3
  • rails -v: Rails 2.3.2

I would like to thank the author of this post which is the starting point of my post. I just did some minor changes to remove some errors, especially when updating gems. Also I changed the file to edit to add the Virtual Host to keep things more clean in the http.conf file.

For any trouble don’t hesitate to contact me!

Webradios on OSX: guide to easy listening

I’m a huge fan of some radios which I’ve been listening to in my life. For example, while driving in Italy I usually listen to virginradio, while being in Sydney I used to listen to tripleM, both of which usually air good rock music without too much DJs and ads.
YES! I want to listen to music, not ads or people speaking!

Thankfully most radio stations nowadays also spot an internet streaming. Nightmarefully usually it’s a flash or WMP (Windows Media Player) streaming. Being a MacOSX user (mostly) or a Linux user (always – mostly: so basically the time I’m not on MacOSX) I found both formats bad. The first because it works once and not the other time, the second because while more or less working with Quicktime (+ some weird nasty plugin [flip4Mac])

ATTEMPTED SOLUTION

What I usually do is easy – with example:

  1. Go to the webpage of the radio – http://www.triplem.com.au/sydney
  2. Find the ‘listen online’ button
    Listen Online Example for TripleM

    Listen Online Example for TripleM

  3. Open up the source code for the page that the ‘listen online’ opens up (usually they use pop-ups windows for such streamings) when there’s some kind of streaming going on
  4. Search for something like:
    asx
    Or alternatively if you don’t find any entry:
    embed
  5. If in the step before you found the asx copy all the link, following our example:

    ...
    id="WMPlayer"
    name="WMPlayer"
    src="http://resources.triplem.com.au/listenfeed/2mmmlivestream.asx"
    type="video/quicktime"
    ...
    

    let’s copy: http://resources.triplem.com.au/listenfeed/2mmmlivestream.asx

    If instead in the step before we found the embed keyword let’s look around it to find something like:

    ...
    <EMBED type="application/x-mplayer2" pluginspage="http://www.microsoft.com/Windows/MediaPlayer/"
    SRC="http://151.1.245.1/20" name="nnrVideoPlayer"
    autostart="1" width="400" height="70" showcontrols="1">
    </EMBED>
    ...
    

    around the code there should be the src tag, such as in the example. Let’s therefore copy: http://151.1.245.1/20

  6. Open your favorite video/audio player, not iTunes, such as VLC and search for something called like ‘Open Network’. In our example, using VLC it’s: File->Open Network… or even faster the shortcut ⌘N and paste what you just copied:

    The right place to paste the information copied

    The right place to paste the information copied

  7. Press OK and after some buffering time you should be listening to your favorite radio! And without any ads or needing to keep your browser or anything!

This is clearly and hack solution which may work for you or not. If you have problems with your radio streaming and the above solution don’t hesitate to contact me and I’ll look into it (whenever I’ll find some time).

Hope it helped!

ciop ciop

ABOUT

CLOUD GOES SOCIAL is the personal blog of Claudio Marforio.
He holds a MSc in Computer Science with focus on Information Security granted by ETH Zurich. He is currently a PhD Student in the System Security Group of ETH Zurich

Categories

Donate

If you appreciate my work, my applications, this blog in general or you simply feel like rewarding me for something please consider donate.
Any amount will motivate me in keeping up with the blog and the applications.


Thank you!

Donors

F. Olsen, W. Chang, W. Edmondson, C. Sharff, M. Brown, G. Helton, J. de Ruiter, K. Langner, K. Smith, T. OHalloran, B. Zabarauskas

Listening to ...