The Staging Server
Provisioning a staging server
You should install Ubuntu 8.04 LTS on the host, selecting all the defaults but including an SSH server.
While you're on the server, create the deploy user and give it administrative rights.
adduser deploy
sh -c "echo 'deploy ALL=(ALL) ALL' >> /etc/sudoers"
Lock remote SSH logins down to just the deploy user by editing /etc/ssh/sshd_config:
PermitRootLogin no
AllowUsers deploy
You might also want to set the correct timezone:
sudo dpkg-reconfigure tzdata
Now on your local machine, cd into your blueprint directory. Make sure you have configured a staging hostname and database credentials.
(If you are using the HOSTS_CONTEXT trick to manage multiple targets, run export HOSTS_CONTEXT=your_context at this point. Yes, this trick is still undocumented.)
To provision the server, run these commands locally:
export RAILS_ENV=staging
cap provisioning:prepare
sprinkle -s lib/recipes/provision.rb
cap provision
That'll take somewhere between 60 and 90 minutes to complete. Once done, you should be able to enter the staging server's IP in a web browser (it'll show a Site Not Found Blueprint message.)
Problems with tidy
Until the tidy gem is updated, you may need to patch it. Test whether you need to:
$ script/console
>> "truncate".truncate_html(4)
If you get a segfault:
$ sudo vim /usr/local/lib/ruby/gems/1.8/gems/tidy-1.1.2/lib/tidy/tidybuf.rb
Add this line (marked here with +):
TidyBuffer = struct [
+ "int* allocator",
"byte* bp",
Note that these instructions apply to the 1.0 tag. In the current trunk, the "HOSTS_CONTEXT" trick is no longer necessary, and the tidy gem dependency has been removed. Both these parts of the above instructions no longer apply.