Posts Tagged ‘Rails’

5
Mar

Full Rails Stack Part Four: Capistrano, MySQL

   Posted by: Jeff Owens    in Rails

We completed our subversion setup in part three, now let's add Capistrano deployment to the mix. Let's go ahead and ssh into our server:

CODE:
  1. ssh -p 8888 deploy@your_linux_box.com

Add the following new directories to our server. This is where our staging and production factory websites will be deployed to:

CODE:
  1. sudo mkdir /var/www
  2. sudo mkdir /var/www/apps
  3. sudo chown -R deploy:deploy /var/www/apps

Read the rest of this entry »

Tags: , , ,

4
Mar

Full Rails Stack Part Three: Project and Subversion

   Posted by: Jeff Owens    in Rails

If you've finished part two let's continue. In this part of the series I'm going to assume you have a working installation of MySQL on your local client machine that we will only need for testing purposes. If you've got a Mac you might look at installing MacPorts and using it to install MySQL for you. First we'll create a test rails project. I'm going to use the latest rails 2 sugar in setting up this simple test site. Open up terminal or iTerm and find a directory you want to use to create the test project. Here we go:

CODE:
  1. rails --d=mysql factory
  2. cd factory
  3. rake db:create
  4. script/generate scaffold widget name:string description:text
  5. rake db:migrate

Now let's test our site to make sure everything is working correctly:

CODE:
  1. script/server

Open up your browser and try the site out using http://localhost:3000/widgets.

Read the rest of this entry »

Tags: , , ,

5
Feb

Full Rails Stack Part 2: Rails, Mongrel and Nginx

   Posted by: Jeff Owens    in Rails

We completed setting up ssh and ssh keys in part one, let's continue now with part two of installing a full Rails stack.

SSH into your server:

CODE:
  1. ssh -p 8888 deploy@your_linux_box.com

By default, Debian and Ubuntu have five package repositories called main, restricted, universe, multiverse, and commercial. You will need the universe package repository. By default, it may or may not be enabled. To check, edit the /etc/apt/sources.list file (note that if you didn't install the aliases in part one you'll use "sudo nano" instead of sn below):

Read the rest of this entry »

Tags: , , ,

4
Feb

Full Rails Stack With Nginx, Mongrel, Monit, And More

   Posted by: Jeff Owens    in Rails

I enjoy coding websites. I like coming up with elegant and flexible solutions to problems. If you saw David Heinemeier Hanssons' early screen casts on web development with Ruby on Rails, you may have been as impressed as I was. Unfortunately, deployment of a website to a *nix server can be a daunting task if you haven't done it before. It doesn't matter if it is a PHP, Python, or Ruby on Rails website, you need to have some basic sysadmin skills to set everything up on a newly installed server. You've got to know something about web servers (Apache, NginX, etc.), something about databases (MySQL, Postgres), about firewalls (iptables or Shorewall), source control (Subversion), email (SendMail, Postfix), monitoring your server (Monit, Nagios), statistics (Awstats, etc.), log rotation, cron jobs, offsite backups (Amazon s3). I have yet to meet an expert in all of these areas. For those sysadmins out there that fit the description I bow deeply. I've decided to do a series on setting up a full Rails stack on Ubuntu. So far I have deployed production Rails web applications to Red Hat, Open Solaris, CentOS, and Ubuntu servers. I've learned enough to know how truly ignorant I am. I don't claim to be an expert. But I am willing to share what I've learned so far in hopes it will help others out there. Here is what you'll get (in no particular order) when finished with the series. Read the rest of this entry »

Tags: , , , , , , ,