Introduction: Raspberry PI, THE SERVER (TURNKEY LINUX)

Welcome reader.
First please note: This instructable can be done within a day, but a weekend is certainly recommended.

In this instructable I hope to teach you key skills involved with setting up and configuring a Linux Server. The knowledge used here can be applied to almost all PC architectures so if you don't own a Pi (Why not dude?) or it's tied up in another project, any old or unused PC will work. In more detail the main skills taught will be:

Burning an ISO image to an SD for the Pi

Installing an OS

Setting up A web server

Setting up An SQL instance

Deploying a custom cloud network

Managing users for the cloud network

Setting up a SAMBA File sharing network, which will integrate into an established windows based home or office network

Controlling SAMBA users

Establishing a static IP whilst using a non-static IP internet connection

Using Webmin Console to install packages

Using Command line terminal to install packages

Carrying out basic commands such as rebooting (terminal)Editing system files with Nano terminal based editor

Permanently mounting hard drives within the Linux file system table via webmin

Understanding the principal of the Port forwarding function on a home router

Setting up a web interfaced bit torrent manager

Being an overall IT nerd.

If you're interested then carry on reading. If not, give it a try; you may discover a new hobby. As the above list demonstrates there's a lot to learn. I definitely feel this is a weekend project. I've followed this process several times and it takes a couple of days at least. Its good to take long breaks because your eyes may begin to become strained and you may suddenly become unenthusiastic about the whole thing. This instructable offers functions of many different store purchasable products, such as:

Dedicated Amazon EC2 turnkey servers

Belkin routers that offer built in apps

Online cloud services such as Google Cloud

NAS servers such as this.

The server we'll setup will cost far less than each of these services in the long run and only a fraction of the cost of the combined services. Setting up your own server is not only custom and cheap, its very rewarding. I will be a happy guy if somebody benefits from what this instructable contains or become inspired by what I have done. It took ages to plan and write this instructable. If you learn anything at all or feel this instructable is well written or well documented, please vote for me in the Weekend Projects Contest or the I could make that contest.

I would also like to point out that this is not a comprehensive tutorial on designing a server case. There are details of my case on step 3, however this guide is intended to be a comprehensive software tutorial. So if you get stuck or feel a step isn't too clear, just let me know and i'll be happy to help. A few tips: Because this takes more than one day, don't just fall asleep and forget what you were planing on doing next. Instead have a pile f post-it notes. This way before you ZzZzzzz... you can jot down anything that needs doing during the next session. I had loads. All over the walls, floors, chairs, desks - you name it! Okay slight exaggeration, but on a serious note they do help. I did use a full stack. Another tip would be to follow the steps on order. Don't just think "Hmm I like the sound of my own cloud network lets do that first!" The steps are in such an order that each before is most likely required for the current, if that makes sense. Just stick to the order, it'll make life easier. A final tip: don't be limited to what is taught here. Do Think of this as a base for inspiration. Adding more services such as those listed on the turnkey website is easily done using the search APT function within the Webmin Package manager. Okay, Confused? Then let's learn...

what you need:
1-Raspberry Pi

2-SD card

3-Raspbian image file (Download from http://www.raspberrypi.org/downloads/ ONLY)

FIRST STAGE :
1-use this page to make your sd card bootable

2-insert your sd card and turn on your PI

3-wait until you see the "raspi-config" menu

4-expand your sd card

5-set your locale ,Timezone ....

6-(IMPORTANT) in the "ADVANCE" menu, set your gpu ram to 16mb

7-(IMPORTANT) in the "ADVANCE" menu, Enable ssh

8-finish. your pi will now restart.

now you have a HEADLESS PI. it means you don't need your keyboard or monitor anymore

just connect your pi to a router

we will use SSH to continue our work

SECOND STAGE :
1-find your PI ip address.

2-in Linux or Mac open the termianl and run this command:
$ ssh pi@"YOUR_PI_IP"

3-enter the default password "raspberry"
4-set your ROOT password:
$ sudo passwd root

5-logout of pi:
$ logout
6-login to root:

$ ssh root@"YOUR_PI_IP"

your Raspbian is ready now. we will use TKL_PATCH to turn the Raspbain into TurnkeyLinux.
Thanks to ghoulmann & Mort'z

THIRD STAGE :

(just copy and paste to your terminal)

1- ssh to root

$ ssh root@"YOUR_PI_IP"

2-clone git repo to your PI:
$ git clone https://github.com/mortezaPRK/Raspliance-Core /tmp/tkl

3-go to /tmp and compile tkl patch:
$ cd /tmp/tkl/

$ ./compile_tklpatch.sh

4-install TurnKey into system path:
$ tklpatch-apply / ./core/

wait until everything finish. you should restart your pi:
$ shutdown -r now

or

$ reboot

now connect your keyboard and monitor to PI again

in first boot, you should enter root password

remember to choose the most powerful password you can.

ITS DONE
you can use this instructables for more information about TURNKEY....

Most common problems and their Solutions :
you may encounter some problems during or after installation.

1-you get session closed when using shell in box?
Solution: use ssh then "enter the "nano /etc/hosts" menu and change 127.0.1.1 from "core" to "mynewname""

2-# UNCONFIGURED INTERFACES?
Solution 1: quit the confconsole. login to root. edit file "interfaces" on /etc/networkk

add following line to top of the file:

# UNCONFIGURED INTERFACES

(or run this command: $ sed -i '1i# UNCONFIGURED INTERFACES' /etc/network/interfaces)

Solution 2: (ONLY if fix one doesn't work for you)
quit confconsole .login to root:

$ /etc/init.d/confconsole stop
$ update-rc.d -f confconsole remove