Installing on Mini-Box: Difference between revisions

From IHRIS Wiki
Line 19: Line 19:


==Mail Server==
==Mail Server==
We don't want our box to be the general mail server for the network.  There is a mail server, postfix, installed by default on Ubuntu  We will want to set the mail server to relay email to some other place. Here are some instructions for forwarding to a [http://ubuntu-tutorials.com/tag/relayhost/ gmail accout].  First we need to do:
We don't want our box to be the general mail server for the network.  There is a mail server, postfix, installed by default on Ubuntu  We will want to set the mail server to relay email to some other place.   First we need to do:
  sudo apt-get install postfix
  sudo apt-get install postfix
Then select
Then select
Line 26: Line 26:
   smtp.somewhere.org  //your smtp server to relay mail to
   smtp.somewhere.org  //your smtp server to relay mail to
This assumes that smtp.somewhere.org is an '''open''' relay.
This assumes that smtp.somewhere.org is an '''open''' relay.
As an ''alternative'' here are some  instructions for forwarding to a [http://ubuntu-tutorials.com/tag/relayhost/ gmail accout].


==LAMP Server==
==LAMP Server==

Revision as of 09:58, 5 February 2009

These are installation notes for getting the mini-box LCD appliance up and running with Ubuntu Server 32-bit 8.10 (Intrepid) wth an Atom processor and making use of the menuing system.

Ubuntu

Although we will intend to run this box without a monitor for the moment we will plug in the monitor to install Ubuntu from a USB-CDROM. Make sure the BIOS is configured to boot from the CD-ROM. Also, under Peripheral Devices you will need to enable all legacy support (or it will hang on installation).

For a flash drive, apparently Josh has had some success following these directions.

We will do a Software Raid. Once it has been setup, we need to monitor it using mdadm: To do this:

sudo dpkg-reconfigure mdadm

Please enter the following:

 Yes: periodic, monthly checks of the array
 Yes: MD monitoring daemon
 someone@somwhere.org:  Email address for monitoring
 Yes: Start with degraded array

Mail Server

We don't want our box to be the general mail server for the network. There is a mail server, postfix, installed by default on Ubuntu We will want to set the mail server to relay email to some other place. First we need to do:

sudo apt-get install postfix

Then select

 Satellite System     //the type of system
 somewhere.org        //the name of your organization
 smtp.somewhere.org   //your smtp server to relay mail to

This assumes that smtp.somewhere.org is an open relay.

As an alternative here are some instructions for forwarding to a gmail accout.

LAMP Server

In case you forgot to install the LAMP server on Unbuntu installation, make sure you do a

sudo apt-get install openssh-server^
sudo apt-get install lamp-server^
sudo apt-get install php5-cli

and generally follow the instructions:

http://wiki.ihris.org/wiki/Linux_(Ubuntu)_Installation

If you don't want to install phpmyadmin just to create the needed database you can do:

mysql -u root -p
mysql> CREATE DATABASE ihris_manage;
mysql> GRANT ALL PRIVILEGES ON ihris_manage.* TO ihris_manage@localhost identified by 'PASSS';

USBLCD Reader

Download and build the SDK or at least just what it includes usblcd-src. Install 'usbread' into the /home/lcdmenu/bin. To build it you will first need:

sudo apt-get install autoconf gcc-4.1-base gcc-4.1 gcc  automake binutils binutils-dev libtool libusb-dev libhid-dev

Unpack and change to the src a

./autogen.sh
./configure

replace the 'src/main.c' with the 'main.c' provided in LCDMenu from launchpad (see below).

 sudo make install

on some machine, you will need to copy the *usb* files in /usr/local/lib as well as /usr/local/bin/usblcd to /usr/local/bin/usblcd2

LCD Menu

First create a user 'lcdmenu' that can't login:

 sudo adduser --disabled-login --gecos \'\' lcdmenu 

(those quotes should not be slashed)

This applies to LCD Menu 1.0 which is not packaged yet. Download it in whatever way makes you happy and install it to /home/lcdmenu/bin (once you have made the directory).

Now edit the "sudoers" file by running:

sudo visudo 

and add this line to grant the lcdmenu user limited access to system functions

%lcdmenu ALL=NOPASSWD: /sbin/shutdown, /etc/init.d/apache2, /etc/init.d/mysql, /usr/bin/mysqldump, /usr/bin/apt-get, /usr/local/bin/usblcd2

Create a "backup" user in mysql with localhost only access and no password which can lock and select all tables

  mysql -u root -p
  mysql> GRANT SELECT,LOCK TABLES on *.* TO backup@localhost IDENTIFIED BY PASSWORD \'\';
  mysql> quit;

(again no slashes)

Now we want it to setup to run periodically:

sudo crontab -u lcdmenu -e 
* * * * * /home/lcdmenu/bin/lcdmenu_check.sh >/dev/null 2>&1

Automount

The LCD Menuing system has a "backup MySQL database to a flash drive" feature. Since we will not be using GNOME, we will need a USB automounter:

  sudo apt-get install usbmount

Then edit the file /etc/usbmount/usbmount.conf and add "vfat" to the FILESYSTEMS e.g:

   FILESYSTEMS="ext2 ext3 vfat"

then make sure the FS_MOUNTOPTIONS line has at least:

   FS_MOUNTOPTIONS="gid=lcdmenu,dmask=0007,fmask=0117"

Power Button

Make sure acpid is installed and running and change /etc/acpi/powerbtn.sh to suit your needs.

UPS

Install nut and follow these directions as well as whatever is available on the home page of the nut package. nut is built for network access to a UPS but seems to be the most up-to-date package available.

Network Status

The MAC Address, to configure your router, can be obtained from the LCD Menu:

>F1:Server Status
>F2:Network Status
>F3:MAC Address

Similarly, if you have plugged the server into a network with DHCP, you can get the IP Address:

>F1:Server Status
>F2:Network Status
>F3:MAC Address

Webmin

See me or just cut and paste:

sudo aptitude install perl libnet-ssleay-perl openssl libauthen-pam-perl libpam-runtime libio-pty-perl libmd5-perl
wget http://garr.dl.sourceforge.net/sourceforge/webadmin/webmin_1.441_all.deb
sudo dpkg -i webmin_1.441_all.deb

Browse to:

https://your-server-ip:10000/

and login as the user you created on Ubuntu installation.