Debian Sarge (3.1) with Ruby on Rails and Apache 2 with FastCGI

by TomW May 04, 2006.

This howto will step you through installing Debian (Sarge) with Ruby on Rails and Apache 2 with FastCGI managed with ISPConfig.

It will use the following software:

  • Web Server: Apache 2.0.x
  • Mail Server: Postfix
  • DNS Server: BIND9
  • FTP Server: proftpd
  • POP3/POP3s/IMAP/IMAPs: Maildir format Courier-POP3/Courier-IMAP
  • Webalizer for web site statistics
  • Database: MySQL version 4.0
  • FastCGI Library 2.40
  • Ruby 1.82 with MySQL support.
  • Ruby GEM 0.8.11
  • Rails 1.1.2

This HOWTO is based mainly on The Perfect Setup -- Debian Sarge (3.1) by Falko -- consult that HOWTo for basic Debian Network Install Setup. The following sources were used or consulted:

Assuming you have an up and running basic Debian NetInstall (First two pages of Perfect Setup above) do the following:

Install your favorite editor

I like the Joe editor and will use it in all the examples -- substitute you favorite editor, so:

apt-get install joe

Configure the network

Edit the /etc/network/interfaces file

joe /etc/network/interface

It will initially look like this:

# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).
# The loopback network interface
auto lo
iface lo inet loopback

# The primary network interface
auto eth0
iface eth0 inet dhcp

Change it to look like this (example uses 192.168.0.100)

# /etc/network/interfaces -- configuration file for ifup(8), ifdown(8)
# The loopback interface
auto lo
iface lo inet loopback

# The first network card - this entry was created during the Debian installation
# (network, broadcast and gateway are optional)
auto eth0
iface eth0 inet static
address 192.168.0.100
netmask 255.255.255.0
network 192.168.0.0
broadcast 192.168.0.255
gateway 192.168.0.1

For multiple ips just add a new ip block like this (example uses 192.168.0.101)

# /etc/network/interfaces -- configuration file for ifup(8), ifdown(8)

# The loopback interface
auto lo
iface lo inet loopback

# The first network card - this entry was created during the Debian installation
# (network, broadcast and gateway are optional)
auto eth0
iface eth0 inet static
address 192.168.0.100
netmask 255.255.255.0
network 192.168.0.0
broadcast 192.168.0.255
gateway 192.168.0.1

auto eth0:0
iface eth0:0 inet static
address 192.168.0.101
netmask 255.255.255.0
network 192.168.0.0
broadcast 192.168.0.255
gateway 192.168.0.1

Then Restart the network

/etc/init.d/newtorking restart

Edit /etc/resolv.conf to add nameservers -- substitute your name server addresses:

joe /etc/resolv.conf

search server
nameserver 216.47.224.66
nameserver 216.47.224.68
nameserver 207.217.77.82
nameserver 207.217.120.82
nameserver 207.217.126.81

Edit /etc/hosts and add your new IP address

joe /etc/hosts

127.0.0.1       localhost.localdomain   localhost       server1
192.168.0.100 server1.example.com server1
192.168.0.101 virtual-ip1.example.com virtual-ip1

# The following lines are desirable for IPv6 capable hosts
::1 ip6-localhost ip6-loopback
fe00::0 ip6-localnet
ff00::0 ip6-mcastprefix
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters
ff02::3 ip6-allhosts

Set the host name

echo server1.example.com > /etc/hostname
/bin/hostname -f /etc/hostname

Install some software we will need later on and remove some packages we do not need

apt-get install wget bzip2 rdate fetchmail libdb3++-dev unzip zip ncftp xlispstat libarchive-zip-perl zlib1g-dev libpopt-dev nmap openssl lynx fileutils
apt-get remove lpr nfs-common portmap pidentd pcmcia-cs pppoe pppoeconf ppp pppconfig

Update services started by inetd

update-rc.d -f exim remove
update-inetd --remove daytime
update-inetd --remove telnet
update-inetd --remove time
update-inetd --remove finger
update-inetd --remove talk
update-inetd --remove ntalk
update-inetd --remove ftp
/etc/init.d/inetd reload

Share this page:

1 Comment(s)

Add comment

Comments

From: Ka1N

/bin/hostname -f /etc/hostname

 should be

/bin/hostname -F /etc/hostname

... with a capital F