Pages

Ubuntu LAMP Server With Torrentflux In VMware

Ubuntu LAMP Server With Torrentflux In VMware

This tutorial is meant for Linux newbies who want to try and build a Ubuntu Server box as a web
server and torrent client. It is a step by step instruction on how to do this in VMWare on Windows XP to get the feel of it. I wrote this after, being a Linux newbie myself, a lot of trial-and-error and googling. Hope this helps you!
The virtual machine you create here isn't meant to work as a server at home. Apache MySQL, PHP and Torrentflux are available for Windows as well, so that would work just the same.
I was playing with the idea of getting some old pc and install it with Ubuntu LAMP server. A stand-alone web server, separate from my desktop-machine. While this box would be on all the time it could as well download some torrents. But before really buying a pc i wanted to seeÂ
how it would turn out to see if it is what i had in mind. That's why i made it in VMware andÂ
afterwards made this tutorial.

Required downloads

If you don't have VMWare: Ubuntu 6.06 Server get the "PC (Intel x86) server install CD" (no need to burn it to a CD, the iso is enough) Â


Step 1: Installing VMWare Player and VMXBuilder

This step is out of scope of this how-to, if there are a lot of questions about it i might try to explain this.
VMXBuilder is a handy tool to create virtual machines that you can use with VMWare player.
See the VMX Builder page for installation notes.
Â

Step 2: Creating a Virtual machine for VMWare

Start VMXBuilder.
Choose: File - Create new virtual machine
Choose your Machine-location (I used c:\vms\UbuntuServer)
Enter a display name for the VM
For the options tab use the following Options:

There is no need to change anything else.
For the hardware tab there's a little more to do
  • Give the machine some more memory (it's important to leave sufficient memory for your host OS). My machine has 1 GB internal memory, i gave the VM 400 MB of it.
  • Add a network adapter via new hardware
  • In the same way add a Hard Disk and a DVD/CD-ROM drive.
  • Optionally install more (like USB, but that's up to you)
  • The network is standard configured the right way (it will be a machine on your network and have it's own IP-address)
  • Create a hard disk: choose 'Create new'

    In the screen i use the following settings (I don't have VMWare and do have contig in my path)

    I choose a 4GB disk size, this is enough for your Ubuntu installation. On your hard disk this 'virtual hard disk' will only occupy as much space as it needs but it won't exceed 4GB. When everything went OK a message box showing your current disk information should appear
  • Finally set up the CD-ROM player to use your downloaded iso of ubuntu server 'ubuntu-6.06-server-i386.iso'.
  • Save your Virtual Machine.
Â

Step 3: Start your virtual machine and install Ubuntu

(If you have some sort of firewall installed on your host pc this might be the moment to temporarily disable it. I use the Sunbelt Kerio Firewall and I haven't got it to let the virtual machine use the network, any expert ideas? )
If at any time during this install it seems to have stopped, try again without using your pc at the same time or maybe swith of any screen-savers. I've had some problems with that in the past. (Reboot the machine)
Make sure you have a working internet connection.
Start VMWare Player
Open your Ubuntu Server machine (look for the vmx file in your virtual machine folder)
When the machine is booting up: left-click with your mouse in your machine.
When the Ubuntu-menu appears, choose: 'Install a LAMP Server'

For this tutorial we choose "english" as the language and as Country: United States. Step through
some other install screens, most of them are pretty obvious. Choose a nice servername, optionally set-up a proxy server.
When it comes to partitioning your disk: no worries, this virtual machine only knows of your virtual hard disk. Everyting else is save, so choose:

Write the changes to disk and answer the questions about your time-zone.
Walk through the username and password screens. Wait untill the installation completes, if any error screens appear: good luck :)
If everything went fine you see

(There's no need to remove a cd since you're using an iso.)
Press continue, the machine reboots.

Step 4: Getting it to work

I don't know about you but after rebooting the machine it seems to get stuck at "booting the kernel".

Here's how to fix that
This procedure needs an internet connection, so make sure you have a working one!
Reboot your machine by exiting the machine (press ) and choose


Left-click with your mouse in your machine.
And press to enter the boot-menu, choose CD-ROM After booting from the cd, your're back in the install menu. In this menu choose 'Rescue a broken system'

Walk through the familiar looking screens until you get to

Choose /dev/discs/disc0/part1
Choose Execute a shell in /dev/discs/disc0/part1
and continue in the next screen.
You are now in a console environment where you can execute commands. Enter
sudo apt-get install linux-686
When asked to continue choose 'Y'
When this is done: Congratulations: you just installed a new kernel for linux!
At the prompt type:
exit
You return to the rescue operations screen where you choose 'Reboot the system' Now you should be able to get to the logon screen

Note

As you probably found out by now: Ubuntu Server does not have a graphical interface. I think that's a good thing so i'll continue this how-to for using the command line.
For some commands you need super-user rights, the command 'sudo' gives you them. A command started with sudo always asks for a password: use your own.

Step 5 (Optional): Make system up-to-date

Logon with your username and password.
sudo apt-get update
sudo apt-get upgrade
In my case this screen appeared:

press Y ...Wait patiently untill everything is done installing...
 

Step 6: Downloading Torrentflux 2.1

On your host, find out a working link for downloading Torrentflux at http://prdownloads.sourceforge.net/torrentflux/torrentflux_2.1.tar.gz?download
Choose a location near you and choose download. Cancel the download and write down the link shown below in blue (haven't found a way to paste text into my vmware-window yet)

back in your machine type:
wget
e.g.
wget http://belnet.dl.sourceforge.net/sourceforge/torrentflux/torrentflux_2.1.tar.gz
If you need to use a proxy server begin with setting up your proxy server in you current environment:
http_proxy=http://:;export http_proxy
or if you want this to be permanent: edit the /etc/wgetrc and fill the proxy settings there.
To edit the /etc/wgetrc file you need to know how to use vi, this is beyond the scope of this how-to.
Result:



Step 7: Installing Torrentflux

All right, we downloaded Torrentflux, now on to installing it. Set mysql root password:
mysqladmin -u root -p password
when asked for a password: just press
it's the current mysql root password which isn't assigned yet.

Unpack Torrentflux:
tar zxvf torrentflux_2.1.tar.gz
cd torrentflux_2.1
mysqladmin -u root -p create torrentflux

cd sql
mysql -u root -p torrentflux < mysql_torrentflux.sql

cd ../html

Set up the config.php:
vi config.php
Now edit the settings as below:

Consult a vi manual to find out how vi works.
After saving your updated config.php file copy the files to your web server root directory:
sudo mkdir /var/www/tf
sudo cp -rf * /var/www/tf
Create a folder to save the downloaded torrents
cd /home
sudo mkdir shared
sudo chmod 777 shared
cd shared
mkdir torrent
chmod 777 torrent

Step 8: Test!

If everything went OK it's time to try if it's working and to set up the last bits in Torrentflux. To find out what the ip address is of your new server:
ip address
Look for the eth0 network card:
in my case the ip address is: 172.16.50.83

On your host: open your webbrowser and go to:
http:///tf
Tadaaaa! :)
Login with: root and mysql password:
As a final step: change the path to: /home/shared/torrent and press 'Update settings'


Configuring Torrentflux further is beyond the scope of this how-to.
Congratulations, you now have a working webserver with Apache, MySql, PHP and Torrentflux.

Step 9 (Optional): Installing SSH

Torrentflux has a nice system to download your downloaded files from your server but I prefer some sort of secure ftp-connection.
I installed openssh for this, this is how:
sudo apt-get install openssh-server
No need to start it or anything. it's ready for use with e.g. WinSCP or PuTTY.

Step 10: Shutdown your Ubuntu server

sudo shutdown -h now
If you don't want to shutdown but simply log-off:

exit

 For More Check Related Links :

0 comments:

Post a Comment