LiteSpeed Technologies
Download Download     Blog Blog     Wiki Wiki     Forum Forum     Store     Contact Contact    

Go Back   LiteSpeed Support Forums > LiteSpeed Web Server > Install/Configuration > multiple rails apps on a single IP/top level domain

Reply
 
Thread Tools Display Modes
  #1  
Old 11-08-2006, 10:00 AM
Brandon Brandon is offline
Member
 
Join Date: Nov 2006
Posts: 10
Default multiple rails apps on a single IP/top level domain

Is it possible to set up multiple rails apps on a single IP/top level domain?

My intention is to access multiple raisl apps like this:

http://127.0.0.1/app1
http://127.0.0.1/app2
http://127.0.0.1/app3

Can I do this, or do I have to create a sub domain for each?

Thanks for your time.
Reply With Quote
  #2  
Old 11-08-2006, 10:13 AM
Brandon Brandon is offline
Member
 
Join Date: Nov 2006
Posts: 10
Ahh...I think I fugured it out. You create a plain old vhost, go to the Context menu, then add a new context of type Rails. Right?
Reply With Quote
  #3  
Old 11-08-2006, 10:30 AM
mistwang mistwang is offline
LiteSpeed Staff
 
Join Date: May 2003
Location: New Jersey
Posts: 7,603
That's correct!
Reply With Quote
  #4  
Old 11-08-2006, 10:53 AM
Brandon Brandon is offline
Member
 
Join Date: Nov 2006
Posts: 10
Well that was pretty painless.

I have a permission problem now, or at least I think it is, and I'm not sure how to fix it.

I can access static content in the Rails public folder, but when I try to do something Rails specific I get an error. I took a peek in the rails dev log and I see "permission denied - /home/ubuntu/dev/myapp/config/../tmp/sessions//ruby_sess.1022f62520257af". Then a stack trace to a bunch of exceptions in rails actionpack, mostly to do with session objects.

If this is a permssion problem, I'm not sure who to give them to and what kind.

I'm pretty new to linux, all of my rails development has been done on Windows. I've got a lot done over the past few days, but so many new things are being thrown at me I get a little stuck sometimes. I did manage to get Ubuntu, Litespeed, MySQL, rails, ruby, a bunch of gems installed without any trouble. So far the learning curve has been alright.
Reply With Quote
  #5  
Old 11-08-2006, 10:57 AM
mistwang mistwang is offline
LiteSpeed Staff
 
Join Date: May 2003
Location: New Jersey
Posts: 7,603
You need to change the ownership of /home/ubuntu/dev/myapp/tmp/ to the same as that of public/ folder.

You are doing well. :-)
Reply With Quote
  #6  
Old 11-08-2006, 11:09 AM
Brandon Brandon is offline
Member
 
Join Date: Nov 2006
Posts: 10
thanks. ya..it was time to bite the bullet and get a proper dev box running. I was using Cygwin but I found a lot of things I needed wouldn't compile.

Ok, I checked the folder ownership and both 'public' and 'tmp' have the same file owner, file group and permission set which is 'ubuntu'.

'ubuntu' is the default user for the Ubuntu image I installed yesterday.

Just to I don't leave anything important out...so what I did was install Ubuntu, got all the tools installed and test (mysql, ruby..so on). Then I went to the command line, made a directory called 'dev', in my home directory. Ran 'rails myapp', just for a small test. Told Literserver about it. Lite server will serve the raisl app, but rails throws that exception when I click "About your application's environment" on the default page.
Reply With Quote
  #7  
Old 11-08-2006, 11:11 AM
Brandon Brandon is offline
Member
 
Join Date: Nov 2006
Posts: 10
i left out the current permissions..they are drwxr-xr-x
Reply With Quote
  #8  
Old 11-08-2006, 11:18 AM
Brandon Brandon is offline
Member
 
Join Date: Nov 2006
Posts: 10
I have a feeling that I'm stuck int he web-brick mode of thinking and not production thinking.

To deploy my internal apps with Litespeed, I'm probably supposed to place a copy of the rails app into a folder on the Ubuntu box, then change ownwership of /public and /tmp to the same user that Litespeed uses (I left it nobody, probably not the best joice).

Am I on the right track?
Reply With Quote
  #9  
Old 11-08-2006, 11:23 AM
mistwang mistwang is offline
LiteSpeed Staff
 
Join Date: May 2003
Location: New Jersey
Posts: 7,603
You can configure the vhost to run rails app in suEXEC mode, the user who own public/ folder, please check our wiki.

If it is not in suEXEC mode, change ownership to the user that lshttpd run as.

Just make the user that ruby run as can write to the temp folder.
Reply With Quote
  #10  
Old 11-08-2006, 11:36 AM
Brandon Brandon is offline
Member
 
Join Date: Nov 2006
Posts: 10
Sweet. It's working. That was pretty easy. Thanks for pointing me in the right direction.

Originally I read the wiky and I tried the suEXEC VH. It worked but I could only host one rails app per domain. I'm talking about setting up a new VH with EasyRailsWithSuSEXEC. Are you talking about someting else?
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -7. The time now is 10:07 PM.



- Archive - Top
© Copyright 2003-2011 LiteSpeed Technologies, Inc. All rights reserved. Privacy Policy.