Introduction

Anyway , If it’s going to replace my old one, It should act as a
- Torrent server
- Printing Server
- Scanning server
- File server.
Installation
1- Server Image: This step is essential to install operating system on the raspberry-pi. The operating system image can be downloaded from here , and the img file has to be cloned on a micro-SD card (class 10) . I followed the link here , All straightforward.2- Initial Admin configuration
I connected the pi via putty after connecting it to the network . The default username is pi and password: raspberry
I directly added a new user using adduser command , since this new user is not an admin i used the command adduser myusername sudo to add my new user to the sudoers file.
Now I need to change password for the pi default user , or just delete it completely. I also wanted to change the device name from raspberrypi to something else. So I edited the /etc/hosts and the /etc/hostname files (see the second link below) using nano then reboot.
Admin Tools
I’d go with webmin anytime i wanted to quickly manage stuff on linux.1 | sudo nano /etc/apt/sources .list |
1 | deb http: //download .webmin.com /download/repository sarge contrib |
1 2 | wget http: //www .webmin.com /jcameron-key .asc apt-key add jcameron-key.asc |
1 2 | apt-get update apt-get install webmin |
File Server
Before making the raspberry pi work as a server , I must have a permanent disk space to share. I usually attach a flash drive to the system and make that my transfer space. I use it also as a scratch disk for my torrents clients later on. Doing this , in my opinion , extends the life of the MicroSD on which the system is installed.so , to display disks I use sudo blkid to get the flash drive UUID value, please look here for guidance.
I go and mkdir /mnt/DownloadDisk for example on a folder in which the flash will mount
Here I use exfat as a filesystem for my flashdrive so the important step here is to install exfat-fuse before doing any fstab changes.
1 | apt-get install exfat-fuse |
UUID=theUUIDyouGot /mnt/DownloadDisk exfat rw,user,uid=65534,gid=65534,permissions,umask=0111,nofail 0 0
Note that uid and gid here are pointing to nouser and nogroup ids respectively. If you don’t know the uid on your system , just use “id nouser” command
Once this step is done, we can work on enabling the file server from webmin. To do this go to webmin , go to the unused modules then to the samba file server node. After enabling it you’ll have.
The final step will be enabling a file share , the samba interface is very clear .. Click on the “create a new file share” and then you’re guided to the next page
The share in my case will point to the /mnt/DownloadDisk , and i will put the ownership to nobody / nogroup with permissions 666 (all read , all write ,nobody executes

Torrent Server
1 | sudo apt-get install transmission-cli transmission-common transmission-daemon |
The file which has all the settings you’ll probably need is the settings.json , just copy it , and then edit the original with nano.
IMPORTANT To reflect settings changes on the daemon , it has to be restarted.
To reflect the settings , only use this command
1 | sudo invoke-rc.d transmission-daemon reload |
The explanation of almost every setting key is present at this site
Print Server
One of the main reasons I went to the idea of configuring a home server was to re-use my USB printers wirelessly and from any other computer at home. It gives you so much power not having to stand-up and connect your laptop .The steps are not really that hard , here we go:
1- We need to install the printer driver, mine is HP , so i use
sudo apt-get install hplip
and then ran hp-doctor to fix any missing packages.
for my printer (P1005) i installed printer-driver-foo2zjs through apt-get
2- The server software
1 | sudo apt-get install cups |
1 | sudo cupsctl --remote-admin |
finally , the admin interface is located at : https://localserveraddres:631
Note: You might want to add your user to the lpadmin group for admin access to the CUPS web interface , specially if you’re not using the root user for administering your linux box . the commmand is
sudo usermod -a -G lpadmin username
Scan Server
I’ve done this before . However, there is always room for making the process easier by doing a bit of research before going all the way. I found this ubuntu guide and this guide from debian wiki as well.Following the debian’s guide, I’ve installed the three packages sane-utils ,libsane and inetutils-inetd,then used the command:
1 | sudo nano /etc/default/saned |
# Set to yes to start saned RUN=yesAlso added this line
sane-port stream tcp nowait saned.saned /usr/sbin/saned sanedadded the saned to the lp group
1 | sudo usermod -a -G lp saned |
192.168.0.0/24Of course, this is the network Id of your internal network.
Some more info from Ubuntu’s guide :
1 | sudo nano /etc/systemd/system/saned .socket |
One more file to create# Defaults for the saned initscript, from sane-utils # To enable under systemd please read README.Debian # Set to yes to start saned under SysV RUN=no # Set to the user saned should run as RUN_AS_USER=saned cat /etc/systemd/system/saned.socket [Unit] Description=saned incoming socket [Socket] ListenStream=6566 Accept=yes MaxConnections=1 [Install] WantedBy=sockets.target
1 | sudo nano /etc/systemd/system/saned @.service |
the last command to put it in the startup is[Unit] Description=Scanner Service Requires=saned.socket [Service] ExecStart=/usr/sbin/saned User=saned Group=saned StandardInput=null StandardOutput=syslog StandardError=syslog # Environment=SANE_CONFIG_DIR=/etc/sane.d SANE_DEBUG_DLL=255
1 | sudo systemctl enable saned.socket |
References
http://dimabobkov.blogspot.com.eg/2015/11/install-and-configure-raspbian-jessie.html
http://www.howtogeek.com/167195/how-to-change-your-raspberry-pi-or-other-linux-devices-hostname/
http://askubuntu.com/questions/45607/how-to-mount-partition-permanently
http://www.cyberciti.biz/faq/linux-finding-using-uuids-to-update-fstab/
https://wiki.openwrt.org/doc/uci/transmission
No comments:
Post a Comment
I'd like to read your comments