Fork me on GitHub
Hoopla! - now with extra whiz-bang home

Ahoy Railers, Gentooers, Nginxers and other ridiculous sounding words!

I've recently found myself setting up a number of machines at Slicehost with a Gentoo install. Why Gentoo you ask? Why not Ubuntu? Well, I must say that I'm always tempted to try Ubuntu because of the speed of installation and the fact that I don't have to wait for things to compile. In fact, the last few slices started with Ubuntu. They each ended abruptly when I tried:

sudo apt-get install nginx

only to find that Ubuntu didn't know about Nginx. Didn't even know!

Sure, I can install Nginx from source but then what's the point of even having a package manager? Gentoo gives me 7 versions of Nginx and remember which other apps each version works and plays well with. 7 versions. Ubuntu has none.

So I keep going back to Gentoo. And to make life easier on myself I decided to actually record my steps the last time so I don't have to think about it next time. Here's a handy little script to get you rollin' on a bleeding-edge Gentoo slice in no time.



# login as root before running this script
# edit the username to reflect your preferences.
# save the script to a file and run it like:
# > /bin/bash this_script &
# remember the ampersand on the end and it'll run until it's done even if you disconnect

my_favorite_username='whatever_you_like_to_login_with'

# this bit will require some user interaction
useradd -m $my_favorite_username
useradd -d /www -m www
passwd $my_favorite_username
passwd www

# from here on we're rollin'
echo 'ACCEPT_KEYWORDS=~amd64' >> /etc/make.conf
echo 'USE="gif imagemagick innodb jbig jpeg jpeg2k pdf perl png mysql python ruby sqlite3 ssl svg truetype unicode xml xpm pcre -php -wmf -tiff -lcms -postgres"' >> /etc/make.conf
emerge --sync
emerge sudo
echo "$my_favorite_username        ALL=(ALL)       NOPASSWD: ALL" >> /etc/sudoers
emerge -C ssmtp
emerge vim ruby rubygems nginx subversion dev-db/mysql postfix vixie-cron
gem install --include-dependencies --no-ri --no-rdoc rails mongrel mongrel_cluster tzinfo BlueCloth RedCloth mysql sqlite3-ruby rspec zentest capistrano nginx_config_generator
gem install --include-dependencies --no-ri --no-rdoc activeresource --source http://gems.rubyonrails.org
emerge --config =dev-db/mysql-5.0.44-r1
rc-config add mysql default
/etc/init.d/mysql start
rc-config add nginx default
/etc/init.d/nginx start
rc-config add postfix default
/etc/init.d/postfix start
blog comments powered by Disqus