Archive for the 'vps' Category

Installing git from source ubuntu

May 14th, 2009 by pyrat

When you have an old version of ubuntu but want a new version of git. And potentially have it already installed.

sudo apt-get update
sudo apt-get remove git-core
sudo apt-get install tcl8.4 tk8.4
sudo apt-get build-dep git-core
 
wget http://kernel.org/pub/software/scm/git/git-1.6.3.1.tar.gz
tar -zxvf git-1.6.3.1.tar.gz
cd git-1.6.3.1
./configure
make
sudo make install
 
 
sudo ln -s /usr/local/bin/git /usr/bin/git

Installing ImageMagick / Rmagick on Ubuntu Hardy

May 14th, 2009 by pyrat

Mainly to help me remember in the future. Might be useful to you also..

  sudo apt-get update
  sudo apt-get install imagemagick
  sudo apt-get install libmagick9-dev
  sudo gem install rmagick

php commandline on ubuntu

November 20th, 2007 by pyrat

Tested on Ubuntu LTS 6.06

  sudo apt-get install php5-cli

Installing Nginx on Ubuntu Dapper (LTS 6.06)

November 15th, 2007 by pyrat

There is a great slicehost article which goes into more detail than this. But the following script will install it from source in one go!.

#!/bin/bash
 
sudo apt-get install libpcre3 libpcre3-dev libpcrecpp0 libssl-dev
wget http://sysoev.ru/nginx/nginx-0.5.33.tar.gz
tar -zxvf nginx-0.5.33.tar.gz
cd nginx-0.5.33
./configure --sbin-path=/usr/local/sbin --with-http_ssl_module
make
sudo make install
cd ~
cd sources
sudo wget http://notrocketsurgery.com/files/nginx -O /etc/init.d/nginx
sudo chmod 755 /etc/init.d/nginx
sudo update-rc.d nginx defaults

Upgrading Ruby on Ubuntu Dapper

November 2nd, 2007 by pyrat

dapper

Ubuntu Dapper will only install ruby as high as 1.8.4 which is not ideal sometimes. To upgrade an existing ruby installation to 1.8.6 do the following.

  sudo apt-get install build-essential
sudo apt-get install libreadline5 libreadline5-dev
wget ftp://ftp.ruby-lang.org/pub/ruby/1.8/ruby-1.8.6.tar.gz
tar -xzf ruby-1.8.6.tar.gz
cd ruby-1.8.6
./configure --prefix=/usr/local --enable-pthread --with-readline-dir=/usr/local
make
sudo make install

Even if you had rubygems you need to install it and all your gems! Again.

   wget http://rubyforge.org/frs/download.php/35283/rubygems-1.1.1.tgz
tar -xzf rubygems-1.1.1.tgz
cd rubygems-1.1.1
sudo ruby setup.rb

Now this is where you need to do a little fix. Openssl will not work out of the box and some application need it so you should just set it up now.

Note: If apt-get libssl-dev complains about a not found run: sudo apt-get update

  sudo apt-get install libopenssl-ruby
sudo apt-get install libssl-dev
 
cd ~/src/ruby-1.8.6/ext/openssl
ruby extconf.rb
make
sudo make install

And thats it!

Apache Configuration Tool

September 28th, 2007 by pyrat

apache-gunship-flickr

I have been doing a bit of sysadmin stuff with iformis recently which has involved a bit of virtual host configuration for a number of sites. Although Nginx is top for rails, apache is still the king of PHP.

We use apache in a debian / ubuntu environment so I have gone and written a wee gem to make vhost configuration a bit easier.

1. Install apacheconf


sudo gem install apacheconf

2. Setup YAML Config


site_name: fun
server_name: fun.com
server_alias: www.fun.com
document_root: /var/www/apps/fun

3. Run apacheconf


apacheconf --enable fun.yml

4. There is no step 4!

Apacheconf

Please contact me with any issues and ideas for improvements.

PHP Mysqli Ubuntu Install

September 26th, 2007 by pyrat

For installing mysqli extension after PHP is installed on a Linux ubuntu or debian.

  1. apt-get install php5-mysqli

NOTE: after install, you need to reboot apache

  1. apache2ctl graceful

Simple Effective Firewall Configuration

September 21st, 2007 by pyrat

Simple Configuration

This allows HTTPS, HTTP and SSH traffic on a non standard port.

Example Monit Configuration with Mongrel

September 15th, 2007 by pyrat

Monit is great for keeping your services online. I use them for keeping my collection of slices online when I am asleep.
The example monitrc is a great starting point of listing the services which you should be monitoring.

One thing: monit can have its own little http server which runs internally. This is off in the example config as you have to explicitly enable it.

I hope to release a monit config generator gem in the near future which makes this a lot quicker.

Email Administration on a VPS (Postfix etc)

July 25th, 2007 by pyrat

I have recently been moving some sites from shared hosting to my vps. And one of the benefits of shared hosting is a shiny cpanel installation which provides controls for working with email. Something which a barebones vps installation lacks. (Which is not a bad thing :-)

Whilst it is good to have postfix configured so your site can send email I am now of the mind that it is easier and a better use of resources to outsource the incoming email to google apps.

It is still free for the time being and all you need to do is add a few MX records to allow google to handle your mail and you are cooking on gas.

Also there is the ability to create domain aliases, so you can have multiple domains running through one google apps account. (Assuming you want to do this).

I was too short on time to learn the ins and outs of postfix so im using yet another google web service solved my problems.