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
8 responses so far ↓
1 Alex Gretlein // Jul 31, 2007 at 06:01 PM
2 cbt // Aug 08, 2007 at 04:26 PM
3 ynw // Aug 28, 2007 at 06:56 PM
Compiled Nginx on Ubuntu from source with no trouble.
4 Jack Danger // Aug 28, 2007 at 09:43 PM
@ynw I’m sure you can compile it, I just don’t want to bother learning another distro when I’ve got so much Gentoo experience. Plus I’m not sure if Ubuntu will keep the Nginx code as updated as Gentoo unstable does.
Like so many other things: use what works for you.
5 Koba // Oct 16, 2007 at 01:22 PM
I think there might be an error in your script. This line:
/etc/init.d/mysql nginx start
should probably be:
/etc/init.d/nginx start
Thanks for contributing… I’m going to do something similar.
6 Jack Danger // Oct 16, 2007 at 02:04 PM
Thanks Koba – I’m not sure how that got in there. Fixed!
7 koba // Oct 16, 2007 at 10:45 PM
No problem. Thanks for making my move to Gentoo smoother.
8 Gilang Chandrasa // Mar 07, 2008 at 08:56 AM
FYI, there is nginx package for Ubuntu, but not as update as nginx package for Gentoo.
you need to activate universe, so your Ubuntu can get the package.
I would like to try Gentoo, considering Gentoo update faster than most of distro.
Leave a Comment