Category Archives: Ubuntu

Quickly resolve ip address to hostname

sudo aptitude install nmap

sudo nmap -sP


setting up ubuntu production server

check to make sure everything is updated and upgraded

#sudo apt-get update && upgrade

install apache 

#sudo apt-get install apache2

configure apache 

add the following to the bottom of apache2.conf

# Include the virtual host configurations:
Include sites-enabled/

We need to enable apache and mono to work together and set up apache to do name based virtual hosting

add the following lines to /etc/apache2/sites-enabled and /etc/apache2/sites-available

at the top of the file:




at the bottom:



<Directory /var/www/SITE-DIRECTORY/>
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Order allow,deny
Allow from all
SetHandler mono
DirectoryIndex index.aspx index.html


Then add the following to /etc/apache2/mods-enabled/mod_mono.conf

Include /etc/mono-server4/mono-server4-hosts.conf

install postgres

#sudo apt-get install postgres9.1

use: for user setup

Configure postgres

Modify the Hba.conf

Edit the pg_hba.conf make sure to add the computers ip or set localhost to allow connections via md5

Install mono

#sudo apt-get install mono-runtime

Install mod_mono 

#sudo apt-get install libapache2-mod-mono

#apt get- install mono-apache-server2

#apt-get install mono-apache-server4


Configure mod_mono

in /etc/mono-server4/ add a new webapp.

#touch vsurv.webapp

pasted the following in:


v path is the virtual path (path after the site domain)

path is the actual path on the server to serve from

pgbager installation on postgres 9.1 box

Followed the guide found here:


Get pgbager:

git clone


perl Makefile.PL
make && sudo make install

Locations installed with make

Installing /usr/local/man/man1/pgbadger.1
Installing /usr/local/bin/pgbadger
Appending installation info to /usr/local/lib/perl/5.14.2/perllocal.pod

Edit postgres_conf (make backup first)

logging_collector = on
log_min_messages = debug1
log_min_error_statement = debug1
log_min_duration_statement = 0
log_line_prefix = '%t [%p]: [%l-1] user=%u,db=%d '
log_checkpoints = on
log_connections = on
log_disconnections = on
log_lock_waits = on
log_temp_files = 0