Difference between revisions of "COMP 3000 2011 Report: Alpine"

From Soma-notes
Jump to navigation Jump to search
Line 27: Line 27:
== Basic Operation ==
== Basic Operation ==


Alpine Linux excels at servers, firewalls, and networks, none of which I have any experience with. Thankfully the website offers some tutorials for a multitude of features. These features include, but are not limited to; hosting a mail server, setting up a satellite Internet connection, formatting a hard drive, and backing up flash memory.  
Many basic linux commands work similarly in alpine. For example "ps" will list the processes and "ls" followed by a file will list its contents. However the man pages are not installed by default due to their size, but these pages can be installed by typing "apk add man" followed by "apk add" the package you want "-doc". For example, if you wanted the man pages for iptables, you must simply type "apk add iptables-doc" and then you can access the iptables man page.
 
Alpine Linux excels at servers, firewalls, and networks, none of which I have any experience with. Thankfully the website offers some tutorials (available at [http://wiki.alpinelinux.org/wiki/Tutorials_and_Howtos]) for a multitude of features. These features include, but are not limited to; hosting a mail server, setting up a satellite Internet connection, formatting a hard drive, and backing up flash memory.  


== Usage Evaluation ==
== Usage Evaluation ==

Revision as of 17:32, 17 December 2011

Background

Alpine Linux is a free, small, and easy to install Linux distribution that began as a fork of the LEAF project (Linux Embedded Appliance Firewall). The main focus of this distribution is security, with features such as Pax and SSP, it prevents security hole exploitation. Alpine is designed for x86 Routers, VPNs, VoIP servers, and firewalls. This distribution is a unique blend of multiple others: the network configuration is like Debian's and the package management is similar to Debian's APT, RedHat's yum, and Arch Linux's PKGBUILDs (APKBUILD in Alpine). Its minuscule size is one of the main features of this distribution, this results in a size of around 5 MB instead of the traditional 100 MB of GNU/Linux (without the kernel).

Alpine is available for free at alpinelinux.org/downloads.

Installation

One of the unique features of Alpine is its simplicity and ease of use. This is evident in its installation process which is as follows.

For a real instal

  • Step 1: [1] Download ISO.
  • Step 2: Burn to a CD.
  • Step 3: Boot from CD, wait for an input prompt and login as root with no password.
  • Step 4: Type setup-alpine, hit enter, and then follow the on screen instructions. Alternately refer to the next section for a walkthrough.

For a Virtual Machine instal

  • Step 1: [2] Download ISO.
  • Step 2: Mount ISO onto a virtual drive.
  • Step 3: Make a new Linux machine and boot from the virtual drive.
  • Step 4: Type setup-alpine, hit enter, and then follow the on screen instructions. Alternately refer to the next section for a walkthrough.

Detailed Setup Walkthrough The first thing setup-alpine will ask you to do is to pick your keyboard layout. You have many choices, like US, Russian, and Japanese. To pick a US layout, simply type us. It will then ask which variant you want to use, us-acentos or us, type us. The next step is to pick the hostname (like 'foo' or 'system'), type whatever you want to name your system. Once a name has been chosen, a interface must be initialized, the only options are eth0 so just hit enter. After this comes more options, we will skip these for now and go with the default options by just hitting enter. Next a password must be chosen, enter in whatever you like, alpine will tell you how strong of a password it is, following this it will ask you to retype it to make sure you remember it. Now you must select a timezone, you can type ? for a list of available ones or just hit enter for the default. Finally, you must pick a mirror or type f to pick the fastest. Following this are more advanced options, we will just skip these by entering the default by hitting enter.


Basic Operation

Many basic linux commands work similarly in alpine. For example "ps" will list the processes and "ls" followed by a file will list its contents. However the man pages are not installed by default due to their size, but these pages can be installed by typing "apk add man" followed by "apk add" the package you want "-doc". For example, if you wanted the man pages for iptables, you must simply type "apk add iptables-doc" and then you can access the iptables man page.

Alpine Linux excels at servers, firewalls, and networks, none of which I have any experience with. Thankfully the website offers some tutorials (available at [3]) for a multitude of features. These features include, but are not limited to; hosting a mail server, setting up a satellite Internet connection, formatting a hard drive, and backing up flash memory.

Usage Evaluation

Overall I found Alpine Linux to be a complicated yet interesting system. This is most likely due to my lack of networking and server knowledge. The system has no GUI, it is just a terminal, this is likely due to the desire to keep the file size down. In the end this is a interesting and, I assume, competent Linux distribution, although definitely not meant for people who are new to Linux.


Part 2

packaging format Software packages for Alpine Linux are tar.gz archives containing programs, files, and dependency. They have the extension .apk", also called "a-packs"

The packages are stored in one or more repositories(a directory with a collection of *.apk files and an index file, named APKINDEX.tar.gz).

Listing Packages

To list all packages and their descriptions: "apk search -v"

Adding Packages

Use "add" to install packages and any required dependencies. If you have more than one repository, the add command installs the newest package.

"apk add openssh" "apk add openssh openntp vim"

Remove Packages

Use "del" to delete a package (and dependencies)

"apk del openssh" "apk del openssh openntp vim"

Catalog

Due to Alpine Linux's small size and portable nature, it has fewer packages than most. There are 365 .apk files on disk, compared to the 37,000 total packages in Ubuntu.

Major Package Versions

kernel:

  • definition: The kernel with grsecurity
  • Version: 3.0.8
  • web: http://grsecurity.net
  • why: Because a kernel is required

libc:

  • definitions: A library for c
  • version: 0.9.32
  • web: http://uclib.org
  • why: Because a c library is required

Lua:

  • definition: a powerful, lightweight programming language
  • version: 5.1.4
  • web: http://www.lua.org
  • why: many programs on Alpine are dependent on it.

Fetchmail:

  • definition: a remote mail retrieval and forwarding utility
  • version: 6.3.21
  • web: http://fetchmail.berlios.de
  • why: to allow mail operations

Kamailio:

  • definition: an open source SIP proxy
  • version: 3.2.0
  • web: http://kamailio.org
  • why: enhanced security

Pearl:

  • definition: Pearl (Practical Extraction and Report Language)
  • version: 5.14.2
  • web: http://www.pearl.org
  • why: allows for pearl development

Samba:

  • definition: Tools to access a server's filespace and printers
  • version: 3.6.1
  • web: http://samba.org
  • why: helps for server manipulation

Shorewall:

Squid:

Util-Linux:

Initialization

On system start, the package alpine init is run, this tells all the other packages when to initialize. Then /proc is mounted followed by /run, after this it caches the service dependencies. The security and debug filesystems are mounted along with the modloop /media/cdrom/boot/grsec.modloop.squashfs. Then the hardware drivers and modules are loaded followed by mounting the local filesystems and configure the kernel parameters. Finally it starts the kernel logging and system logging.

(This is all printed out every time you reboot).

References

http://alpinelinux.org/