Hi there,
This is my first Instructable so all criticisms and comments are welcome.
This will show you how to set up a simple wired web server on your Raspberry Pi, with PHP and MySql.
The Raspberry Pi is a good choice for a webserver that will not recieve too much traffic, such as a testing server, or small intranet, as it doesn;t get too hot (so is nice and quiet), and only uses around 5 Watts of power (costing Β£3.50 a year where I am if itβs running 24/7)
In the future I might add how to set up a wireless server.
If you have any problems, post them in the comments, or PM me β Iβm happy to help.
Step 1: You will Need
To create a simple web server, you will need:
1. A power supply (Micro USB)
2. A network cable
3. A HDMI cable (or Component cable) as well as a screen and USB keyboard
3. A Raspberry Pi
4. An SD card (2GB or more)
5. An SD card reader for your computer
6. Win32DiskImager (For Windows) or dd (for Unix)
7. The Raspberry Pi Debian Image
8. PuTTY (For Windows) or any other SSH client
9. Around an hour of free time
You can download the software from the following locations:
http://www.softpedia.com/get/CD-DVD-Tools/Data-CD-DVD-Burning/Win32-Disk-Imager.shtml (for Win32DiskImager)
http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html (for PuTTY)
Step 2: Format SD Card
Firstly, you need to install the Debian image onto an SD card (2GB or more).
(The image can be downloaded from https://www.softpedia.com/get/System/Boot-Manager-Disk/Debian-Installer-Loader.shtml
You can do this using the Win23DiskImager tool for Windows (downloaded from http://www.softpedia.com/get/CD-DVD-Tools/Data-CD-DVD-Burning/Win32-Disk-Imager.shtml)
Insert your SD card.
Once you have downloaded the above, Extract the Debian image, and the Imaging tool, then run Win32DiskImager.
Ignore the error that you will see.
Select the Image file (debian6-19-04-2012) and your SD card, then click βWriteβ, it will ask you to confirm, click βYesβ. Then enjoy a break, as it usually takes a couple of minutes to write.
Once the write process has finished, you can remove the SD card, then the fun begins.
Step 3: Allow SSH connections
Now plug the HDMI cable into your Raspberry Pi and your monitor, then add the power cable and SD card, as well as the USB Keyboard.
When you first turn on your Raspberry Pi, the boot up might take a while, but be patient. It will also reboot itself once, this is normal.
Login with the following information when prompted:
Username: pi
Password: raspberry
Type in the following without the quote marks:
βsudo -iβ
[Return / Enter key]
βcd /bootβ
[Return / Enter key]
βmv boot_enable_ssh.rc boot.rcβ
[Return / Enter key]
βrebootβ
[Return / Enter key]
This will restart your raspberry pi.
Step 4: Change Hostname
Now that SSH is enabled, you want to change the hostname so you can connect to it more easily.
Login to your raspberry pi with the username pi and password raspberry.
Type in the following without the quote marks:
βsudo -iβ
[Return / Enter key]
βnano /etc/dhcp/dhclient.confβ
[Return / Enter key]
Now look for the line β#send host-name βxxxxxxβ;β (on mine, xxxxxx is andare.fugue.com), and remove the β#β symbol from in front of it.
Now hold the Ctrl key and press βxβ to save the changes. You will be asked to save changes, just type βyβ then hit the Return / Enter key.
Then type βhostname xxxxxxβ where βxxxxxxβ is what you want to call your server (I chose βraspberryPiβ to make it easy).
Please Note that you cannot have any spaces in the hostname.
Finally for this step, type in βifdown eth0β and hit Return / Enter.
Once that has finished, type βifup eth0β and hit Return / Enter.
Now type βhaltβ and hit Return / Enter.
Step 5: SSH Login
Once your Raspberry Pi has halted, you can disconnect it from the monitor as it is no longer needed.
Plug your Raspberry Piβs power connection in, as well as the network cable into your switch, or hub / router.
Wait a minute or so, then run your SSH client. (I used PuTTY).
Type your hostname into the hostname box, and use port 22. (The hostname is the one you set earlier).
Then click βOpenβ.
As this is the first time you have connected to your Raspberry Pi via SSH, you will get a security warning. Click βYesβ to continue.
Now you can login to your Raspberry Pi with the username: pi and password: raspberry.
Since SSH is working, you no longer need to worry about plugging in a monitor, or keyboard, so you Raspberry Pi can be placed anywhere where there are power and network connections available.