Tools

Access to the phpMyAdmin, go to http://<your ip>/phpmyadmin, you can find the IP address of the VM by typing into the shell sithelp after having logged on.

For remote access we've added OpenSSH to the server. You can use the free tool PuTTY to access the box.

Notes

The VM image is a fully installed Ubuntu Server 10.04 with PHP, MySQL and Apache.

As a default on Ubuntu the root user is not active, so you have to type in sudo before any administrative command, and type in the sit users password which is sit. This is per design for security reasons, but you can activate the root user if you want, by typing sudo passwd root and give the root user a password.

Depending on release dates, the OS will be upgraded when a new version is out and a new version of SiT! is released.

Using VM as test platform

You can use the VM to make a testing environment for your production servers.
This is written for the inexperienced linux user, if you know how to copy data between 2 computers, you can skip down to the section "implementing your backup"

Required Prerequisites

A backup of your Sit Database and webfolder

Recommended Prerequisites

For Linux Desktop : krusader (on most Linux desktop dists this can be installed from its repository)

Copying your data to the VM

Krusader

Using krusader (Linux/Unix) select the window you want to have as the VM window (just click in either left or right), from the menu in the top, click Tools --> New net connection. Alternatively press CTRL-N.
Select sftp from the protocol, enter into the address field the IP address of the VM server. Username = sit and password = sit, unless you've changed it.

WinSCP

After installing WinSCP on your Windows computer, which is almost clicking next, next, next. Enter in the first screen the IP address, username and password, if you want to save the setting, do so. click Login.

For the WinSCP the default local window is the left one, and the remote is the right one.

There is no default for which is which in the Krusader.

Find and mark your backed up files in the source/local window, start the copy by pressing F5, after a short time the backup is copied to the VM.

If you didn't change directoried on the remote computer, the backup is stored in the /home/sit folder on the VM

Restoring your data to the VM

Copy the contents of your backed up webfolder into /var/www (you can use mc which is a Norton Commander clone), do this with root privileges

sudo mc

now you can copy from one window to the other, hint: you can select all files (files only) by pressing the * key on your numeric keypad, selecting files and folders otherwise, use the insert key.

import the SQL database

mysql -u sit -psit sit < yyyy-mm-dd-backup.sql

replace yyyy-mm-dd-backup.sql with your sql database name. If you've changed the username and/or password for the sit database then replace those aswell.

now you are ready to do some testing :-)

Using VM as a production platform

The VM can run as a production server.

Configuring the production server

To turn the VM into a production server, all you need to do is run the shellscript

sitproduction

and answer the questions / fill out the blanks.

Some of the questions you'll be asked is to change the SQL servers root password, the sit users password, change IP etc.

Configuring the mailserver

During the process of making the VM into a production server you'll be asked to configure the mailserver, you'll be given some options you need to fill out, if you are in doubt you should ask your administrator.

if you don't want to use mail other than to send mails from SiT, or if you are in doubt you should set

Configuring LOCALE

This step gives you the ability to change LOCALE and keyboard settings.

Read the FAQ below on how to setup the LOCALE

For the rest of the settings; if you don't have any specified needs or are in doubt, just hit enter.

Backup/Restore

or backup and restore 2 scripts exists, sitbackup and sitrestore you'll need to modify these to fit your settings.
the sitrestore script is not compatible with the tms_backup plugin when you are going to move SiT from one server to the other, where paths are different, i.e. from FreeBSD to the VM.

Database moving

You can move the database to another drive, but adding an additional to the VM while it's offline (newer versions of VM might be able to do this online).

Add a new Disk

This guide is based on the VMWare Player v3, other versions might differ.

To add a new disk in VM, first take the VM offline, by shutting down the VM.

Go to the interface, and right click on SiT_v3.62 (or what the machine is called) and click Virtual Machine settings...

Click the Add... in the Hardware pane (If you get a windows security popup here, click accept/yes)

Choose Hard Disk and click Next

Make sure Create a new virtual disk is selected (Advanced users may choose otherwise) and click Next

Choose SCSI and click Next

Choose your size of disk, I'll be choosing 20GB for this example, click next if the rest looks good to you.

Choose a name for it so you can identify the disk later, my choice will be "SiT_v3.62_DB.vmdk" and click finish.

Click OK to get back to the main screen, and turn on the SiT VM

Prepare the new disk in ubuntu

Figure out what the new disk is called

sudo fdisk -l

It should tell you:

Disk /dev/sdc doesn't contain a valid partition table

Partition the new disk

sudo fdisk /dev/sdc

n # New partition

p # Primary partition

1 # First partition number

<enter> # Choose first cylinder. default 1

<enter> # Choose last cylinder. default 2610 for my 20GB disk in this example. This will differ depending on your own size

t # Change the type of partition

8e # Choose the Linux LVM

p # Display the chosen settings

w # Write the drive settings

Create the LVM partition

sudo pvcreate /dev/sdc1

Create the VolumeGroup named "database"

sudo vgcreate database /dev/sdc1

Create the LVM partition named "mydatabase" in the volumegroup "database", with size almost 20GB

sudo lvcreate -L19.99G -n mydatabase database

Format the new drive with ext4 filesystem

sudo mkfs.ext4 /dev/database/mydatabase

Create a new directory that serves as a mountpoint for the new drive

sudo mkdir /var/lib/mydatabase

Mount the disk to the newly created mountpoint, and check that it's mounted

sudo mount /dev/database/mydatabase /var/lib/mydatabase
sudo mount

You should now see a line saying : /dev/mapper/database-mydatabase on /var/lib/mydatabase type ext4 (rw)

Edit fstab so this mount will happen in every boot

sudo nano /etc/fstab

Go to the bottom, if it's a blank line start typing, if not go to the end of the current line and hit the enter key.

/dev/database/mydatabase /var/lib/mydatabase ext4 rw 0 1

Hold down CTRL while pressing the X key, answer y and hit enter this will save and exit

Reboot and see if the drive automounts

sudo reboot

Login

Check if it's mounted

sudo mount

Now you can start moving the database

Move the Database to the new disk

Stop the mysql server

# sudo stop mysql

edit the mysql config file

# sudo nano /etc/mysql/my.cn

Find the datadir (CTRL-W and search for datadir)

datadir = /var/lib/mysql

Set it to

datadir = /var/lib/mydatabase/mysql

Create a new directory to store the databases

sudo mkdir /var/lib/mydatabase/mysql

move /var/lib/mysql to your new path

sudo mv /var/lib/mysql /var/lib/mydatabase/mysql

check if the mysql folder is owned by mysql:mysql, else do a

# sudo chown -R mysql:mysql /newpath/mysql

If you haven't uninstalled apparmor you'll need to edit the protection there too

Start by shutting down apparmor

# sudo /etc/init.d/apparmor stop

Edit the apparmor config file for mysql

edit the lines that say /var/lib/mysql change to /var/lib/mydatabase/mysql (there should be 2)

# sudo nano /etc/apparmor.d/usr.sbin.mysql

Start apparmor

# sudo /etc/init.d/apparmor start

start the mysql server again

# sudo start mysql

If the MySQL server doesn't seem to start, try rebooting the VM

Expanding disk

This is a step by step guide that works with partitions, so be very careful, and keep in mind that though this is a guide and it's been tested, it's not guaranteed that it'll work on your system, (make a backup of your VM just to be safe).

This guide will only show how to expand the original 60GB disk where the SiT website + attachments are stored.

In this example I'll upgrade the drive to 80GB. I've typed in 80GB in the VM player editing the Hard Disk 2, see how below

Expanding the logical disk in VM

First you need to make the logical disk larger through the VM, this is done like this (guide from VMWare Player).

Start VMware Player

Right click the SiT VM SiT_V3.62 and click Virtual Machine Settings

Left click Hard Disk 2 and you'll see some options to the right side of the window.

Click the button Utilities and click Expand...

Enter the new size and click Expand (I've written 80GB for this example)

Click OK and start the SiT VM

Expanding the drive in Ubuntu

First of all, Make sure that you've backed up all the data from /var/www

Start by checking that the OS actually sees the new size.

sudo fdisk -l

Alot of text is output, but I see on one of the lines

Disk /dev/sdb 85.9 GB, 85899345920 bytes

Start by unmounting the extended drive

sudo umount /var/www

Delete the partition and remake it again (all data should still be there when done)

Pros and Cons

Here I'll write some pro's and cons in using a barebone server compared to the VM Server

This article (or section) needs work.

Please help us and our readers by clicking the edit link above and expanding/improving this text.

VMware

Linux/BSD/MAC

Windows IIS

Windows XAMPP/WAMP etc

Fast and easy to setup

Download VM Player/Server and start

Install some applications first

Work alot to get php5 to run properly

Install the AMP package

Ready to run with minimal configuration

Start the VM

Default Config needed

Default Config needed

Default Config needed

Knowledge of Linux/BSD shell required

Yes, very little

*MAC excluded - Yes

No

No

Knowledge of Windows/IIS required

No

No

Yes

Yes (IIS Excluded)

Support from SiT Core team

Yes, and Ubuntu community

Yes

Very little/forum

Very little/forum

Pricing / Total Cost of Ownership

Free and no additional hardware*

Free + Hardware

Windows Server license / $399-$999 + Hardware

Windows Server license / $399-$999 + Hardware

(*) If implementing into a server that already runs other VM's

FAQ

How do I change the Keyboard settings

To reconfigure your keyboard settings to your own LOCALE

sudo dpkg-reconfigure console-setup

How do I change the TimeZone

Change TimeZone

sudo dpkg-reconfigure tzdata

Then follow the instructions on the Timezone page to configure SiT! properly.

Help, lost the root password for MySQL

sudo dpkg-reconfigure mysql-server-5.1

How do I configure the mailserver

sudo dpkg-reconfigure postfix

Follow the guide (you should probably choose "Internet" when asked)

I have network problems

I don't get an IP address or it doesn't show. My networking is broken.

When moving the VM from the VMware player to VMware server there might be some network problems, i.e. no IP address.
We've made a small script that fixes that.

sudo fixnetwork

Bugs

If you want to report bugs regarding the VM / Installation itself (not the SiT application), you can do so by going to our mantis bugtracker choose VM in the project pulldown menu.

and report a bug there.

Disclaimer

The VM represents two products, SiT! and Ubuntu. If you have problems with anything other than SiT!, you should look at the Ubuntu forums for answer.
We only support the SiT! software on the VM, Ubuntu is supported elsewhere.
You can ask for Ubuntu help in the SiT! forums, but chances are that you get better answers regarding Ubuntu in their forums.