Thursday, August 24, 2006

I-Tunes server part 2

Now I am ready to install the mt-daapd software. The guide provided in the mt-daapd wiki will run you through the steps of installing the mt-daapd software on Ubuntu. I decided to do it a bit different. Since Ubuntu is a debian-based distro I tried installing it with the debian package found here I downloaded the ".deb" file to my (windows)desktop PC.

Now I have to copy the file to the server to install. Luckily I installed a samba server before. So I copied the package to the shared folder on the server. Next I logged on to the server went to the location of the file and typed:
sudo dpkg --install mt-daapd_0.2.4-1_i386.deb
Next step: open the configuration file:
sudo vi /etc/mt-daapd.conf
I did not change a lot in this file. I changed the path to my music, and changed the server-name. Now I was ready to start the service
sudo mt-daapd start
Now start I-tunes and your server should be there listed as shared music. Now you should also be able to access the daap-server through a web-interface. Startup your browser and type your servername or IP Address of the server followed by a colon (:) and then 3689 (port 3689). You can find out the IP-address of your server with the command
ifconfig

So for my server it would be
172.19.3.13:3689
Now login with username: admin and password: mt-daapd (you can change this in the mt-daapd.conf file). Now you`ll see a website where you can monitor your server and change some things...

next post I will explain how I added and changed playlists.

I-Tunes server part 1

In this post I will write about setting up a daap-server . With this server you`ll be able to stream your music collection to I-tunes and some other music-programs. There are different projects working with the DAAP (digital audio access protocol). Check here for an overview of the projects.

On my ubuntu-server I am going to work with the mt-daapd software. You can find the homepage of this project here.

basically I just started with following the steps out of the quick-start Ubuntu guide. The first step in the guide is: install non-standard packages. the following packages need to be installed
libsqlite0
libsqlite0-dev
gawk
gcc
libid3tag0-dev
libgdbm-dev
So type
sudo apt-get install libsqlite0
And do this for every package. Now you should be ready to install the server.
I will explain how I did this in the next post...

Friday, August 18, 2006

Remote Access

Until now I have been working on the server like a desktop. So the server has a screen and a keyboard connected to it. This is not an ideal situation. I rather connect to it from my desktop machine, so that I don`t need an extra screen and keyboard to work on the server. Another benefit is that the machine is pretty noisy and now I can just put it up the ceiling in the hallway where it doesn`t bother me or any of my flat-mates.

So to remotely connect to the machine I`ll use the software openSSH. Simply install this with:
sudo apt-get install openssh-server
Test it with:
ssh localhost
Stop the ssh server with:
sudo /etc/init.d/ssh stop
Start ssh server with:
sudo /etc/init.d/ssh start
Restart the ssh server with:
sudo /etc/init.d/ssh restart
To connect to my server from my windows desktop I use the program "putty" you can download this software here It is a small program that works very easy. Just fill in the IP-Address of your server and select SSH. Now press "open" and a screen should pop up where you can login to your server. With command "exit" you`ll close the connection to the server. If you are in a Local Area Network and you want to remotely access your server from outside the network you should make sure that port 22 is forwarded to the server. You should be able to change this somewhere on your router.

The last thing to do before moving the machine to the hallway is making sure that it will boot without a keyboard connected. You can change this in your BIOS. On my machine I first had to enable "the power on password" Option. After that I was able to enable the "Server Boot" option, which makes it boot without the keyboard connected.

check this site for a detailed totorial on installing openssh.

Next time I will post about installing an openDaap itunes server..

Thursday, August 17, 2006

Samba part 2

In the first part about Samba I talked about installing Samba and a way to edit the configuration file smb.conf. In this post I will talk about the steps I took to get it all working. Please note that I am not a linux-expert. So if something works for me it is not guaranteed that it will work for you too.
The first thing I did is add a user to samba. In order to add a user to samba you should first add the user for the server itself. So type
sudo useradd john
now you can add user "john" to samba
sudo smbpasswd -a john
the "-a" parameter means add user. To delete the user type:
sudo smbpasswd -x john
Now that we added the user the only thing left is configure samba. Type:
sudo vi /etc/samba/smb.conf
with editing the existing configuration-file I did not get it working. So decided to start with an empty file and build it from scratch. With some help of examples on the net I ended up with this:

[global]
workgroup = MSHOME
server string = %h
security = user
printable = no
read only = no

[homes]
browseable = no
writable = yes

[music]
path = /mnt/music
writable = yes
browsable = yes
This did the trick for me. Now I am able to access the directory "/mnt/music". The only problem I encountered that, although browsable is set to "yes", I was not able to write to this location from my windows client. I found out that this had to do with the permission settings in Unix. You can change these permissions with the command CHMOD. I typed
sudo chmod a=rwx /mnt/music/
now the directory is readable(r), writable(w) and executable(x) for everyone(a). Check here for a very clear tut on the CHMOD command. To start, stop, restart samba type:
sudo /etc/init.d/samba start
sudo /etc/init.d/samba stop
sudo /etc/init.d/samba restart

Next post will be about connecting remotely to the server with "ssh". After that I will post about setting up a DAAP server to serve music to I-tunes with the "(open) digital Audio Access Protocol".

Wednesday, August 16, 2006

Samba part 1

So it is time to put some music into the server. With samba you are able to share the data on the server with windows-computers connected to your network. Check the samba web-site here

Installing the server is very simple with ubuntu server. Just type
sudo apt-get install samba
For me this went perfectly smooth. Now we can start configuring the samba server. You configure the samba server by editing the "smb.conf" file. The ubuntu-server user guide advises to make a copy of the smb.conf file before you start editing. You do this by giving the command
sudo cp /etc/samba/smb.conf /etc/samba/smb.conf.original
Ok now we should edit the "smb.conf" file. For editing files I`ll use the program "vi". you start editing the smb.conf file with the command
sudo vi /etc/samba/smb.conf
now you see the contents of the file on the screen. I used the following commands to change the file and save it: With the arrow keys you can move up and down in the file. To edit the file press the "insert" key and start typing. To save the file: exit the editing mode by pressing the escape key. now press ":". At the bottom of your screen you should now see a colon. With the command "w" you`ll save the changes you made. With the command "q"you`ll exit vi ("q!" exits without saving). here you`ll find a list with all the basic commands you need for vi editor.
If you`re not sure what you`re doing first try it without sudo in front of the vi command. Note that you cannot save you`re changes now and have to exit with ":" followed by "q!".

Next time I will finish configurating the smb.conf file and add shares and users...

Monday, August 14, 2006

Mounting the harddisk

So the server is up and running. First thing I want to do now is find my secondary harddisk and find out if all the data on it is accessible. All files in a Unix-system are arranged in a tree. All the files can be spread over different devices such as harddisks, cd-rom, usb device. With the command "mount" you can attach the file system found on a device to the file tree. So I gave the command:
sudo mount -t ext3 /dev/hda1 /home/data
With this command I told the server to mount my harddrive with the "ext3" file-system. The name/location is "/dev/hda1/" (note that this is somehow a different name than when the harddisk was connected to my desktop-pc). The "/home/data" at the end is the location in the file-tree where I can find the data after mounting the disk.
After this I went to the directory to check if it was mounted correctly
cd /home/data
And there it is. All data is accesible.

Next time I will work on samba to share all the data over a windows-network.

Sunday, August 13, 2006

Installing server

So I am ready to start installing the server. I chose for the ubuntu-server edition. You can download the software here. I restarted the pc and made sure it booted from CD (you can change the boot sequence in the BIOS, access the BIOS by pressing a "specific" key during startup). I chose to install just the minimal server. You can also choose to install a LAMP server with linux, Apache (webserver), Mysql (database) and PHP installed automatically. Although I want to have all these features on my server I rather install them myself later.

The first question in the installation proces that I had to answer was where I wanted to install ubuntu-server. I installed two harddrives in my system. One of 10 gig and one of 320 gig. I chose to install the software on the small one. And to keep the large one for data storage. After the choosing the location the only difficult question was whether I wanted to use LVM (logical volume manager). I decided not to use LVM. For me it is not really clear what LVM does. I am not sure if I made the right decision but I`ll probably find out later. I just try to keep it as simple as possible. check this forum to see an answer of someone with the same question. After this, the installation proces was very easy and in less then 15 minutes I rebooted the system and the server was up and running...

Friday, August 11, 2006

Copying data

As posted before, I wanted to copy data from a removable usb-harddrive to the harddisk for the linux-server. So I connected the USB harddrive to my pc running Ubuntu. At that time something went wrong and I was logged out of Ubuntu and was not able to log on again. I couldn`t really figure out what the problem was. Although I was still able to log onto a terminal-session I could not get it up and running again.

So the only thing left for me was reboot the pc and run Windows. Browsing in some newsgroup I found a solution for my problem. with the tool "fs-driver" (fs-driver.org)I was able to copy the data of the usb harddrive to the ext3 disk.

So now I can finally start working on the linux-server...

Storage

The next step should be installing the software on the machine. But in this case it is a bit different. I borrowed a Removable Harddisk from a friend with a lot of data. The only free space I had was on my brand new harddisk. Unfortunatley I did not have the server up and running yet and I had to return the removable harddisk the next day. So I had to copy the data onto the harddisk using my desktop pc.

An issue here is that Microsoft Windows uses another file-system than Linux. So formatting the harddisk as NTFS- file system was no option. My first thought was that fat32 file system could be read by both linux and windows. But the problem with fat32 is that the maximum partition-size seems to be 32gig. Luckily I once experimented a bit with a Linux distribution called Ubuntu. Although I had not used this for a long time. I did not really see another option than to format the harddisk with a Linux OS.

So I plugged in the Harddisk and started Ubuntu (5.10). After clicking for a while I couldn`t find a GUI-program to format the disk. So I decided to give a try with the terminal. With help of forums on the internet I found a way.

I gave the comment:
sudo fdisk /dev/hdd
Ubuntu is configured in a way that when you type "sudo" in front of you command it will be run as root-user. I found out the name of the harddisk (/dev/hdd) with help of the GUI of Ubuntu. Of course there is a way to view this in the terminal, but I don`t know how.

here you can find the steps to follow.
I chose to make 1 primary partition.
After this I gave the command
sudo mkfs.ext3 /dev/hdd1

This did the trick for me.

Hardware

To set up a server you need hardware. I am going to use is an old pc of a friend. The machine has a Pentium III 450 processor with 256Mb Ram and a Harddisk of 10gig. One of the main purposes of the server is storage so the 10gig harddisk will not be sufficient. Luckily hard disks are not very expensive these days. So I bought a 320gig harddisk at the local store.

Thursday, August 10, 2006

The start

Setting up a Linux server is something I wanted to do for ages. But somehow I could always come up with something that seemed more important at the time. The main reason to build a server is of course the functionalities of the server. But another reason to set up a linux server is to learn how to work with Linux.

In this Blog I will post about my efforts in setting up the server. Right now I have very little experience with Linux systems. So I`ll probably run into a lot of problems. I will try not only to post about problems I experience, but also about parts that go smooth. I hope that at the end this blog could be of any help for people that want to set up there own linux-server