Tech Tidbits - Ruby, Ruby On Rails, Merb, .Net, Javascript, jQuery, Ajax, CSS...and other random bits and pieces.

Showing posts with label ubuntu. Show all posts
Showing posts with label ubuntu. Show all posts

Friday, June 8, 2007

APT Quick Reference

I found this handy apt-get Phil's APT Quick Reference...


Download and install package:

apt-get install package




Update apt's list of available packages:

apt-get update




Upgrade all installed packages with upgrades available:


apt-get upgrade




Upgrade to new distro, or in general upgrade anything available for update including core system packages:

apt-get dist-upgrade




Uninstall package:

apt-get remove package





Uninstall package, and its config files, and don't leave it in the database as 'uninstalled':

apt-get --purge remove package




Search for a package like pattern:

apt-cache search pattern





Get information on installed package:

dpkg -s package




Find which installed package file belongs to:

dpkg -S inetd.conf





List which files are in package:

apt-file list package




Find out what packages provide file:

apt-file search file





Run a command (such as ./configure or make) and have all necessary packages installed as needed:

auto-apt run command




Unless specified, the package in reference doesn't have to be already installed for these to work... but the database needs to be updated. You can update the appropriate database via:

apt-get update

or

auto-apt update

or

apt-file update


Ruby on Rails/Mongrel/Ubuntu

I've been using Ubuntu lately and decided to install Ruby on Rails and Mongrel.


$ sudo apt-get install ruby irb rdoc


Or download the source for the latest version (apt-get installs 1.8.4, but the latest source is 1.8.6):


$ tar zxvf ruby-1.8.6.tar.gz
$ cd ruby-1.8.6
$ ./configure
$ make
$ sudo make install


Once ruby is installed, I typically use Gems if I can.

Download the latest Gems at http://rubyforge.org/frs/?group_id=126 (0.9.4 in this case) and then:


$ tar xzvf rubygems-0.9.4.tgz
$ cd rubygems-0.9.4
$ sudo ruby setup.rb


Install Rails:

sudo gem install rails --include-dependencies


Install Mongrel and Mongrel cluster gem plugin:

sudo gem install mongrel --include-dependencies
sudo gem install mongrel_cluster


Install Apache 2.2

$ tar zxvf httpd-2.2.4.tar.gz
$ cd httpd-2.2.4
$ ./configure \
--prefix=/usr/local/apache \
--enable-rewrite \
--enable-headers \
--enable-ssl \
--enable-proxy \
--with-mpm=prefork
$ make
$ sudo make install


I got this error when running configure:

Configuring Apache Portable Runtime Utility library...

checking for APR-util... yes
configure: error: Cannot use an external APR-util with the bundled APR
make: *** [apache] Error 1


Adding this option fixed the problem:

--with-included-apr


Running Apache with a single Mongrel Instance

$ mongrel_rails start -p 8000 -e production -d


Add to apache conf (httpd.connf)

ServerName hostname.com
ServerAlias www.hostname.com

ProxyPass / http://www.hostname.com:8000/
ProxyPassReverse / http://www.hostname.com:8000/
ProxyPreserveHost on


Restart Apache and it will forward requests for www.hostname.com on port 80 to Mongrel server running on port 8000.

About Me

My photo
Developer (Ruby on Rails, iOS), musician/composer, Buddhist, HSP, Vegan, Aspie.

Labels