Category Archives: Ubuntu

Quickly resolve ip address to hostname

sudo aptitude install nmap

sudo nmap -sP xxx.xxx.xxx.xxx

Advertisements

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/
ServerName subdomain.domain.com

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:

—–

ServerName subdomain.domain.com

——

at the bottom:

—-

ServerName subdomain.domain.com

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

—-

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: https://help.ubuntu.com/community/PostgreSQL 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

#mono-apache-server4 

Configure mod_mono

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

#touch vsurv.webapp

pasted the following in:

<apps>
<web-application>
<name>VSurv</name>
<vpath>/</vpath>
<path>/var/www/vsurv</path>
<vhost>beta.vsurv.com</vhost>
</web-application>
</apps>

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: http://michael.otacoo.com/postgresql-2/postgres-pgbadger-sneaking-in-log-files-for-you/

 

Get pgbager:

git clone https://github.com/dalibo/pgbadger.git

Install

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