Ubuntu: Difference between revisions

From vwiki
Jump to navigation Jump to search
m (→‎Change IP Address: Correction)
(→‎Initial Setup: Added OS Install, Post OS Install etc)
Line 1: Line 1:
== Initial Setup ==
== Initial Setup ==
Much of this section is ''borrowed'' from http://www.howtoforge.com/perfect-server-ubuntu8.04-lts, its well worth a read!
Much of this section is ''borrowed'' from http://www.howtoforge.com/perfect-server-ubuntu8.04-lts and http://www.howtoforge.com/how-to-install-ubuntu8.04-with-software-raid1, they are well worth a read!
=== Enable Root ===
 
* Use the command <code> sudo passwd root </code>
This section will create a Ubuntu VM installed on one partition, software RAID'ed across two VMDK's (my ESX's storage isn't resilient, hence the software RAID across VMDK's on separate physical disks, if you've got resilient storage you should '''not''' use software RAID).
* Enter a strong password when requested
 
=== Prepare Virtual Machine ===
# Create a virtual machine with the following options (use Custom)
#* Guest OS: Linux > Ubuntu 32bit
#* CPU: 1
#* Memory: 756 MB
#* Disk: 36GB
# Then add a second 36GB disk on a separate physical datastore (if you intend to use software RAID)
# Attach Ubuntu install ISO to the CD-ROM
 
=== OS Installation ===
Follow the default or sensible choices for your locale, however, use the following notes as well...
* '''Configure the network'''
** Enter the server's hostname (not a FQDN, just the hostname)
* '''Partition Disks'''
** If setting up software RAID follow the steps below, otherwise just select "Guided - use entire disk and set up LVM"
**# Select "Manual"
**# Select the first disk (<code>sda</code>) and on the next screen, Yes, to "Create new empty partition table on this device?"
**# Select the FREE SPACE, then "Create a new Partition", use all but the last 2GB of space, and select "Primary"
**# Change ''Use as'' to "physical volume for RAID", and change the ''Bootable flag'' to "Yes", the select "Done setting up this partition
**# Select the remaining FREE SPACE on <code>sda</code>, and create another primary "physical volume for RAID", but '''not''' bootable
**# Select the second disk (sdb) and repeat the steps taken for sda
**# On the same screen, select the "Configure Software RAID" option, and then confirm
**# Select "Create MD device", then select "RAID1" (ie a mirror), then select 2 ''Active devices'', and 0 ''Spare devices''
**# Select both <code>/dev/sda1</code> and <code>/dev/sdb1</code> partitions, and then select "Finish"
**# Repeat to create a RAID volume using <code>/dev/sda2</code> and <code>/dev/sdb2</code> partitions
**# Now select the RAID device #0 partition (select the #1 just under RAID1 device line), and change the ''Use as'' and select "Ext3..."
**# Change the ''Mount point'' to /, then select "Done configuring this partition"
**# Now select the RAID device #1 partition (select the #1 just under RAID1 device line), and change the ''Use as'' and select "Swap area"
**# Then select "Done configuring this partition" then finally "Finish partitioning and write changes to disk", and confirm
**# Accept the "system will need to restart" complaints, after which the install will continue (note there's a little more to do more to do post install).
* '''Software Selection'''
** DNS Server - Required in order to configure split DNS, which is required for an exchange server
** OpenSSH Server - Required (allows you to Putty/SSH to the server)
 
 
=== Post OS Install Config ===
* '''Enable Root'''
*# Use the command <code> sudo passwd root </code>
*# Enter user password, and then a strong password for the root account
* '''Finish Software RAID config''' - only if configured during install
*# Start-up grub (by entering <code> grub </code> and enter the following commands...
*#* <code> device (hd1) /dev/sdb </code>
*#* <code> root (hd1,0) </code>
*#* <code> setup (hd1) </code>
*#* <code> quit </code>
*# Then edit the <code> /boot/grub/menu.lst </code> config file.  Go to the end of the file where the boot options are, and create a copy of the first option and edit the following lines
*#* <code> title </code> Add "Primary disk fail" or something similar to end
*#* <code> root </code> Change <code> hd0 </code> to <code> hd1 </code>
 


=== Change IP Address ===
=== Change IP Address ===

Revision as of 20:15, 20 February 2010

Initial Setup

Much of this section is borrowed from http://www.howtoforge.com/perfect-server-ubuntu8.04-lts and http://www.howtoforge.com/how-to-install-ubuntu8.04-with-software-raid1, they are well worth a read!

This section will create a Ubuntu VM installed on one partition, software RAID'ed across two VMDK's (my ESX's storage isn't resilient, hence the software RAID across VMDK's on separate physical disks, if you've got resilient storage you should not use software RAID).

Prepare Virtual Machine

  1. Create a virtual machine with the following options (use Custom)
    • Guest OS: Linux > Ubuntu 32bit
    • CPU: 1
    • Memory: 756 MB
    • Disk: 36GB
  2. Then add a second 36GB disk on a separate physical datastore (if you intend to use software RAID)
  3. Attach Ubuntu install ISO to the CD-ROM

OS Installation

Follow the default or sensible choices for your locale, however, use the following notes as well...

  • Configure the network
    • Enter the server's hostname (not a FQDN, just the hostname)
  • Partition Disks
    • If setting up software RAID follow the steps below, otherwise just select "Guided - use entire disk and set up LVM"
      1. Select "Manual"
      2. Select the first disk (sda) and on the next screen, Yes, to "Create new empty partition table on this device?"
      3. Select the FREE SPACE, then "Create a new Partition", use all but the last 2GB of space, and select "Primary"
      4. Change Use as to "physical volume for RAID", and change the Bootable flag to "Yes", the select "Done setting up this partition
      5. Select the remaining FREE SPACE on sda, and create another primary "physical volume for RAID", but not bootable
      6. Select the second disk (sdb) and repeat the steps taken for sda
      7. On the same screen, select the "Configure Software RAID" option, and then confirm
      8. Select "Create MD device", then select "RAID1" (ie a mirror), then select 2 Active devices, and 0 Spare devices
      9. Select both /dev/sda1 and /dev/sdb1 partitions, and then select "Finish"
      10. Repeat to create a RAID volume using /dev/sda2 and /dev/sdb2 partitions
      11. Now select the RAID device #0 partition (select the #1 just under RAID1 device line), and change the Use as and select "Ext3..."
      12. Change the Mount point to /, then select "Done configuring this partition"
      13. Now select the RAID device #1 partition (select the #1 just under RAID1 device line), and change the Use as and select "Swap area"
      14. Then select "Done configuring this partition" then finally "Finish partitioning and write changes to disk", and confirm
      15. Accept the "system will need to restart" complaints, after which the install will continue (note there's a little more to do more to do post install).
  • Software Selection
    • DNS Server - Required in order to configure split DNS, which is required for an exchange server
    • OpenSSH Server - Required (allows you to Putty/SSH to the server)


Post OS Install Config

  • Enable Root
    1. Use the command sudo passwd root
    2. Enter user password, and then a strong password for the root account
  • Finish Software RAID config - only if configured during install
    1. Start-up grub (by entering grub and enter the following commands...
      • device (hd1) /dev/sdb
      • root (hd1,0)
      • setup (hd1)
      • quit
    2. Then edit the /boot/grub/menu.lst config file. Go to the end of the file where the boot options are, and create a copy of the first option and edit the following lines
      • title Add "Primary disk fail" or something similar to end
      • root Change hd0 to hd1


Change IP Address

  • Edit the /etc/network/interfaces file in the following fashion
# The primary network interface
auto eth0
iface eth0 inet static
        address 192.168.1.150
        netmask 255.255.255.0
        network 192.168.1.1
        broadcast 192.168.1.255
        gateway 192.168.1.1
  • Then check the DNS config file /etc/hosts , so that the IP v4 part looks like...
127.0.0.1       localhost
192.168.10.210  mail.home.int   mail
  • Then restart networking
    • sudo /etc/init.d/networking restart

Update the OS

  • Run the following command to update the apt package database
    • apt-get update
  • To install any updates
    • apt-get upgrade

Exchange Server

DNS Records

Firstly, you need to own a public domain name, then get your ISP to create two DNS records...

  1. MX record - Mail Exchanger (MX) record
    • EG sandfordit.com [MX] -> mail.sandfordit.com
    • sandfordit.com is the domain you own, and mail is hostname of your email server (can be anything you like)
  2. A record - Standard DNS record
    • EG mail.sandfordit.com [A] -> 158.25.34.124
    • 158.25.34.124 is the static IP address assigned by your ISP. You'll need to set-up a NAT on your router (often oddly called a virtual server in domestic routers) to map incoming mail on TCP 25 to your email server's actual address (EG 158.25.34.124:25 -> 192.168.10.100:25 .

Zimba Install

Reference http://wiki.zimbra.com/index.php?title=Ubuntu_8.04_LTS_Server_%28Hardy_Heron%29_Install_Guide

  1. Copy the install to the server
    • EG pscp C:\Users\Simon\Downloads\zcs-6.0.5_GA_2213.UBUNTU8.20100202225756.tgz simons@mail:zcs-6.0.5_GA_2213.UBUNTU8.20100202225756.tgz
  2. Uncompress the package
    • tar -xzf zcs-6.0.5_GA_2213.UBUNTU8.20100202225756.tgz
  3. Start the install
    • ./install.sh
    • The install will fail due to missing packages!
  4. Install the missing prerequisite packages
    • EG apt-get install libpcre3 libgmp3c2 libstdc++5 sysstat
  5. Restart the install