TurnKey Linux Virtual Appliance Library

How do I start up the preconfigured example Rails application located at /var/www/railsapp ?

Hopefully someone here can help me with this beginner's problem.

I've successfully installed the RoR appliance to harddisk on a standalone server, and was able to access the webmin interface from another computer on the same network.

After I got all that running, I tried following the instructions found here on how to deploy a Rails app: http://www.turnkeylinux.org/docs/rails/deployment .... to try out the example on the server...but to no success.

My question again is: How do I start up the preconfigured example Rails application located at /var/www/railsapp ?

Any help to solving this problem will be greatly appreciated. Thanks for viewing.

Jeremy's picture

At a guess...

I'm not familiar with RoR but I would guess from your info that you should find the example at http://ip-or-hostname/railsapp/ This guess is based on the knowledge that /var/www is a common default document root for web servers (ie what you get when you browse to http://ip-or-hostname/).

Same problem

I've also installed the RoR appliance and can successfully browse to its web server using:

    http://192.168.1.239

This gives me the 'Trunkey rails' start page with Web shell and Webdmin options.

However, when I try

   http://192.168.1.239/railsapp

I get 'the page you are looking for does not exist'

So how do I access the provided 'railsapp' application?

Also having similar issues

Also experiencing similar issue: can access webmin etc but not the railsapp.

Has anyone got the pre-configured railsapp up and running? 

I've installed turnkey rails using turnkey-rails-2009.10-2-hardy-x86 iso as a guest OS using VirtualBox 3.2.8 hosted on a Windows 7 64bit machine. 

Followed Daniel Pritchetts nice tutorial (http://www.sharingatwork.com/2009/10/get-started-building-web-apps-with-your-own-ruby-on-rails-virtual-development-server/)

Used bridged networking rather than NAT - could this be the issue? Is anyone else running this configuration?

Kind Regards,

d.

found the bug (?)

I know this problem was posted years ago.  But I still encountered this same problem! 
I am also a RoR newbie.  Anyway, I found the reason-- after excruciating number of hours.

Short answer: The index.html is missing i n "/var/www/railsapp/public"

So what did I do? (lets assume my server IP is  192.168.1.239)

1.  created a new rails app by:

  • # cd /var/www
  • # rails new my1stapp
    (note: a "my1stapp" folder will be created in "/var/www/" and in the /var/www/my1stapp/public", there will be an "index.html" file

2.  edited the DocumentRoot for the Virtual Server

 

I'm sure there is a better way of doing it.  But that what I did.  I hope this helps somebody.

Basil Kurian's picture

Run this on

Run this on terminal

/var/www/railsapp/script/server

Access the page using this url

http://IP_ADDRESS:3000


Basil Kurian's picture

To spawn the process

/var/www/railsapp/script/server -d


railsapp

The preconfigured railsapp is the trunky rails app you see under the http://192.168.1.239 when your server is running, if you login to webmin -> servers -> apache, you would see a virtual host for port 80 which is the default port for your server that points to /var/www/railsapp/public . what Basil Kurian is suggesting is to run the server that is built in with rails application. railsapp is using the rails_mod for apache. if you like to create a virtual host for a new app, just go to apache section in webmin, create a new host with a new port other than port 80. makesure the port is open by going to linux firewall under webmin. restart apache and reload your iptables and you can access your new app by putting the port number after your server ip address.

Hard as Rails....

Okay, I appreciate there is going to be a bit of a learning curve with any new system/language, but I'm feeling a bit abandoned on this one. 

I have the appliance server successfully installed - easy.

Run up and configured - fine 

Tweeked the networking to work under windows - harder

Got samba downloaded and installed and a share opened up so that I can actually use the server for something useful (why isn't this there by default? Windows users are people too, don't torture us!) - hard

Figured out that the sample site on the server is actually the one you hit by going to port 80 (from the post above) - hard

Created a new rails site - easy 

Tried to get this visible to my dev machine via apache as described above - frikin hard as nails.

I suspect I may need to do something to get the firewall changes to take effect... but how on earth should I know what that is? the comment above about reloading my iptables is great ... except how do you do that? 

Examples I have found don't work, and "service iptables status" reports it as unrecognised. 

Surely this is the same damn thing everyone has to do when the server is first set-up - how can it have been made this hard!? Come on guys, you've done the difficult bit, the appliances are a great idea, now just write a one page introduction on what you need to do to use the damn thing.

Any help is greatly appreciated.

Liraz Siri's picture

Firewall disabled by default. Use an SFTP client

Sorry to hear about your unhappy experience, but thanks for sharing. It helps to understand the perspective of a newbie. Sometimes it's the smallest things that are the most infuriating. Hang in there!

A few tips:

1) The firewall is not turned on by default. Unless you turned it on, that isn't what is giving you trouble.

2) It's much easier to access an appliance using an SFTP client (e.g,. WinSCP, FileZilla) than setting up a Samba file share. That's why it's not enabled by default, and for security reasons.

Remember that it's impossible to optimize an appliance for all usage scenarios (e.g., development from Windows, or from a Mac, or production use in a server farm, etc.). The best we can do is try to aim for the common good.

Also, keep in mind that everyone here is volunteering their time to help others. It's an open community. The documentation is a wiki. It's easier to complain than to go ahead and actually improve things, but it's not as productive. So maybe once you've figured everything out you can do your part to make sure whomever comes in after you doesn't fall into the same holes.

It's worse Jim

Okay, the one bit I had working - Samba - decided to go away after I closed down and restarted to try and fix the networking. 

I have hacked round the networking problem by repointing the default site at my new site - not exactly elegant, but it works, but now my windows box can't see the Appliance, so I can't actually use it for anything. Good eh.  

If you're after any tips on making it harder, I'd say set the default character set on the appliance to traditional chinese, otherwise it's pretty much covered for a windows user ;-)

Liraz Siri's picture

I'm guessing you have a networking problem

Linux is pretty reliable as a server. We use this stuff in production all the time. I've never had server software suddenly stop talking to my machine for no reason. Usually that only happens if I make a mistake and break the configuration somehow.

In this case you probably have a networking problem of some kind. One way to isolate the problem would be to start from Core and solving the network connectivity issue first. Make sure everything else works and that you aren't misidentifying where the problem is.

Hope this helps!

Jeremy's picture

Like Liraz said, sounds like you have networking problems

The only other reason I can think of for the Samba part to just disappear would be if you had set it up in Live/Demo mode (ie non-persistant, running from the CD and RAM). As for the issues you said you had (in your previous post) "tweaking networking to work with Windows" - what did you mean there? I currently run a number of TKL VMs under VMware Server running on MS Server 2k3 with XP clients and didn't have to do any tweaking - it all just works (although admitedly I'm not using this particular appliance).

Also it may help us to help you if you provide info on which particular version you are using. Is the the latest RC release (V11.0RC) or the earlier one (2009.9-2)

As Liraz mentioned using an SFTP client is a very easy way to access your appliances filesystem. Other tools I find invaluable when working from Windows are PuTTY (Win SSH client - allows command line access) and Notepad++ (Win text editor that will open and edit Linux text & config files without corrupting them - as Win Notepad does).

Also I strongly suggest you have a good look at the Webmin interface. When I first came across TKL (about a year and a half ago) I was a complete Linux newb. I found a lot of the Webmin WebUI components helped me get a hang of things in Linux world and made the learning curve not quite so steep. I still use Webmin sometimes to help me with Linux components that I'm not so familiar with. Unfortunately not all components have a Webmin module but many do.

A new day, new windows install, better luck .....

Okay, having stepped away from it all for a bit and come back fresh, I tumbled to the problem with my AWOL samba. Liraz's comment about the firewall not being turned on by default got me thinking, and I went and checked the settings. Sure enough in my floundering attempts to get a new rails site up, I flicked the firewall on and this was nuking my traffic to the box .....or at least MOST of the traffic (which is in itself a bit strange - windows could see the machine, just not talk to it). 

With this option flicked off ("Activate at boot" in case anyone is having similar problems) lo and behold I have connectivity. From there it was a relatively straight forward case of figuring out how to recursively apply write permissions to all the folders in my website for the users group that I am logging in with (Tools->File Manager path /var/www/testapp then select in the RIGHT side and select info, change the group to users and check the write for group and change the drop list to "this directory and all subdirectories" <save>)

And bingo I have a site that I can edit from my host windows box via any editor I like. 

Still not sure what's up with not being able to reach a new site, I may look into that in a bit. 

Oh probably the most telling question as far as struggling newb is concerned is "what wiki?". Drop me a link, and I'll see what I can do. 

Thanks guys. 

 

Now to go off and bash my head against the wall labelled Ruby.....

Liraz Siri's picture

We have two wikis!

Glad you got that sorted out! Stepping back and returning to the problem once you've cooled down was a good move. Frustration usually just breeds more frustration.

Regarding the wikis, we have two of them. One is the community docs. If you create a user account and log in you would be able to edit existing pages or create new ones. Tutorials and such for users goes there.

We also have a development wiki, which is oriented more towards those who want to hack existing appliances or create new ones.

Back to the subject

I'd like to get back to the original thread problem since I'm struggling with it right now.

I'm keeping it simple and want just to see a simple index.html file in my browser. I've set up new a virtual server to port 12345 and document root at /var/www/, restarted apache using webmin and opened the port in Linux firewall (just to be on the safe side).

However with netstat -ln -A inet I never get the desired port in listening state - it's just not listed there.

Post new comment

The content of this field is kept private and will not be shown publicly. If you have a Gravatar account, used to display your avatar.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <a> <p> <span> <div> <h1> <h2> <h3> <h4> <h5> <h6> <img> <map> <area> <hr> <br> <br /> <ul> <ol> <li> <dl> <dt> <dd> <table> <tr> <td> <em> <b> <u> <i> <strong> <font> <del> <ins> <sub> <sup> <quote> <blockquote> <pre> <address> <code> <cite> <strike> <caption>

More information about formatting options

Leave this field empty. It's part of a security mechanism.
(Dear spammers: moderators are notified of all new posts. Spam is deleted immediately)