Howto - Get GoDaddy Rollin’ on Rails



I’ve done quite a few posts around getting my Rails app configured on GoDaddy’s servers. Let me first say that this is cumbersome, GoDaddy’s support is not the greatest when it comes to Rails, and the application is unbearably slow. I thought this was the case for only the server I was on, but it turns out a good friend of mine is having the similar (even worse) issues. Since I went through the entire configuration process again this evening I figured I would post the details for anyone interested.

Let’s assume you have a Rails app called myapp and you want to get it running on GoDaddy’s servers. The first thing you need to do is make sure your database.yml file is configured correctly under the production settings. If you’re running MySQL locally then you’re most likely using the local socket connection. For GoDaddy this needs to be changed to specify a host and port. Your config should look something like the following:

production:
adapter: mysql
host: mysql123.secureserver.net
port: 3306
database: mydatabase
username: myusername
password: mypassword

The main thing you need to note is the hostname of the MySQL server. This can be found in the GoDaddy control panel under MySQL. Once you get the database connection stuff configured it’s safe to go ahead and upload your application to the server. Just upload it to the webroot so the final URL will look something like http://mydomain.com/myapp/.

After uploading you’ll need to create a symbolic link to provide an easier URL to access. This may be something like http://mydomain.com/a. I’m not sure if this step is actually necessary, but let’s not deviate since I know it works! In the control panel click on the CGI Admin link and a new window will launch. You’ll see a section labeled Create Rails Symbolic Link. Click on the Show Rails Applications link and you should see a drop-down menu with your app name (myapp) in it. Fill out the text field to the right and call it “a” or whatever you want.

We’re getting closer. Now here are a couple of key issues to resolve. Be sure to modify your environment.rb file in /myapp/config/ and change the RAILS_GEM_VERSION to 1.0.0. The next thing you should do is make sure the path to the Ruby binary is set properly in /myapp/public/dispatch.cgi and the first line should look like #!/usr/local/bin/ruby. After making all these changes be sure to upload the files to the server. Finally, be sure to change the permissions on dispatch.cgi to 755. This only applies to Linux servers and I’m not sure if GoDaddy even supports Rails on Win.

That should be everything you need to get going. If you access http://mydomain.com/a/ you should be routed to the index page in the public directory. Now try accessing some of your controllers and see what happens.

When you’re ready for FastCGI check out this link: http://www.db75.com/new_blog/?p=242. I wouldn’t really call it fast because GoDaddy seems to be having problems managing this module. I’m optimistic they will step up their Rails game or else they’re going to lose a lot of customers to Dreamhost and TextDrive, which I’ve heard good things about.



6 Responses to “Howto - Get GoDaddy Rollin’ on Rails”

  1. Marlon says:

    Now, if only we could figure out a way to set up a web site on godaddy that wouldn’t require the http://www.mysite.com/{rails app alias}/ and just go directly to a rails app.

  2. dennis says:

    You are so dead on with that! I’m ditchin’ GoDaddy ASAP:
    http://www.db75.com/new_blog/?p=268

  3. [...] What’s funny about this response is that it’s not the first time I’ve received the “it’s your problem not ours” reply.  Of all the times I’ve received this message it HAS been their problem and not a scripting issue.  At any rate, after planning around for a few hours I came to realize that the RAILS_GEM_VERSION fix I posted here was actually the problem.  Remember that it worked fine and that GoDaddy must have upated something to cause it break. [...]

  4. I’ve taken three whacks at getting a Rails site running at GoDaddy — A year after you write this, the knowledge base is still woefully inadequate, and their ability to help is still nothing more than “Nothing’s our fault, our stuff works, you just don’t know how”.

    I’m done with that, and my blog posting will be extremely unkind to these punks.

  5. Anonymous says:

    And why all always consider that they rule;govern on all 100% Yes too faithfully

  6. dennis says:

    True. I definitely don’t think they rule for hosting and will never use them again unless a client demands it. I only find use of their domain registration and admin console for DNS and such.

Leave a Reply