Raspberry Pi as server

Setup & config options

Apache 2.4+ LAMP server

»Windward« server

The game & not the islands
 Setup & config options

Some off-topics
Free weather app. Weather widget

Lat. 52.27, Long. 8.01

 

Meteorological service

Front desk clerk

🚫  No ads & tracking

Tag cloud
QRC bookmark

QR quick response code



Github social media VSCO social media Vimeo social media | Madeira | Madeirense Twitter | X Youtube social media

The prologue


Most of the articles, descriptions and instructions written here are applicable to the most common Debian-based Linux derivatives. Depending on the respective operating system, there may be minor or major discrepancies.
This website is for educational purposes only. Please do not deploy anything in manufacturing plants.
No warranty or compensation is given for loss of data or hardware.

It should be also mentioned that this modest web server is hosted on a Raspberry Pi type 4B at home.


The Raspberry Pi mini-computer board as multi-purpose server deployed
A competent allrounder for domestic purposes and micro-enterprises


Raspberry Pi : Apache as multiple web server. Print server, scan server, backup and NAS server. Raspberry Pi : Apache as multiple web server. Print server, scan server, backup and NAS Server.

Raspberry Pi is a series of small single-board computers (SBCs) developed in the United Kingdom by the Raspberry Pi Foundation in association with Broadcom. The mini-computer with its armv7l processor has quickly become the favourite of hobbyists. Projects can be started with suitable Linux distributions. Even an aged RasPi e.g. the models 2B and 2B+ can definitely serve to simple tasks quite well.


Caution ! Proprietary and untested third-party software sources (Linuxes) can threaten the system.


Raspberry Pi | Mount and use a network USB drive


Don’t risk data loss. There are many ways to accomplish making a backup copy of your files.

Raspbian automatically mounts a drive but how to do it manually to a headless Raspbeery Pi ?

You have to know that any Raspbian-OS lite (!) does not automatically mount your USB drives to the system. Here you get the general understanding and that becomes pretty handy.


Her in my home I operate with two RasPis. The faster Pi works as an Apache web server.
The second has the function as network print server plus network 16GB USB drive (pi@NetworkPrinter) which I use for personal data backups simply made. Splitted system is a better and safer system.


Mount the USB drive manually


Plug your drive to the RasPi and perform a reboot, then login as »root«.


pi@NetworkPrinter:~ $ sudo su
root@NetworkPrinter:#


Find out to where the drive has been mounted.


root@NetworkPrinter:# cat /proc/mounts


    ...
    /dev/sda1 ...
    ...
	

Now find out the UUID by using the following command.


root@NetworkPrinter:# ls -l /dev/disk/by-uuid


    ... 1 root root ... 2887d26c-6ae7-449d-9701-c5a4018755b0 -> ../../mmcblk0p2
    ... 1 root root ... 4AD7-B4D5 -> ../../mmcblk0p1
    ... 1 root root ... 5cb88cb1-1294-4696-b4cc-5dd27aa05dde -> ../../sda1
	

Identifying the correct USB disks/drive you want to mount.


root@NetworkPrinter:# df -h


    Filesystem  Size  Used  Avail  Use%  Mounted on
    ...
    /dev/sda1   15G   13G   1.8G   88%
    ...
	

Now you need the TYPE and the PARTUUID.


root@NetworkPrinter:# blkid /dev/sda1


    /dev/sda1: UUID="5cb88c ... a05dde" TYPE="ext2" PARTUUID="01ddf627-01"
	

Since I do not which filesystem you have on your drive, install the support packages for »NTFS« and »exFAT«.


root@NetworkPrinter:# apt install ntfs-3g exfat-fuse exfat-utils


Make a directory where you have to mount the USB drive to and give user »pi« the ownership.


root@NetworkPrinter:# mkdir -p /mnt/usb1


root@NetworkPrinter:# chown -R pi:pi /mnt/usb1


Modify the »fstab« file. The »fstab« file controls how drives are mounted to your RasPi.


root@NetworkPrinter:# nano /etc/fstab


proc                  /proc      proc  defaults 0 0
PARTUUID=36292c52-01  /boot      vfat  defaults 0 2
PARTUUID=36292c52-02  /          ext4  defaults,noatime 0 1
PARTUUID=01ddf627-01  /mnt/usb1  ext2  defaults,auto,users,rw,nofail,noatime 0 0

# a swapfile is not a swap partition, no line here
# use dphys-swapfile swap[on|off] for that
	

Unmount the USB drive, wait for 15 seconds and mount it again.


root@NetworkPrinter:# umount /dev/sda1 && sleep 15 && mount -a


Be sure the drive is remounted after the Pi has been shut down or rebooted.


root@NetworkPrinter:# shutdown -r now


12-Oct 2020


Network USB drive | Access, usage and file transfer


Shared drives : »OpenSSH« is a powerful collection of tools for the remote control of, and transfer of data between networked clients (users) and hosts (servers).


root@NetworkPrinter:# apt install openssh-server


Now clients can directly access the network USB drive & exchange files by copy & paste or drag-and-drop.


user@client:~ $ sudo su
root@client:#


Linux, Ubuntu, connect to Raspberry Pi network server, USB dribe


  • Terminal SSH : Putty, Tilix apt install putty , apt install tilix
  • FileZilla sFTP : apt install filezilla
  • File managers : Nemo, Nautilus : apt install nemo , apt install nautilus
  • Midnight Commander : via terminal program apt install mc

Logins : you need the local IP-address e.g. 192.168.1.27 (Raspberry Pi), »sudo« username & password.


root@client:# ssh pi@192.168.1.27
root@client:# pi@192.168.1.27's password:


12-Oct 2020


dosboot.org 2024 | Design and layout handmade in Northwest Europe