K-Box Installation and Configuration Guide

This document contains the installation guide, configuration guide and administration guide of K-Box server.
[Operating System Installation]
The procedures below show how to install K-Box.
1. Install Edubuntu 8.04 Classroom Server
Download Edubuntu from https://wiki.edubuntu.org/HardyClassroomServer or get the CD Images in K-Box DVD.
"In order to install an Edubuntu 8.04 Classroom Server, you will need the following two CDs
   - Get the Ubuntu 8.04 Alternate CD - Don't forget to select the checkbox for the alternate desktop CD on the download page!
   - Get the Ubuntu 8.04 educational add-on CD
See the detailed installation instructions for Edubuntu 8.04 LTSP Classroom Server.(https://wiki.edubuntu.org/HardyClassroomServer)"

Prototype Partition - 100G HD
/ 		 4.5G	# operating system
/var		 2.5G	# system logs
/data 		42.5G	# apache document root and web content
/backup		42.5G	# local backup storage
swap		 1.5G

2. Install required servers and applications
Login Edubuntu Desktop GUI
Go to "System"->"Administration"->"Snaptic Package Manager"
Coose "Networking" and click on
	"bind9"
	"dhcp3-server"
	"samba"
Choose "World Wide Web" and click on 
	"apache2"
	"libapache2-mod-auth-mysql"
	"libapache2-mod-php5"
	"php5"
	"php5-gd"
	"php5-mysql"
Then, insert Edubuntu CD and click on "Apply" to install packages.

All required packages can also be found in kbox-packages.tgz.
It can be extracted by using the command below.
#tar zxvf kbox-1.0-packages.tgz

3. Import database
Login MySQL and create beehive database and user
# mysql -p
mysql> create database beehive;
mysql> grant all on beehive.* to 'beehive'@'localhost' identified by '123456';

Extract kbox_database.sql.gz
#gzip -d kbox_database.sql.gz

Dump database schema and data into beehive database from shell
# mysql -p -h localhost beehive < kbox_database.sql

4. Restore data and backup script from DVD-ROM
# tar zxf /cdrom/kbox-1.0-www.tar.gz /data
# tar zxf /cdrom/kbox-1.0-web-00.tar.gz /data
# tar zxf /cdrom/kbox-1.0-web-01.tar.gz /data
# cp /cdrom/backup/content_backup.sh /data
# chmod 744 /data/content_backup.sh

[DNS Configuration]
1. Stop DNS server
# /etc/init.d/bind9 stop
2. Append the zone below to /etc/bind/named.conf.local
zone "mit.edu" {
        type master;
        file "/etc/bind/db.beehive";
};


3. Create /etc/bind/db.behive and add the content below
;
; BIND data file for beehive.mit.edu
;
$TTL	604800
mit.edu.	IN	SOA	dns.mit.edu. admin.mit.edu. (
		     2008050101		; Serial
			 604800		; Refresh
			  86400		; Retry
			2419200		; Expire
			 604800 )	; Negative Cache TTL
;
mit.edu.	IN	NS	dns.mit.edu.

beehive	IN	A	192.168.1.1
www	IN	CNAME	beehive	

4. Start DNS server
# /etc/init.d/bind9 start


[DHCP Configuration]
1. Stop DHCP server
# /etc/init.d/dhcp3-server stop

2. Mobidy /etc/dhcp3/dhcpd.conf
2.1 Comment the two settings below.
#default-lease-time 600;
#max-lease-time 7200;

2.2 Add subnet setting
subnet 192.168.1.0 netmask 255.255.255.0 {
  range 192.168.1.2 192.168.1.99;
  option domain-name-servers 192.168.1.1;
  option domain-name "mit.edu";
  option routers 192.168.1.1;
  option broadcast-address 192.168.1.255;
  default-lease-time 600;
  max-lease-time 7200;
}
3. Start DHCP server
# /etc/init.d/dhcp3-server start


[Apache Configuration]
1. Change ServerAdmin email address and DocumentRoot in /etc/apache2/sites-available

        ServerAdmin beehive@mit.edu

        DocumentRoot /data/www/
        
                Options FollowSymLinks
                AllowOverride None
        
        
                Options Indexes FollowSymLinks MultiViews
                AllowOverride None
                Order allow,deny
                allow from all
        


2. Add alias for web content directory in /etc/apache2/apache2.conf

    Alias /web/ "/data/web/"

    
        AllowOverride None
        Order allow,deny
        Allow from all


[Backup Configuration]
To set up the biweekly backup for web content. Login as root and execute the command below.
1. Set editor as vi
# export EDITOR=vi

2. Configure scheduler
# crontab -e

3. Paste the line to vi(press 'i' to enter insert mode) and then save it ('Esc'->':wq'). Backup will be executed at 12pm on every 1st and 16th day of the month.
1 12 1,16 * * /data/content_backup.sh >/dev/null 2>&1

[File Sharing Configuration]
1. Add web settings to /etc/samba/smb.conf
[web]
   comment = Internet Content
   read only = yes
   path = /data/web
   guest ok = no

2. Restart Samba server
# /etc/init.d/samba restart

3. Add new file sharing account
# smbpasswd -a 

[Forum Administrator Account]
Default Administration account/password: faculty1/123456

[Administration Guide]
1. Add new website
	Access local forum on http://localhost/beehive
	Login as faculty1
	Click on "Administration Control Panel" and select "Maintenance"
	Click on "System Administration"
	Click on "Add New Website"
	Enter "Web URL", "Description" and choose "Category"
	Click on "Browse" to select folder which contain new websites
	Click on "submit" and wait till the file transferring is done(This may take 5 to 60 minutes, depending on the size of new webistes)
	
2. Check disk information
	Access local forum on http://localhost/beehive
	Login as faculty1
	Enter "Administration Control Panel" and select "Maintenance"
	Click on "System Administration"
	Click on "Disk Information"
	If disk space is insufficient, "% used space" will be red, and instruction will be displayed.


				MIT Beehive Team
				beehive@mit.edu