Ubuntu

Introduction
Linux is an alternative to operating systems like Windows and Mac OS. Linux is also free and comes in many distributions. For the purposes of this page, Ubuntu is the distribution of choice that also ranks high on DistroWatch.
Tips and Tricks
- Setup Your Server the Right Way.
- Set Up An Ubuntu Local Development Machine For Ruby On Rails
- How to Install Ruby 1.9.2 and Rails 3.0 on Ubuntu 10.10
- 15 Tips for Power Users.
- Pendrive Linux - Learn how to install and configure Ubuntu on a flash drive.
- How to Print to PDF in Ubuntu.
- How To Install Ubuntu on PlayStation 3.
- Fixing a Corrupt Sudoers File - Start by rebooting your machine and then pressging the “Enter” key to enter the GRUB boot menu. Select the Ubuntu-entry in question, prese “E”, select the line starting with “kernel”, press “E” again, navigate to the end of the line and append “init=/bin/bash” to the line. Press “Enter” to apply changes (these changes are temporary for the current session, nothing is saved to file). Press “B” to boot. You will now be in a very limited environment but enough to make changes and fixes as necessary.
- 17 Must-Have Free Apps for New Ubuntu Users
- Block a Website for Everyone But You
- The perils of InnoDB with Debian and startup scripts
- TimeMachine - Learn how to use TimeMachine with Ubuntu
- More TimeMachine - More notes on TimeMachine and Ubuntu.
- Ubuntu TimeMachine server for Snow Leopard
- Nginx and Passenger Configuration Instructions.
Getting Started
- Ubuntu Help - The official Ubuntu documentation.
Server Install Steps
- Visit the Ubuntu web site and download the server ISO CD image.
- Once downloaded, burn the ISO file to CD, and reboot to start the installation process.
- Pick the server install from the main menu and follow the install screen prompts.
- When asked to detect keyboard, skip this and pick your country settings instead.
- When asked to to setup your hard disk pick “Guided - use entire disk”.
- When asked for automatic software updates, choose manual.
- When asked what software to install after the core has been installed choose: LAMP. It won’t work but pick it anyway.
Server Application Install Steps
With Ubuntu freshly installed, here are a few other apps worth installing to make Ubuntu more usable as a server and development platform (steps are provided afterwords on how to configure this software). Execute the following commands from the command line in order to install:
General:
- sudo apt-get update
- sudo apt-get upgrade
- sudo apt-get install curl
- sudo apt-get install openssh-client
- sudo apt-get install openssh-server
- sudo apt-get install vsftpd
- sudo apt-get install zip
- sudo apt-get install git-core
- sudo apt-get install build-essential
- sudo apt-get install bison
- sudo apt-get install libreadline6
- sudo apt-get install libreadline6-dev
- sudo apt-get install zlib1g
- sudo apt-get install zlib1g-dev
- sudo apt-get install libssl-dev
- sudo apt-get install libyaml-dev
- sudo apt-get install libapr1-dev
- sudo apt-get install libaprutil1-dev
- sudo apt-get install libxml2-dev
- sudo apt-get install libxslt-dev
- sudo apt-get install libsqlite3-0
- sudo apt-get install libsqlite3-dev
- sudo apt-get install sqlite3
- sudo apt-get install autoconf
- sudo apt-get install libc6-dev
- sudo apt-get install ncurses-dev
- sudo apt-get install imagemagick
- sudo apt-get install librmagick-ruby
- sudo apt-get install apache2
- sudo apt-get install apache2-prefork-dev
- sudo apt-get install libpq-dev
- sudo apt-get install postgresql
- sudo apt-get install mysql-server
- sudo apt-get install python-setuptools
Configure the Hostname
- Edit the /etc/hostname file with your name of choice.
- Run the following command to restart and apply your changes:
sudo /etc/init.d/hostname.h start
Configure the Network
- Edit the /etc/network/interfaces file adding the ip, netmask, and gateway for your ethernet adapter.
- Edit the /etc/resolv.conf so that it includes the primary and secondary DNS servers.
Configure the OpenSSH Server
- Edit the /etc/ssh/sshd_config file so that the “Banner” line is uncommented to pick up the changes.
- Edit the /etc/issue.net file as you see fit (maybe enter the name of your server or something clever).
- Restart the server: sudo /etc/init.d/ssh restart.
Configure the FTP Server
- Edit the /etc/vsftpd.conf file.
- Set anonymous_enable=NO
- Set local_enable=YES
- Set write_enable=YES
- Restart the server: sudo /etc/init.d/vsftpd restart
Configure Git
Remote Setup:
- Switch to root user.
- cd ~/src
- git clone git://eagain.net/gitosis.git
- cd gitosis
- python setup.py install
sudo adduser --system --shell /bin/sh --gecos 'git version control' --group --disabled-password --home /home/git git- Create a public key (i.e. ssh-keygen -t rsa) on your local machine or use an existing public key in your ~/.ssh folder.
- Upload the id_rsa.pub key to the server in the /tmp folder for example.
- sudo -H -u git gitosis-init < /tmp/id_rsa.pub
Local Setup:
git clone ssh://git@<server host>/gitosis-admin.git
Full documentation can be found here.
Configure the Apache HTTP Server
- Create your own Apache web directory (instead of using the defaults). Example: /var/www/example.
- Create a new user group that will be associated with the newly created /var/www/example directory:
sudo adduser dev - Create and add team members to the new “web” user group.
- Set group permissions on the “/var/www/example” directory so the new group can access the directory.
- Copy the /etc/apache2/sites-available/default file to a /etc/apache2/sites-available/(your site name) file.
- Edit the /etc/apache2/sites-available/(your site name) file.
- Set the ServerName to your private or public web address. Example: ..com.
- Set the ServerAdmin to your personal e-mail address.
- Set the DocumentRoot to whatever your newly created “web” directory path name is.
- Rename the /var/www directory to whatever your newly created “web” directory path is.
- Disable the default site: sudo a2dissite.
- Enable your new site: sudo a2ensite.
- Enable any additional modules by issuing the sudo a2enmod command and picking which module(s) you want to enable. Example: rewrite.
- Restart the server: service apache2 restart.
Configure PostgreSQL
Admin Setup:
- sudo -u postgres psql template1
- \password postgres
- \q
vi /etc/postgresql/9.1/main/pg_hba.confand add ensure the following is added to the bottom of the file:
local all all trustandhost all 127.0.0.1/32 trustDetails here.- To restart, type:
service postgresql restartor/etc/init.d/postgresql restart
User Setup
sudo -u postgres createuser --superuser <user> -P
Database Setup:
sudo -u postgres createdb -O <user> <database>- sudo -u postgres psql template1
GRANT ALL PRIVILEGES ON DATABASE <database> to <user>;- \q
Type service postgresql restart to restart PostgreSQL.
Configure MySQL
- Set the root password: sudo mysqladmin -u root password (your new password). You might also want to log into MySQL using the following command: mysql -u root -p. It is worthwhile to double check the root password is set.
- Edit the /etc/mysql/my.cnf file.
- Comment out the “bind-address=127.0.0.1″ line so connections can be accepted from other machines.
- Restart the server: sudo /etc/init.d/mysql restart
- Login to MySQL and create a default database: CREATE DATABASE (new database name here).
- Grant access to the new database for the main user or set of users who might need to access the database via MySQL Administrator or other GUI tools:
GRANT ALL PRIVILEGES ON <database>.* TO "<username>"@"<host>" IDENTIFIED BY "<password>";NOTE:<database>, <username>, <host>, and <password>should be replaced accordingly.
Configure Ruby and Ruby on Rails
To configure Ruby and Ruby on Rails, execute the following commands from the command line:
rbenv:
- cd ~
- git clone git://github.com/sstephenson/rbenv.git .rbenv
echo 'export PATH="$HOME/.rbenv/bin:$PATH"' >> ~/.bashrcecho 'eval "$(rbenv init -)"' >> ~/.bashrc- source .bashrc
- mkdir ruby_source
- cd ruby_source
- curl -O http://ftp.ruby-lang.org/pub/ruby/1.9/ruby-1.9.2-p290.tar.gz
- tar -xvzf ruby-1.9.2-p290.tar.gz
- cd ruby-1.9.2-p290
./configure --prefix=$HOME/.rbenv/versions/1.9.2-p290- make
- make install
- rbenv rehash
- rbenv global 1.9.2-p290
dotfiles:
- cd ~
- rm -f .bash_profile
- rm -f .bashrc
- git clone https://github.com/bkuhlmann/dotfiles
- cd dotfiles
- ruby install.rb
gems:
- cd ~
- git clone https://github.com/bkuhlmann/ruby_gem_setup
- cd ruby_gem_setup
- ruby setup.rb
node.js:
This is necessary for Rails (especially the execjs gem).
- sudo apt-get install python-software-properties
- sudo add-apt-repository ppa:chris-lea/node.js
- sudo apt-get update
- sudo apt-get install nodejs
Phusion Passenger:
Read my Phusion Passenger post.
Services
- Ubuntu Server Edition on Amazon - Easily setup Ubuntu on the Amazon EC2 cloud.
Applications
- Top 10 Ubuntu Downloads
- lsof - A handy debugging tool for listing files and processes currently open or in use by the operating system.
- Top 10 Apps
- ManDVD - Use it to create customized DVD menus.
- K3b - CD/DVD authoring software. Go here to learn more.
- Redcar - “An open-source programmers’ text editor for Gnome (Linux). It is designed to be compatible with Textmate bundles (a work in progress) and is written almost entirely in Ruby - with some Vala thrown in for speed.”
Search
Categories
- Adventures
(145)
- Announcements
(39)
- Business
(20)
- Electronics
(22)
- Employment
(1)
- Epicurean
(10)
- Games
(2)
- Literature
(1)
- Mechanical
(4)
- Meetups
(15)
- Movies
(2)
- Music
(26)
- Photography
(1)
- Services
(27)
- Software
(134)