Make a Web Server, Under 100 Dollars

I am going to show you how to Create a Web Server using an awesome technology called Plug Computing This website is powered byWordpress and a Ubuntu LAMP server. I built it using a Marvell Sheeva plug.

Plug Computing is a new term coined by Marvell to describe a new form of server. The idea behind plug computing is to have a small, low power, always on server that connects to the local network and provides the user access to central services. To promote the new concept, Marvell created the SheevaPlug development kit. The “computer” itself is housed in a 4″x2.5″x2″ wall wart that plugs directly into any typical household AC outlet. The SheevaPlug was built with the following hardware:

  • Kirkwood series SoC with an embedded Marvell Sheeva (88F6281) CPU core running at 1.2Ghz.
  • 512 Mbytes of DDR2 memory.
  • 512 Mbytes of NAND Flash memory use for system boot and the OS filesystem.
  • USB 2.0 (480Mbps) running as HOST.
  • Gigabit ethernet connection to the cpu.
  • SDIO interface capable of using SDHC type SD memory cards.
  • Dual serial port for JTAG interface (used by openOCD and OS serial output)

The Sheeva Plug development kit comes with the following software and documentation:

  • U-Boot
  • Linux Support Package (LSP)
  • Ubuntu and Gentoo File System
  • Host Software Support Package for Linux and Windows
  • Schematics & Bill of Materials

The product brief is available here.

This is what I did:

I added an 8GB SD Chip formatted as swap space.

I also added a 20GB Jump Drive that I setup in the FSTAB to mount as /var/www/

There are a few ways of connecting to this device, you can connect via a Serial Connection or SSH

I plugged the machine into my network and it received its IP via DHCP

I could have logged into the router to see what IP it received but instead I ran this command

bebe@genesis:~$ sudo arp-scan -l

arp-scan is a command-line tool that uses the ARP protocol to discover and fingerprint IP hosts on the local network.

Once the scan provided me with an IP address I fired up putty and logged in.

the first command I ran was

bebe@genesis:~$ sudo tasksel install lamp-server

Your machine is now a LAMP server.

Now itś time to setup Virtual Host so you can run multiple sites from the one Plug

Apache2 has the concept of sites, which are separate configuration files that Apache2 will read. These are available in /etc/apache2/sites-available. By default, there is one site available called default this is what you will see when you browse to http://localhost or You can have many different site configurations available, and activate only those that you need.

As an example, we want the default site to be /home/user/public_html/. To do this, we must create a new site and then enable it in Apache2.

To create a new site:

  • Copy the default website as a starting point. sudo cp /etc/apache2/sites-available/default /etc/apache2/sites-available/mysite
  • Edit the new configuration file in a text editor “sudo nano” on the command line or “gksudo gedit”, for example: gksudo gedit /etc/apache2/sites-available/mysite
  • Change the DocumentRoot to point to the new location. For example, /home/user/public_html/
  • Change the Directory directive, replace <Directory /var/www/> to <Directory /home/user/public_html/>
  • You can also set separate logs for each site. To do this, change the ErrorLog and CustomLog directives. This is optional, but handy if you have many sites
  • Save the file

Now, we must deactivate the old site, and activate our new one. Ubuntu provides two small utilities that take care of this: a2ensite (apache2enable site) and a2dissite (apache2disable site).

bebe@genesis:~$ sudo a2dissite default && sudo a2ensite mysite

I also recommend

bebe@genesis:~$ sudo a2enmod mod_rewrite

Finally, we restart Apache2:

sudo /etc/init.d/apache2 restart

If you have not created /home/user/public_html/, you will receive an warning message

To test the new site, create a file in /home/user/public_html/:

echo '<b>Hello! It is working!</b>' > /home/user/public_html/index.html

Finally, browse to http://localhost/

Set mysql bind address

Before you can access the database from other computers in your network, you have to change its bind address. Note that this can be a security problem, because your database can be accessed by others computers than your own. Skip this step if the applications which require mysql are running on the same machine.


nano /etc/mysql/my.cnf

and change the line:

bind-address           = localhost

to your own internal ip address e.g.

bind-address           =

If your ip address is dynamic you can also comment out the bind-address line and it will default to your current ip.

If you try to connect without changing the bind-address you will recieve a “Can not connect to mysql error 10061”.

Set mysql root password

Before accessing the database by console you need to type:

mysql -u root

At the mysql console type:

mysql> SET PASSWORD FOR 'root'@'localhost' = PASSWORD('yourpassword');

A successful mysql command will show:

Query OK, 0 rows affected (0.00 sec)

Mysql commands can span several lines. Do not forget to end your mysql command with a semicolon.

Note: If you have already set a password for the mysql root, you will need to use:

mysql -u root -p

Create a mysql database

mysql> CREATE DATABASE database1;

Create a mysql user

For creating a new user with all privileges (use only for troubleshooting), at mysql prompt type:

mysql> GRANT ALL PRIVILEGES ON *.* TO 'yourusername'@'localhost' IDENTIFIED BY 'yourpassword' WITH GRANT OPTION;

For creating a new user with fewer privileges (should work for most web applications) which can only use the database named “database1”, at mysql prompt type:


yourusername and yourpassword can be anything you like. database1 is the name of the database the user gets access to. localhost is the location which gets access to your database. You can change it to ‘%’ (or to hostnames or ip addresses) to allow connections from every location (or only from specific locations) to the database. Note, that this can be a security problem and should only be used for testing purposes!

To exit the mysql prompt type:

mysql> \q

Since the mysql root password is now set, if you need to use mysql again (as the mysql root), you will need to use:

mysql -u root -p

and then enter the password at the prompt.


Please, let’s say something in which directories mysql stores the database information and how to configure a backup


There is more than just one way to set the mysql root password and create a database. For example mysqladmin can be used:

mysqladmin -u root -p password yourpassword


mysqladmin -u root -p create database1

mysqladmin is a command-line tool provided by the default LAMP install.

So now you can download WordPress, Joomla, Drupal or create a site using any way you know how and place it in the /home/user/public_html/ folder
now all thatś left is to buy a domain name and point your website to your IP Address @ home and don´t forget to forward the ports on your router or modem to your switches IP..
Now you are good to go.

Set up your PS3 to run Linux

Here are some very simple instruction on getting Linux to run on your PS3

01 – Collect the items that you need for the installation.

*NOTE – It is possible to do everything up to step 5 using cut/paste within the Gento Live CD desktop with the exception of burning the Gentoo iso for obvious reasons. I would recommend reading this entire document as well as the following discussions before trying this unless you have some Linux experience.

You will need a computer with an internet connection as well as a PS3 with a hard wired internet connection

*USB Mouse
*USB Keyboard
* 256MB USB Thumb drive

(Any storage device that the PS3 can handle will work. Adjust commands accordingly)

* Addon CD iso

*Gentoo Live CD BETA for PPC iso…ppc64-beta.iso


02 – Prepare your media

Burn the Gentoo iso onto a CD. Note that you cannot burn the iso as a regular file. It must be burned as a disk image. I also recommend burning important disks like this at very slow speeds. (4x or 8x if possible) Here is a link to more information regarding iso burning.

Plug your USB storage drive into your computer and create the directory structure


In other words … create a folder called “PS3” then create a folder inside that called “OTHEROS”

Save the Otheros.self file that you downloaded in the “OTHEROS” folder

Extract the ADDON CD iso to the root of your thumb drive using 7zip or similar program. Make sure that you extract the iso so that the contents of the “CELL-Linux-CL_20061110-ADDON” folder are in the root of the USB drive.
Here is a link to a program that will help you if you cannot extract an iso

(note that there are some helpful documents in the /doc folder)

Copy otheros.bld from the new “kboot” folder on your USB drive into the “ OTHEROS” folder that we made earlier

Create another folder in the root of your USB drive called “config”

Create a file called “fstab” and copy/paste this into it. You can use notepad if you are in Windows. (If you do it in notepad, you may need to rename it to remove the file extension, You may want/need to edit your fstab file to get rid of the Windows return line characters (^M) at the end of each line … you can do this when you are in Linux with nano after you copy it over later in the guide. Another solution is to “save as” and type “fstab” with the quotes as the filename.)

# /etc/fstab: static file system information.
# file system mount point type options dump pass
LABEL=/ / ext3 defaults 0 0
LABEL=/boot /boot  ext2 defaults 0 2
LABEL=SWAP SWAP swap sw 0 0
proc /proc proc defaults 0 0
sys /sys sysfs defaults 0 0
/dev/fd0 /mnt/floppy auto noauto,rw,sync,user,exec 0 0
/dev/cdrom /mnt/cdrom iso9660 noauto,ro,user,exec 0 0
###### /etc/fstab done

Save your “fstab” file in the “config” folder that you made.

Create a file called “xorg.conf” and copy/paste this into it. You can use notepad if you are in Windows. (If you do it in notepad, you will need to rename it to change the file extension)

### PS3 xorg.conf for Ubuntu / Debian Linux

Section "Files"
    FontPath    "/usr/share/X11/fonts/misc"
    FontPath    "/usr/share/X11/fonts/cyrillic"
    FontPath    "/usr/share/X11/fonts/100dpi/:unscaled"
    FontPath    "/usr/share/X11/fonts/75dpi/:unscaled"
    FontPath    "/usr/share/X11/fonts/Type1"
    FontPath    "/usr/share/X11/fonts/100dpi"
    FontPath    "/usr/share/X11/fonts/75dpi"
    FontPath    "/usr/share/fonts/X11/misc"
    # path to defoma fonts
    FontPath    "/var/lib/defoma/x-ttcidfont-conf.d/dirs/TrueType"

Section "Module"
    Load    "bitmap"
    Load    "ddc"
    Load    "dri"
    Load    "extmod"
    Load    "freetype"
    Load    "glx"
    Load    "int10"
    Load    "type1"
    Load    "vbe"

Section "InputDevice"
    Identifier    "Generic Keyboard"
    Driver        "kbd"
    Option        "CoreKeyboard"
    Option        "XkbRules"    "xorg"
    Option        "XkbModel"    "pc105"
    Option        "XkbLayout"    "us"
    Option        "XkbOptions"    "lv3:ralt_switch"

Section "InputDevice"
    Identifier    "Configured Mouse"
    Driver        "mouse"
    Option        "CorePointer"
    Option        "Device"        "/dev/input/mice"
    Option        "Protocol"        "ExplorerPS/2"
    Option        "ZAxisMapping"        "4 5"

Section "Device"
    Identifier    "Generic Video Card"
    Driver        "fbdev"

    Option        "ShadowFB"        "false"
#    Option        "UseFBDev"        "true"

Section "Monitor"
    Identifier    "Generic Monitor"
    Option        "IgnoreEDID"
    HorizSync    30-90
    VertRefresh    20-150
    ModeLine "720p" 73.825 1280 1320 1368 1640 720 722 724 751 +hsync +vsync
    DisplaySize    320 180

Section "Screen"
    Identifier    "Default Screen"
    Device        "Generic Video Card"
    Monitor        "Generic Monitor"
    DefaultDepth    24
    DefaultFbBpp    32

    SubSection "Display"
        Viewport    0    0
        Depth        24
        FbBpp        32
        Modes        "1024x720" "1124x644"

    SubSection "Display"
        Depth        15
        Modes        "1024x720" "1024x768" "800x600" "640x480"

    SubSection "Display"
        Depth        16
        Modes        "576x384" "1024x768" "800x600" "640x480"


Section "ServerLayout"
    Identifier    "Default Layout"
    Screen        "Default Screen"
    InputDevice    "Generic Keyboard"
    InputDevice    "Configured Mouse"

Section "DRI"
    Mode    0666

Save your “xorg.conf” file in the “config” folder that you made.

Remove the USB storage drive from your computer and plug it into your PS3.
Insert the Gento Live CD into the PS3

03 – Install kboot on the PLAYSTATION 3

If you already have data saved on the PS3 hard drive, you may back it up using the PS3 backup utility and restore the data after you format and partition the hard drive. (These instructions have already changed due to PS3 firmware updates, but you should still be able to figure out what to do)

* On the XMB go into Settings Menu > System Settings > Format Drive
* Choose 10GB for the “other OS”
* After the drive is formatted, go into Settings Menu > System Settings > Install Other OS
* Click “OK” and it will install the kboot image onto your PS3.
* Once finished, go back into Settings Menu > System Settings > Default System > Choose “Other OS”
* Restart your PS3 and you should be on the kboot prompt

Now once you are on the kboot prompt you are within a minimal Linux environment.

04 – Partition and format the “Other OS” portion of the hard drive

We will partition the 10GB portion of the hard drive as follows using fdisk.
1) boot /dev/sda1 256MB ext2
2)SWAP /dev/sda2 512MB swap
3) / /dev/sda3 the remaining space ext3

We need to boot into Gentoo to do this since the Kboot environment does not support the creation of swap partitions. (If you have some experience with Linux, you may want to take care of the root and boot partitions now and worry about the swap partition after you can chroot into Ubuntu. If so, you can do this from the kboot prompt rather than booting the Live CD)

Use the <tab> key to select your screen resolution and press <enter>. Gentoo will boot up. This takes a while since the entire operating system is booting from the CD. You should be looking at the Gentoo desktop. (Note that you may boot into the command line by adding a space and “nox” after the resolution command.) Take it for a spin if you would like. You can install Gentoo from this disk if you like it.

Open a terminal (Alternatively, you can hit Ctrl+Alt+F1 to get to the command line as root … if you do this, you will not need the following two commands)
Click Applications>Terminal

$ sudo -s
$ /etc/init.d/xdm stop

You should now be looking at the command line.

$ cd
$ fdisk /dev/sda

At the fdisk prompt:

Create partition 1

N (new) <enter>
P (primary) <enter>
1 <enter>
(default) <enter>
256 <enter>

Create partition 2

N (new) <enter>
P (primary) <enter>
2 <enter>
(default) <enter>
769 <enter>

Create partition 3

N (new) <enter>
P (primary) <enter>
3 <enter>
(default) <enter>
(default) <enter>

Mark partition 1 with the boot flag

A <enter>
1 <enter>

Label Partition 2 as a swap file system

T <enter>
2 <enter>
82 <enter>

Write the partition table

W <enter>

This part is extremely important … reboot the PS3 at this point. I wasted about 3 hours trying to get this to work until I realized that the newly created partitions needed a reboot to be recognized.

$ reboot

This will shutdown Gentoo and reboot the PS3. It should automatically boot into Kboot.
<tab> to select your resolution and press <enter> to boot the Live CD again. (Remember we can type “nox” at the end to boot straight to the command line.)

Open a terminal
Click Applications>Terminal

$ sudo -s
$ /etc/init.d/xdm stop

You should now be looking at the command line again.
Now we will need to create a filesystem on our partitions and then mount them. The “-L” option adds a label to the partitions.

$ mkfs.ext2 -L "/boot" /dev/sda1
$ mkfs.ext3 -L "/" /dev/sda3
$ mkswap -L "SWAP" /dev/sda2
$ sync; sync; sync
$ swapon /dev/sda2
$ mkdir /mnt/ubuntu
$ mount /dev/sda3 /mnt/ubuntu
$ mkdir /mnt/ubuntu/boot
$ mount /dev/sda1 /mnt/ubuntu/boot

05 – Install Ubuntu on the PLAYSTATION 3

$ cd /tmp
$ wget
$ ar -xf debootstrap_0.3.3.0ubuntu7_all.deb
$ zcat < data.tar.gz | tar xv

We need to edit debootstrap since we are running it off of a Live CD

$ cd usr/sbin
$ vim debootstrap

Now you will be inside of a text editor. Use the arrow keys to go down to line 11 and over to the “/” in that line. Hit the <insert> key to go into edit mode. Add “/tmp” to the beginning of the path. Hit the <esc> key to exit editing mode. That line should look like this now.


Type “:wq” to save and quit.
You should be back at the command line now.

Run debootstrap
(If you have a slow internet connection, you can use the Ubuntu CD to install by replacing the url with “file:/mnt/cdrom/ubuntu” … note that you will need the correct CD and have it mounted at /mnt/cdrom )

$ /tmp/usr/sbin/debootstrap --arch powerpc edgy /mnt/ubuntu

This will install your base Ubuntu system.
We still need to copy a few things from the CD onto the PS3 hard drive.

$ cp /boot/* /mnt/ubuntu/boot
$ cd /mnt/ubuntu/boot
$ cp kernel-genkernel-ppc-2.6.16-ps3 /mnt/ubuntu/boot/vmlinux
$ cp initramfs-genkernel-ppc-2.6.16-ps3 /mnt/ubuntu/boot/initrd.img
$ cp -R /lib/modules/* /mnt/ubuntu/lib/modules/

Now we can reboot the PS3 and take out the Live CD since we no longer need it.

$ reboot

06 – Configuring Minimal Install of Ubuntu Base System

We will have to mount the partitions manually for now.

$ umount /mnt/root
$ mkdir /mnt/ubuntu
$ mount /dev/sda3 /mnt/ubuntu
$ mount /dev/sda1 /mnt/ubuntu/boot

Copy the “fstab” file from your USB drive. We have to mount the USB drive first. You can find the location of your USB drive by typing

$ fdisk -l

Try to locate which one your USB drive is by the size. If it says “sdd” then your drive will be recognized as “sdd1”

$ mkdir /mnt/usbdrive
$ mount /dev/sdd1 /mnt/usbdrive
$ cp /mnt/usbdrive/config/fstab /mnt/ubuntu/etc/fstab

CHROOT into ubuntu and install nano. (You can use nano to create your config files or you can create them on your computer to save some typing and then transfer them via the usb drive)

$ chroot /mnt/ubuntu /bin/bash
$ source /etc/profile
$ apt-get install nano

The above command has you in your new Ubuntu system in its infant state.

You can manually mount each filesystem once you are chrooted into your Ubuntu System, or you can automatically mount them with …

$ mount -a

The above game some errors, so make sure that both /proc and /sys were mounted. Check to see if they are mounted by seeing if there is anything in them:

$ ls /proc /sys

If /proc and /sys are not mounted then you will manually mount them like this:

$ cd /
$ mount -t proc proc proc
$ mount -t sysfs sysfs sys

07 – Installing The Xubuntu / Ubuntu / Kubuntu desktop

At this stage you have a choice of installing whatever desktop you like. You can either install the Ubuntu, Xubuntu or the Kubuntu desktop. You will want to issue one of the following commands depending on what desktop you want. (The Ubuntu desktop install had too many dependencies to resolve and eventually stopped after running out of system memory in my case. You may try it, but it would not work for me. Don’t worry though … we can install the Ubuntu desktop later … go ahead and install Kubuntu for now)

$ aptitude -y install '~txubuntu-desktop'
$ aptitude -y install '~tubuntu-desktop'
$ aptitude -y install '~tkubuntu-desktop'

Once the above is done you are finished. You have installed Ubuntu on your PS3.

08 – More Configuration and Adding Users

We need to create a username and give the user the ability to use sudo. We will go ahead and add you to the audio, admin, and users groups now also

$ passwd root
$ adduser YOUR_USER_NAME
$ addgroup --system admin
$ adduser YOUR_USER_NAME admin
$ adduser YOUR_USER_NAME audio
$ adduser YOUR_USER_NAME users
$ visudo -f /etc/sudoers

add this to the end of the file so that users in the admin group can use sudo

# Members of the admin group may gain root privileges
%admin ALL=(ALL) ALL

Configure the Keyboard

$ dpkg-reconfigure console-setup

Configure /etc/network/interfaces

$ nano /etc/network/interfaces

Make it look like this

auto lo
iface lo inet loopback

auto eth0
iface eth0 inet dhcp

configure /etc/resolv.conf

$ nano /etc/resolv.conf

Make it look like this (just an example … you will have to configure it for your internet connection) If you are running linux on another computer in your house, just look at the /etc/resolv.conf on that computer.


Edit your hostname (this can be whatever you want)

$ echo playstation > /etc/hostname

Edit /etc/hosts

$ nano /etc/hosts

Make it look like this


Don’t leave that command line because we will be using it in the next section.

09 – Configuring /etc/X11/xorg.conf and ps3videomode.

We need to copy a few more files from our USB drive. We will also have to install alien to tranform our rmp packages into deb packages.

$ exit
$ cp /mnt/usbdrive/target/ps3pf_utils-1.0.9-2.ppc.rpm /mnt/ubuntu/tmp/
$ cp /mnt/usbdrive/target/vsync-sample-1.0.1-4.ppc.rpm /mnt/ubuntu/tmp/
$ cp /mnt/usbdrive/config/xorg.conf /mnt/ubuntu/etc/X11/xorg.conf
$ chroot /mnt/ubuntu /bin/bash
$ cd /tmp
$ apt-get install alien
$ alien ps3pf_utils-1.0.9-2.ppc.rpm
$ alien vsync-sample-1.0.1-4.ppc.rpm
$ dpkg -i ps3pf-utils_1.0.9-3_powerpc.deb
$ dpkg -i vsync-sample_1.0.1-5_powerpc.deb
$ sudo nano /etc/kboot.conf

We need to create a kboot.conf file. It should look like this


ubuntu="/boot/vmlinux initrd=/boot/initrd.img video=ps3fb:mode:5"

Make sure you edit the video mode to match what you found on the chart earlier. Here is the chart for reference.

Video mode ID:
YUV 60Hz 1:480i 2:480p 3:720p 4:1080i 5:1080p
YUV 50Hz 6:576i 7:576p 8:720p 9:1080i 10:1080p
RGB 60Hz 33:480i 34:480p 35:720p 36:1080i 37:1080p
RGB 50Hz 38:576i 39:576p 40:720p 41:1080i 42:1080p

full screen mode: <video mode ID> + 128
dither ON mode : <video mode ID> + 2048

Now you should be in good shape.

Make sure that you are at the actual kboot prompt and not still inside the chroot at this point. Use the exit command if you are still in the chroot.

 $ exit

This is the command for starting Ubuntu from kboot.

$ mnt/ubuntu/boot/vmlinux initrd=mnt/ubuntu/boot/initrd.img root=/dev/sda3

We should go ahead and reboot first just to make sure that Ubuntu will boot automatically now.

$ reboot

You should then be booting Ubuntu and end up at the login screen. Do not press any keys when the kboot prompt comes up. It will take 10 seconds for the command to kick in.
If all went well you should be at the login screen. Use the user name that you just created and login. You will then be prompted to setup your KDE configurations.

10 – Install the Ubuntu Desktop (this section is optional and should be used if you wanted the Ubuntu desktop and it wouldn’t work during the normal installation)

If you would like to use the Ubuntu desktop rather than the Kubuntu or Xubuntu that you installed. Open up a terminal and issue the commands …

$ sudo apt-get install ubuntu-desktop

Choose “gdm” as your desktop when the install screen pops up at the end.

When that is finished installing everything, you should reboot. (you can do this using the graphical interface or by issuing the command in the terminal)

After the system reboots, you should be looking at the Ubuntu log in screen. Go ahead and login. Open a terminal by clicking Applications>Accessories>Terminal and issue the following command to uninstall the KDE components of the desktop. (This is if you installed the KDE desktop previously)

$ sudo apt-get remove adept kaddressbook kaffeine kamera kappfinder karm katapult kate kaudiocreator kcron kde-guidance kde-systemsettings
kdeadmin-kfile-plugins kdebluetooth kdegraphics-kfile-plugins kdemultimedia-kappfinder-data kdemultimedia-kfile-plugins kdemultimedia-kio-plugins
kdenetwork-filesharing kdenetwork-kfile-plugins kdepasswd kdepim-kio-plugins kdepim-wizards kdeprint kdm kghostview khelpcenter kicker kio-apt kio-locate
klipper kmail kmenuedit kmilo kmix knetworkconf knotes konq-plugins konqueror-nsplugins konsole kontact konversation kooka kopete korganizer kpdf kpf kppp
krdc krfb krita kscd kscreensaver ksmserver ksnapshot ksplash ksvg ksysguardd ksystemlog kubuntu-artwork-usplash kubuntu-default-settings kubuntu-desktop
kubuntu-docs kubuntu-konqueror-shortcuts kwalletmanager kwin

If you ever want to get back to the PS3 XMB from the kboot prompt or from inside of Ubuntu, open a teminal and type …

$ sudo boot-game-os

If you are using the Kubuntu desktop and issue the command “boot-game-os”… you might notice it doesn’t work. The reason is that the script depends on another script, “find-other-os-flash”, that uses at least one bash-ism, yet the script specifies that it should be run by sh. sh on Kubuntu will be using Dash, not Bash… so it will fail. To fix it, open up /sbin/find-other-os-flash with your favorite editor and change the first line from: “#! /bin/sh” to ‘#! /bin/bash”.

$ sudo nano /sbin/find-other-os-flash

The command “boot-game-os” should work fine after that.