Howto – Get GoDaddy Rollin’ on Rails
Jul 26
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.
Read More