ubuntu from scratch

this is for ubuntu gutsy 7.10 -- ymmv on other os's 

this is for installing mysql / ruby on rails / subversion / mongrel / nginx (web server)

(please notify me of any missing installs -- my email is the first word in the url of this webpage @gmail.com) 

italicized means optional

download / burn the minimal ubuntu cd (~ 9MB!)


install the minimal ubuntu -- this is detailed on: http://www.psychocats.net/ubuntu/minimal

(I use the cli option -- command line interface only) 

optimize your sources list 

sudo nano -B /etc/apt/sources.list

#(modify to have good sources for you -- can find mirrors at: https://wiki.ubuntu.com/Mirrors )

http://mirrors.xmission.com/ubuntu was good one for me -- although should leave the us ones in there also

(note aptitude is better than apt-get, can substitute aptitude for apt-get in instructions you find)

mount any samba shares:

sudo aptitude install smbfs 

from: http://justlinux.com/nhf/Filesystems/Mounting_smbfs_Shares_Permanently.html

smbmount //servername/sharename /mountdirectory -o \
#put following into /etc/fstab
//servername/sharename /mountdirectory smbfs \
username=windowsuserename,password=windowspassword 0 0 
install ssh server
sudo aptitude install openssh-server 
edit /etc/ssh/sshd_config
modify it so that PermitRootLogin is no, and/or any other settings you want to tweak

install emacs

sudo aptitude install emacs 

install .emacs / .emacs.d from a fileshare


bring system up to date

sudo aptitude update

sudo aptitude install xorg xterm wdm icewm menu firefox

#the next two lines I forgot to do -- I believe they are for terminal gui stuff 

sudo dpkg-reconfigure xserver-xorg

sudo /etc/init.d/wdm start


follow  Shortest passwordless ssh tutorial, ever (or get your ssh happy setup) 

from http://blogs.translucentcode.org/mick/archives/000230.html

#make sudo inherit the path of the caller (ubuntu does a security build that has a special sudo path)

mv /usr/bin/sudo /usr/bin/sudo.orig

#then create a file /usr/bin/sudo using the following:

cat >> /usr/bin/sudo << "EOF"

/usr/bin/sudo.orig env PATH=$PATH "$@"


#then your regular sudo works just like the non secure-path sudo

/usr/bin/sudo.orig chmod 755 /usr/bin/sudo


from: http://articles.slicehost.com/2007/11/23/ubuntu-gutsy-mysql-and-ror

sudo aptitude install mysql-server mysql-client libmysqlclient15-dev libmysql-ruby1.8 -y
sudo aptitude install ruby1.8-dev ruby1.8 ri1.8 rdoc1.8 irb1.8 libreadline-ruby1.8 libruby1.8 libopenssl-ruby -y

sudo ln -s /usr/bin/ruby1.8 /usr/local/bin/ruby
sudo ln -s /usr/bin/ri1.8 /usr/local/bin/ri
sudo ln -s /usr/bin/rdoc1.8 /usr/local/bin/rdoc
sudo ln -s /usr/bin/irb1.8 /usr/local/bin/irb

install rubygems
mkdir ~/sources
cd ~/sources
wget http://rubyforge.org/frs/download.php/38646/rubygems-1.2.0.tgz
tar xzvf rubygems-1.2.0.tgz
cd rubygems-1.2.0
sudo ruby setup.rb
#note -- i got an error here because I had RUBYOPT=rubygems -- it must not be set yet 
sudo ln -s /usr/bin/gem1.8 /usr/bin/gem
gem -v
#should get 1.2.0
install rails
sudo gem install rails

install postfix & subversion (postfix for mailing)
sudo aptitude install postfix subversion -y 

install make
sudo aptitude install make

install mongrel
sudo gem install mongrel

install any versions of rails you need: 
sudo gem install -v=1.2.2 rails

install other gems

sudo gem install dnsruby call_stack rubyful_soup 

create a subversion repository

from (above link -- with a minor tweak or two)
#become root 
sudo su -
groupadd -g 56 svn &&
useradd -c "SVN Owner" -d /home/svn -m -g svn -s /bin/false -u 56 svn

mv /usr/bin/svn /usr/bin/svn.orig &&
mv /usr/bin/svnserve /usr/bin/svnserve.orig &&
cat >> /usr/bin/svn << "EOF"
umask 002
/usr/bin/svn.orig "$@"

cat >> /usr/bin/svnserve << "EOF"
umask 002
/usr/bin/svnserve.orig "$@"

chmod 0755 /usr/bin/svn{,serve}

svn import -m "Initial import" /path/to/initial/dir file:///svnroot

chown -R svn:svn /svnroot &&
chmod -R g+w /svnroot &&
chmod g+s /svnroot &&
usermod -aG svn kem

install nginx with rails, mongrels
make sure you hit the permissions page

install sqlite3
sudo aptitude install sqlite3 libsqlite3-dev
sudo aptitude install build-essential ruby-1.8dev
sudo gem install sqlite3-ruby 
dev stuff for fox / fxruby:
sudo aptitude install libc6-dev libx11-dev
sudo aptitude install libxext-dev x11proto-xext-dev libxrender-dev
sudo aptitude install libpng libjpeg libtiff libpng12-dev libjpeg-dev libtiff-dev
curl with https: 
sudo aptitude install curl ca-certificates

nginx https:
sample nginx conf file:

setup samba server:

install mysql-2.7.4 gem


or do this:

download the tarball at: http://tmtm.org/downloads/mysql/ruby/

tar -zxvf mysql-ruby-*.tar.gz

cd mysql-ruby-* 

ruby extconf.rb --with-mysql-config


ruby ./test.rb -- localhost root mysqlrootpass

sudo make install


#note to build gems, you do:

gem gemname.gemspec

gemspec info at: http://rubygems.org/read/chapter/20

install wireless access

#note -- this isn't all required, is just how i did it

aptitude install ubuntu-desktop

#(in the upper right there should be  a network icon  where you can now go wireless)

# i rebooted after unplugging my ethernet cable in order to get dns to work (probably some better way to do this, but I wasn't sure how)

#possibly follow the instructions below if stuff isn't working


install java & sandr (search and replace)

aptitude install sun-java6-jre