Deploying Rails application

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    #61
    Noel are you talking about the "RubyGems" button under "Software / Services", or am I missing something?

    My rubygems button had stopped working before, but I'm pleased to see that it's up and running again.

    I just put a RoR blogging package (free one called simplelog) onto our intranet server at work. It sits along side the application I am working on, in the process I learnt a bit more about the setup so I thought I would share it with you. I don't know how relevant it will be to us lot trying to get rails applications working on the shared hosting packages though.

    A rails application is deployed into a folder on the server.
    The user and group owner are set along with permissions. (In our case we use a user called "webs" and a group called "mars" - I think this is the group which apache is in.)
    We then set up a virtual host within apache - that points to the directory, importantly it points to a proxy, which gives us a URL and a port number.
    Then we fire up the rails app in mongrel (using "script/server --environment=production --port=8001").

    I don't remember all the exact details as I was just looking over the shoulder of one of the IT guys, but hopefully it gives everyone here a bit more of an idea as to how everything links up in a RoR app deployment.
    The important thing to note here is that it doesn't matter what is in the ".htaccess" or "dispatch.xxx" files, they don't get used at all. The IT guy added the command above into some-file-I-know-nothing-about which makes sure it gets started whenever the server is rebooted.

    Like I said I don't think this directly helps within the shared host environment, but hopefully helps to explain how things are happening.

    Comment


      #62
      Originally posted by Andrew Burrage View Post
      I don't think this directly helps within the shared host environment
      Having said that I have found that starting a server works fine - you'll need to make sure you have any required gems installed of course, but using:
      "ruby script/server --environment=production --port=8000 -d" starts up a server fine, I just have to go to the address I have defined (I've set up a sub-domain in my case) and use the :8000 e.g. "http://subdomain.yourdomain.extension:8000/".

      If I could work out how to link apache up to that port it would be perfect.
      The -d command makes it run as a daemon so you don't have to keep the SSH connection open, but remember it's running cause you don't want to leave a load of processes running!

      Comment


        #63
        Hi Andrew,

        Thanks for the extra info, every clue is useful.

        The icon I'm talking about is a new one that seemed to appear recently (unless I just wasn't paying attention before) here it is:



        it leads to a page where you can create and manage your Rails Apps. I've not had chance to try it out yet though. but it looks like you can control mongrel using Run, Stop and Load on Boot. If it works it's very cool.

        Last edited by Noel; 22-11-2007, 16:42. Reason: Clarity

        Comment


          #64
          Oh that looks very cool indeed.

          I wonder why it is missing from my cpanel!

          Comment


            #65
            are you using the "x3" theme in cPanel?

            Comment


              #66
              Originally posted by Andrew Burrage View Post
              Oh that looks very cool indeed.

              I wonder why it is missing from my cpanel!
              I'm not sure whether this is still the case but in the past not all shared servers had Ruby installed so you may have to move servers to get Ruby support .
              David Smith
              Managing Director
              DPS Computing Limited

              - Massive update! (September 2011) - It's now not neglected!!
              - New Site (10/2009)

              Comment


                #67
                Well to answer Noel's question, it says x3 under theme on the left hand side.

                Ruby is definately on my Dedicated Server - I'm on Islander. The rubygems button is there and working. And when I use "ruby ..." from SSH it works - hence my post above. Maybe I should do a support request?

                Comment


                  #68
                  Maybe it's the version of cpanel?
                  on mine it says:

                  cPanel Version 11.15.0-RELEASE
                  cPanel Build 18033

                  it's about half way down on the left hand side.

                  Support Desk will probably sort it out for you.

                  Comment


                    #69
                    That must be it, mine says version 11.11.0-STABLE
                    build 18033

                    Comment


                      #70
                      That could possibly be it. You will have to contact support to see the status of when your server is due for the cpanel update to be ran .
                      David Smith
                      Managing Director
                      DPS Computing Limited

                      - Massive update! (September 2011) - It's now not neglected!!
                      - New Site (10/2009)

                      Comment


                        #71
                        Originally posted by Andrew Burrage View Post
                        That must be it, mine says version 11.11.0-STABLE
                        build 18033
                        You now have latest version of cpanel. let me know if anything is missing from your control panel.
                        eUKhost - eNlight Cloud Hosting || eUKhost Knowledgebase
                        Toll Free : 0808 262 0255 || Skype : mark_ducadi

                        Comment


                          #72
                          Originally posted by eUKhost.com View Post
                          You now have latest version of cpanel. let me know if anything is missing from your control panel.
                          Great support from eUKhost .. in fact I'm going to go as far as to use the smiley =>

                          Comment


                            #73
                            Well I have had a little play with the new RoR cpanel feature and it's really nice.

                            I can very nearly make it do what I want.

                            It recognised my ruby apps by itself which was really smart. It allows me to successfully start and stop them, and in a similar way to my companies intranet setup that I described above it starts each ruby application on a separate port.

                            The last step is to redirect apache to that port. I can make it successfully redirect to the port, but I can't make it do this with the P (proxy) flag in the .htaccess file. All this will do is mean that you don't have the port showing in the URL, but it would be great if I could get this to work.

                            In user terms what this means is my ruby app now shows like this:
                            http://railsapp.mydomain.com/ gets redirected to http://railsapp.mydomain.comort/

                            but when I try the proxy so that it should become:

                            I get a 404.

                            Unfortunately I don't know enough about apache to know why this is happening.

                            The new RoR feature of the Cpanel is great though, it's working except for this one small detail.

                            Comment


                              #74
                              Hello Andrew,

                              Try using mod_rewrite rules as that will help you to rewrite URL's. You wont get access to apache configuration file on shared hosting server but all other webmasters use mod_rewrite feature to rewrite URL's.

                              I don't have much knowledge of mod_rewrite rules but http://cooletips.de/htaccess/ should be helpful to achieve what you are looking for.
                              eUKhost - eNlight Cloud Hosting || eUKhost Knowledgebase
                              Toll Free : 0808 262 0255 || Skype : mark_ducadi

                              Comment

                              Working...
                              X