CHAPTER 4
Using Common Linux Programs

Objectives:

  • images  1.2 Major Open Source Applications
  • images  1.4 ICT Skills and Working in Linux

imagesThis chapter begins a more hands-on look at Linux, as opposed to the more abstract information presented in the previous chapters. It starts with a look at Linux desktop environments, including information on the most common desktop environments and their basic uses. If you’re using a desktop environment, chances are good you’re doing so in order to run productivity software; in this chapter, you’ll learn about some common productivity packages for Linux. In addition, you’ll likely want to install additional productivity software, so software package management is briefly covered at the chapter’s end.

Another major use of a Linux system is as a network server, so this chapter covers a few common server programs that you may encounter. Although you might not need to write programs, you may have to compile programs from source code, so you should also be familiar with the common Linux programming tools described in this chapter.

Using a Linux Desktop Environment

Chances are that your first experience with a working Linux system will involve a desktop environment. A desktop environment is a set of programs that control the screen, and it also provides small utility programs to perform tasks such as managing files. Linux provides several desktop environment options, so if you don’t like one, you can choose another. In addition to presenting information on available desktop environments, this section describes a few tools that you can use to launch programs and manage files.

Choosing a Desktop Environment

Depending on your Linux distribution and installation options, chances are good that your system has more than one desktop environment available. The most common desktop environments are as follows:

KDE Plasma  The K Desktop Environment (KDE) Plasma (kde.org) is a popular desktop environment for Linux. It’s the default desktop environment for openSUSE. It includes many powerful tools that integrate well, and it’s built using the Qt widget set.

images A widget set is a library that handles GUI features such as menus and dialog boxes. Qt and GTK+ (part of the GNU project) are two popular widget sets on Linux today.

GNOME  GNOME (gnome.org) is also popular in the Linux desktop environment arena. It is the default desktop environment for the Fedora and Ubuntu distributions. GNOME is built atop the GIMP Toolkit (GTK+) widget set. Like KDE Plasma, GNOME includes many powerful tools that work together. GNOME aims to provide an easy-to-use desktop environment.

Cinnamon  Originally based on GNOME, the Cinnamon desktop environment was initially available only for the Linux Mint distribution but is now supported by others. Its ease of use, flexibility, clean look, and overall friendly experience makes Cinnamon a great desktop environment for those who are new to Linux. but seasoned Linux users prefer it as well.

LXDE  The Lightweight X11 Desktop Environment, or LXDE (lxde.org), is, as its full name suggests, intended to consume few resources and therefore works well on old or modest computers. It is also built on the GTK+ widget set. LXDE is typically the default desktop environment on Linux distributions whose primary goal is to consume as few resources as possible while still being fully functional.

Xfce  This popular lightweight desktop environment can be found at xfce.org. It was originally modeled on a commercial desktop environment known as CDE, but it is built using the GTK+ widget set. Xfce provides more configurability than GNOME. It loads and runs applications quickly but consumes fewer system resources than most other desktop environments.

Build Your Own  It’s possible to build a desktop environment of your own from components that you like. Because this can be a rather complex task, it’s best to start with detailed guidance. Open your favorite web search engine, and type how to create your own Linux desktop environment to find specific information on building your custom desktop. At a minimum, you need a window manager. However, for the configuration to be a true desktop environment, you’ll need other components, such as a file manager and small productivity tools. All of the components need to be accessible from some sort of menu system.

Unfortunately, it’s impossible to give guidelines indicating when one desktop environment works better than another. However, the following recommendations can help. New users who are accustomed to Windows or macOS will probably be happiest with KDE Plasma. The KDE Plasma environment is similar to these traditional desktop operating systems’ environments. GNOME aims for elegance and ease of use, so it’s a good choice for those who want a nice-looking user interface. Xfce and LXDE are good choices on systems that are light on RAM or have low-powered CPUs. People who like to customize everything or who have less capable computers should investigate the build-your-own approach.

Before you decide to stick with a particular desktop environment, you may want to try out two or three of them. In most cases, you can install multiple environments by using a package manager, as described later in this chapter and in more detail in Chapter 9, “Exploring Processes and Process Data.”

After your additional desktop environment(s) is installed, you select it when you log into the computer via a menu. The example in Figure 4.1 shows a Linux Mint system login screen.

image

Figure 4.1 A typical Linux desktop login screen where you choose the user account

To choose the desktop environment on Linux Mint, you must click the mountain peaks button that is next to the username. An example of the resulting menu is shown in Figure 4.2.

image

Figure 4.2 GUI login managers usually provide a selection of desktop environments from which you can choose.

Menu choices on your Linux system will vary, depending on which desktop environments were installed by default and which ones were added manually. How to select a desktop environment varies from one distribution to another, so you may need to peruse your login screen’s options to select the environment that you want.

Launching Programs

imagesMost desktop environments provide several ways to launch programs. Details can vary considerably from one environment to another. However, useful examples include the following:

Desktop Menus  Many desktop environments provide menus along a top, bottom, or side edge of the screen. One or more items in these menus can give you access to a preselected set of applications.

Desktop Icons  In some desktop environments you can place icons in the main area of the desktop. Clicking or double-clicking these icons then launches the applications. This approach generally requires customization. Some default configurations place a few applications in the main desktop area.

Panels  Some desktop environments provide panels where icons for common applications appear; typically panels are on the sides of the screen. GNOME Shell (a version of the GNOME desktop environment) uses such a configuration by default—although the panel appears only when you click the Activities item in the upper-left corner of the screen.

Context Menus  You can sometimes right-click in an unused part of the screen to obtain a context menu with a variety of options, which may include the option to run programs.

Searching for Programs  Some desktop environments provide a search feature that you can use to find a program by name. This search feature may be on the main screen or within a desktop menu. Typically, you type part of a program’s name, and programs whose names match appear in a list. You can then select the program that you want to run from that list.

imagesTerminals  You can launch a program called a terminal, which provides a text-mode user interface inside a window. You can then run either text-mode or GUI programs by typing 
their filenames in this window. This approach is covered in more detail in Chapter 5, “Getting to Know the Command Line.”

To help clarify some of these methods, a couple of examples are in order. First, you’ll launch the Firefox web browser in the Fedora 30 Workstation distribution using the GNOME Shell desktop environment.

Follow these steps after you log into the system:

  1. Click the Activities item in the upper-left corner of the screen. The result is a panel (called Favorites) on the left side of the screen, as shown in Figure 4.3.
  2. Move the mouse over the Firefox icon, which is the topmost icon in Figure 4.3.
  3. Click the Firefox icon. After a brief delay, a Firefox window should open.

image

Figure 4.3 With panels you can launch popular programs in GNOME and some other desktop environments.

Other ways to do this also exist, such as typing the program’s name in the search field (visible at the upper middle of Figure 4.3). Because only a handful of programs appear in the GNOME Shell panel, you must either add programs to it or launch programs that the Fedora developers did not include by default in some other way.

For comparison, Cinnamon under Linux Mint 18.3 provides several obvious ways to launch Firefox:

  • By clicking its icon near the left side of the screen’s bottom panel (see Figure 4.4).
  • By finding its icon in the Favorites panel. You view this panel by clicking on the Menu icon on the far left-side of the screen’s bottom panel. The Favorites panel is located on the far left-side of the menu window (see Figure 4.4).
  • By locating it via the search feature, which is also located within the Menu system (see Figure 4.4).
  • By finding it in the Applications list within the Menu system. You open the Firefox application by entering into the Menu system, selecting Internet, and clicking the Firefox Web Browser icon.

image

Figure 4.4 Cinnamon’s desktop interface provides launch methods similar to those available in Windows.

With the various desktop environments the widest range of launch options are available for a handful of popular applications, such as Firefox. For less popular programs you may need to use the more complex methods, such as locating the program in the Applications list. You can, however, reconfigure the desktop environment to add programs that you use frequently.

images Each distribution sets up its defaults in its own way. Your own GNOME or Cinnamon configuration might not resemble the ones shown here.

Using a File Manager

images If you’re used to Windows or macOS, you’ve almost certainly used a file manager to manipulate your files. Linux, of course, provides a file manager for this purpose too—in fact, you have a choice of several, although most of them operate in a similar way. As an example, consider GNOME Files (formerly called Nautilus), which is GNOME’s default file manager. If you were running GNOME Shell on Fedora, the GNOME Files (sometimes just called Files) icon resembles a filing cabinet in the Favorites panel, as shown earlier in Figure 4.3. Your desktop environment may also launch a file manager when you insert a removable disk, such as a USB flash drive or DVD disc. Figure 4.5 shows GNOME Files running on a fresh installation.

image

Figure 4.5 GNOME Files provides a view of your files similar to that in other OSs’ file managers.

images Besides GNOME’s Files, other file managers include Nemo (Cinnamon’s file manager), Thunar (Xfce’s file manager), and Dolphin (KDE Plasma’s file manager).

Because GNOME Files is similar to the file managers in other OSs, chances are that you’ll be able to use its main features quite easily. A few items do deserve mention:

Home  The Home location refers to your home directory—that is, the directory where you store your own user files. Ordinarily, you’ll create all of your personal files in your home directory. The default view of GNOME Files, when you launch it manually, is of your home directory, as shown in Figure 4.5. The right pane shows the Home directory’s files and subdirectories.

Starred  You can add bookmarks (called Starred in GNOME Files) for locations not shown in the main panel. Navigate to the folder above the desired location, and right-click on the folder icon to open a drop-down menu (shown in Figure 4.6). Click the Star option on 
the menu list. Newly added bookmarks appear in the GNOME Files’ Starred panel location. You can star files as well.

image

Figure 4.6 You can star folders to enable quick access to directories that interest you.

images If you double-click a location, GNOME Files will attempt to access it.

Document Properties  You can right-click a file and select Properties from the resulting drop-down menu. This produces a Properties dialog box, as shown in Figure 4.7. The Open With tab lets you associate a document type with an application.

image

Figure 4.7 GNOME Files lets you associate document types with applications.

Working with Productivity Software

The area of productivity software is extremely broad. Hundreds, if not thousands, of productivity applications exist, and entire books have been written about many of them. Therefore, in this chapter we give the names and brief descriptions of only a few productivity tools for common categories. The common tool categories include web browsers, email clients, office tools, multimedia applications, cloud computing, and mobile applications. Before describing these tools, it’s best to review a few tips on how to find a program to perform a particular task in Linux.

Finding the Right Tool for the Job

Linux provides productivity applications in many broad categories, but if you’re not already familiar with the field, you might have a hard time tracking them down. This is particularly true because application names don’t always clearly identify their purpose.

A few techniques can help you to find suitable applications:

Using Desktop Menus  You can use the menus or other application display tools on your desktop environment to locate productivity applications. Such tools often categorize applications in helpful ways. For example, the KDE Kickoff Application Launcher (shown previously in Figure 4.4) breaks applications down into categories (Accessories, Graphics, Internet, and so on) and subcategories, Photography and Scanning in the Graphics category, for instance. This can help you track down an application, but only if it’s already installed.

Using Search Features  You may be able to use a search feature, either in a desktop environment or in a web browser, to locate a suitable application. Typing in a critical word or phrase, such as office (in conjunction with Linux if you’re doing a web search) may help you locate office applications (word processors, spreadsheets, and so on).

Using Tables of Equivalents  If you normally use a particular Windows application, you may be able to find a Linux substitute for it by consulting a table of equivalent applications, such as the one at wiki.linuxquestions.org/wiki/Linux_software_equivalent_to_Windows_software.

Using Others’ Expertise  You can ask other people—coworkers, friends, or people in online forums—for help in finding a suitable application. This technique is particularly helpful if you’ve performed a basic search but have found nothing that meets your specific criteria.

Some of these methods, such as using desktop menus, can find only software that’s already installed. Other techniques, such as web searches, can find programs that you don’t have installed. You can usually install software with the help of your distribution’s packaging system.

Using a Web Browser

Linux supports a variety of web browsers, including the following:

Chrome  Google’s Chrome browser (google.com/chrome) aims to be fast and easy to use. Since its introduction in 2008, it’s gained rapidly in popularity. Although Chrome is technically a commercial project, it’s available free of charge. An open source variant, known as Chromium, is also available.

imagesFirefox  This program can be found at mozilla.org. It is the most popular browser for Linux, and it is also quite popular on Windows and macOS. It’s a complete browser, and thus it can consume a lot of memory, so it may not be the best choice on an older or weaker computer.

Web  This program, originally called Epiphany, is found at wiki.gnome.org/Apps/Web. As the web browser for the GNOME desktop, it’s designed to be simple and easy to use.

Konqueror  This KDE program serves a dual function: it’s both a web browser and a file manager. Konqueror does a good job with most web pages. It’s fairly lightweight, and so it is well worth trying, particularly if you use KDE Plasma. You can read more about it at kde.org/applications/internet/org.kde.konqueror.

Lynx  Most web browsers are GUI programs that display text in multiple fonts, show graphics inline, and so on. Lynx (lynx.browser.org) is unusual in that it’s a text-based web browser. As such, it’s a useful choice if you run Linux in text mode or if you don’t want to be bothered with graphics. Lynx is also useful as a test browser when you develop your own web pages; if a page is readable in Lynx, chances are that visually impaired people who browse the web with speech synthesizers will be able to use your page.

Opera  An unusual commercial entrant in the Linux web browser sweepstakes, Opera (opera.com) claims to be unusually fast. Although Opera is commercial, you can download it at no charge.

Notably absent from this list is a Microsoft browser. Unfortunately, some websites won’t work with anything but a Microsoft browser. Other sites are somewhat picky but can work with at least one Linux browser. Thus you should probably install at least two Linux web browsers.

Web browsers give users easy access to a world of information—literally! Unfortunately, the web has a dark side, too. Problems include the following:

  • Websites can log user access data, which can be used in marketing or in other ways that you might not like.
  • Much web-based content is dynamic, meaning that websites download small programs that your web browser runs. This content might be harmless, but it’s increasingly being used to deliver malware.
  • Malicious websites can trick users into giving up sensitive data, such as financial information, by pretending to be a trusted site. This technique is known as phishing.
  • Some websites are not secure. Data transferred can be read on intervening computers. Most sites, especially Internet banking sites and online retailers, encrypt their sensitive data, but you should be cautious when sending such data.
  • Because of security concerns, passwords used on most websites are subject to theft. This can pose a dilemma because it can be hard to remember all of your website passwords. Many browsers can do this for you, but that stores your passwords on your hard disk, which makes them vulnerable to theft or loss.

imagesChapter 13, “Creating Users and Groups,” describes how to create passwords that are both memorable and hard to guess.

Some of these problems aren’t unique to the web, of course. For instance, most email transfers are insecure, so you shouldn’t send sensitive data via email.

Using Email Clients

Email client programs enable you to read and write email messages. Such programs can either access a mailbox on your own computer or, using email network protocols described later, send and receive email with the help of network mail server computers. Common Linux email clients include the following:

Evolution  This program, located at wiki.gnome.org/Apps/Evolution, is a powerful GUI email client. It also includes address book and scheduling features.

KMail  The KDE project’s KMail can be found at userbase.kde.org/KMail. It is well integrated into the KDE Plasma desktop environment, but you can use it in other desktop environments if you elect to do so.

Mutt  This is one of several text-based email readers. Despite its text-mode interface, Mutt is quite capable. You can read more about it at mutt.org.

imagesThunderbird  This application, located at thunderbird.net, is an email client that’s closely associated with the Firefox web browser.

Email clients work in a similar way in any OS. Typically, you must configure them to know how to send and receive messages—whether to use the local computer’s facilities or remote servers. Thereafter, you can read incoming messages and send outgoing messages.

Using Office Tools

Linux has several office packages available with some combination of word processors, spreadsheets, presentation programs, graphics programs, databases, and sometimes other programs. Examples include the following:

Calligra  This office suite was born out of a split from an earlier popular KDE office suite, called KOffice. Although KOffice is no longer maintained, Calligra (calligra.org) is thriving. Its office suite includes Words (word processor), Stage (presentation), Sheets (spreadsheet), Flow (flowcharting), and Kexi (database). Besides office applications, Calligra offers Graphics and Project Management software products.

imagesApache OpenOffice  This office suite, located at openoffice.org, was called OpenOffice.org until its corporate sponsor, Oracle, donated it in 2011 to the Apache group, who is actively maintaining it. The official name is currently Apache OpenOffice. It provides six applications: Writer (word processor), Calc (spreadsheet), Impress (presentation), Base (database), Draw (vector graphics), and Math (equation editor).

imagesLibreOffice  This office suite was created as a fork of the older pre-Apache OpenOffice.org. It’s becoming the most popular office suite in Linux. It provides six applications: Writer (word processor), Calc (spreadsheet), Impress (presentation), Base (database), Draw (vector graphics), and Math (equation editor). You may have noticed that these applications have the same names as the Apache OpenOffice applications. You can read more about it at libreoffice.org.

images The fork of a program results when a single project splits into two projects, typically because different groups of developers have diverging goals.

Most of these programs support the OpenDocument Format (ODF), which is an open set of file formats that’s slowly making inroads as a standard for word processing, spreadsheet, and other office files. Although ODF is intended to enable easy transfer of files across applications, application-specific assumptions often hinder such transfers, especially on complex documents.

Many other programs exist in this space, although they are not part of an office suite. Some are unusual. For instance, LyX (lyx.org) can take the place of a word processor, but it’s built in a unique way to create and edit LaTeX documents. LaTeX is a document format that’s popular in computer science, mathematics, and other technical fields.

Using Multimedia Applications

Linux has an excellent reputation as a workhorse server platform, but its capacity as a multimedia OS was lacking. This was largely due to the absence of multimedia applications. In the last few decades, however, the list of multimedia applications has grown considerably. Current offerings include the following:

Audacity  This audio editor, found at sourceforge.net/projects/audacity, is similar to commercial products like Sound Forge for other platforms. You can use it to cut sections from an audio file, equalize volume, remove undesired noises, apply artificial audio effects, and more.

Blender  You can use this 3D creation suite to create complex 3D images, including both stills and animations. You can learn more about Blender at blender.org.

Castero  This text-based podcast client allows you to subscribe to your favorite podcasts (and lots of them), easily search for new podcasts, view playlists, and more. You can explore information about this program at github.com/xgi/castero.

imagesGIMP  The GNU Image Manipulation Program (GIMP) (gimp.org) is a still-image manipulation program similar in broad strokes to Adobe Photoshop. (The GTK+ toolkit, which is the basis of GNOME and many other programs, was originally created for the GIMP.)

ImageMagick  This is a suite of graphics programs with a twist: you typically use the ImageMagick programs from the command line. You can use it to convert file formats, add frames to images, resize images, and so on. You can learn more at imagemagick.org.

Open Broadcaster Software (OBS) Studio  Live video streaming is possible with OBS Studio. In addition, this application allows you to record video and capture audio on your Linux desktop. It is a powerful program that offers lots of configurable features, so it takes some time to learn, and works best with a multiscreen setup. You obtain it from obsproject.com.

images A few motion pictures that used effects rendered via Linux include Titanic, the Shrek series, and Avatar. Many animated motion pictures were completely rendered using Linux, including Netflix’s Next Gen, which was created entirely using Blender.

Kdenlive  If you need to edit the videos you are producing with OBS, Kdenlive (kdenlive.org) is the solution. It allows you to perform basic video editing all the way to professional adaptations. And almost any recorded audio or video formats can be used with Kdenlive—no need for conversion or recoding.

Given this range of multimedia applications, you can use Linux for everything from cropping photos of your two-year-old’s birthday party to rendering the effects for major motion pictures. If you have very special needs, digging a bit may turn up something else—this list is just the start!

Using Linux for Cloud Computing

Public cloud computing is the storage of computer software and/or data over the Internet, rather than storing it locally on your computer. In this term, cloud represents the Internet and computing represents what you are doing over the Internet. In some cases, users access cloud-computing resources via a web browser. Thus, in theory, Linux can function as a cloud-
computing client platform—just launch a web browser to access the cloud-computing 
provider and away you go.

In practice, complications can arise when you access public cloud-computing services. For instance, a cloud-computing provider might require that you use a particular web browser or have a specific browser plug-in installed. In some cases, it might be impossible to meet these requirements in Linux; however, if the provider supports a wide range of browsers as clients, you shouldn’t have problems using cloud-computing resources.

A few notable public cloud-computing resources include the following:

Private cloud computing is a slightly different technology in that the cloud is your company’s (or home’s) network and its local resources, instead of the Internet. Thus, a private cloud is sometimes called an enterprise or internal cloud. Using this type of cloud provides higher security but requires more local management and resources.

images Using Linux as the server, you can set up a private cloud for file hosting via one of the following software suite resources:

These software suites provide services similar to Dropbox, but instead of being 
stored remotely in a public cloud environment, the files are typically stored locally (called self-hosting). However, you can get fancy with these private-cloud software suites by allowing integration of file hosting on operating systems that you install on other cloud providers, such as Amazon Web Services (AWS), Google Cloud, and Microsoft Azure. Operating systems that you install on a cloud provider are often referred to as infrastructure as a service (IAAS).

images Cloud-computing resources are often hosted on servers owned by companies called cloud providers. One example is the popular social media app, Twitter, which runs on Google Cloud. Cloud providers utilize powerful hardware servers to offer individual virtualized machines (simulated computer systems that appear and act as physical machines) to their clients. Typically, they use Linux as the operating system for the hardware server. But what’s really interesting is that Linux is often the operating system occupying the client’s virtualized computer as well.

Using Mobile Applications

images Although Android is a Linux-based OS, for the most part it runs entirely different applications than do desktop or server implementations of Linux. This is understandable—chances are that you wouldn’t want to try to write a long document, such as a book, with a cell phone. Many of the features in a big office program, such as LibreOffice’s Write, would go to waste on a mobile computing device.

Instead, mobile computing typically focuses on small programs known as apps. In the case of Android, you can download apps by using an app called Google Play. (A web-based version is available at play.google.com/store.) Apps typically provide quick and specialized computation, often employing features of the phone. For instance, an app can calculate the calories that you’ve burned while riding a bicycle or retrieve a weather forecast for your area. Both of these examples use your phone’s GPS features to identify the phone’s (and your) position.

Although most Linux applications for desktop and server computers are open source and available free of charge, some Android apps are not free. Be sure to check the cost before you download an app.

images Android apps are increasingly a source of malware. You can minimize your risk by downloading apps only from Google Play or other trustworthy app stores.

Using Server Programs

Linux is a powerful OS for running server programs, so it should come as no surprise that you can find a wide variety of server programs for Linux. In this section, some common server protocols and the programs that use them are described. In addition, the process of installing and launching servers is covered as well as basic information on server security issues.

Identifying Common Server Protocols and Programs

Networks, including the Internet, function by means of network protocols. Network protocols are clearly defined descriptions of how two computers should exchange data to achieve a particular end, such as transferring email or delivering a file to be printed. Most protocols are described in one or more standards documents, known as request for comments (RFC) documents, each of which has a number. Typically, one RFC document defines the protocol, and over time additional RFC documents define extensions or protocol modifications as they become necessary.

Most network protocols involve transferring data over one or more ports, which are numbered resources on a computer. You can think of a port as being something like a room number in a building on a college campus—the main number (an Internet Protocol, or IP, address) identifies the computer as a whole, and the port number identifies the protocol being used. A server program attaches itself to a port number and receives all incoming requests on that port.

Table 4.1 summarizes some common port numbers, the protocols with which they’re associated, and the Linux programs that are often used in conjunction with these protocols. Many ports and protocols are associated with more than one program. This is because Linux provides choices for many protocols; you can choose which of several server programs to use for a given protocol, just as you can choose which of several word processors or web browsers to use.

images The /etc/services file links common port numbers to short names that are often used in other configuration files.

images

Table 4.1 Common port numbers and their purposes

Port number Protocol Common server program(s) Explanation
20–21 FTP oftpd, ProFTPD, 
Pure-FTPd, vsftpd The File Transfer Protocol (FTP) is an old protocol for transferring files over a network. It supports both anonymous and password-mediated access. FTP is unusual in that it uses two ports.
22 SSH OpenSSH The Secure Shell (SSH) is an encrypted remote access tool. It also supports file transfers and encrypting other protocols.
23 Telnet telnetd Telnet is an old unencrypted remote login protocol. It’s seldom used today, although its client program, Telnet, can be a useful network diagnostic tool.
25 SMTP Postfix, qmail, sendmail The Simple Mail Transfer Protocol (SMTP) is the main protocol for moving email on the Internet. The sender initiates SMTP transfers.
53 DNS dnsmasq, named The Domain Name System (DNS) enables computers to look up an IP address by providing a hostname, or vice versa. Without it, you’d need to refer to all computers by IP address rather than by name.
67 BOOTP, DHCP dnsmasq, dhcpd The Bootstrap Protocol (BOOTP) and its younger cousin, the Dynamic Host Configuration Protocol (DHCP), both enable a computer on a local network to help automatically configure other computers to use a network.
80 HTTP Apache HTTPD, NGINX The Hypertext Transfer Protocol (HTTP) is the basis of the World Wide Web (WWW, or simply the web).
109–110 POP2 and POP3 Courier, Cyrus IMAP, Dovecot, UW IMAP The Post Office Protocol (POP) has gone through several revisions, each with its own port. This protocol enables a recipient to initiate an email transfer, so it’s often used as the last leg in email delivery, from a server to the recipient.
118 SQL

MySQL, PostgreSQL,

MariaDB

The Structured Query Language (SQL) is a network-enabled database interface language. If you run a SQL server on your network, client computers can access and modify that database.
137–139 SMB/CIFS Samba Microsoft uses the Server Message Block (SMB)/Common Internet File System (CIFS) protocols for file and printer sharing, and Samba implements these protocols in Linux.
143, 200 IMAP Courier, Cyrus IMAP, Dovecot, UW IMAP The Internet Message Access Protocol (IMAP) is another recipient-initiated email transfer protocol, similar to POP. IMAP makes it easier for recipients to store and manage email on the server computer permanently, though.
389 LDAP OpenLDAP The Lightweight Directory Access Protocol (LDAP) is a network protocol for accessing directories, which in this context are a type of database. LDAP is often used to store network login information, among other things.
443 HTTPS Apache HTTPD, NGINX This protocol is a secure (encrypted) variant of HTTP.
2049 NFS NFS The Network File System (NFS) is a protocol, and a server of the same name, for file sharing between Unix and Unix-like OSs.

Table 4.1 is incomplete; it summarizes only some of the more important protocols and the servers that deliver them. Numerous other protocols and servers exist, many of them for very specialized tasks.

imagesChapter 15, “Managing Network Connections,” describes network configuration in greater detail.

Some protocols are most often used on local networks. For instance, DHCP by its nature is intended to help you manage your own local network by making it easier to configure client computers—just tell the computers to use DHCP, and that’s it. SMB/CIFS is also usually employed only locally in order to enable users to access one another’s files and printers more easily. Protocols like HTTPS, on the other hand, are generally used on the Internet as a whole, although they can also be used on local networks.

image
Server Programs and Server Computers

The term server can apply to an entire computer or to a single program running on that computer. When applied to a computer as a whole, the term identifies the purpose of the computer and the fact that it runs one or more server programs. Server computers typically provide services that are used by anywhere from a handful to millions of client 
computers—that is, the computers that use a server’s services.

In the networking world, a server (computer or program) listens for a connection from a client (computer or program) and responds to data transfer requests. Server computers are often—but not always—more powerful than their clients.

When you read the word server (or client, for that matter), it may refer either to a computer or to a program. The context usually makes it clear which meaning is intended, although sometimes this isn’t the case—in fact, sometimes the speaker or writer may not know! For instance, somebody might report “The Samba server isn’t working.” In such a case, you need to figure out whether it’s the Samba server program or something else on the server computer that’s causing problems.

Sometimes, the client-server lines can get blurred. For instance, in office settings, it’s common for many computers to function as file servers by running file server software such as Samba or NFS. Such a configuration enables Sam to make her files available to Cameron and for Cameron to make his files available to Sam. In this situation, both computers function as both client and server and run both types of software. In any given exchange, though, only one is the client and one is the server.

Focusing on Web Servers

A web server delivers web pages to internal and/or external network users. If you have ever used the World Wide Web, you have most likely used two popular web servers that are offered on Linux:

imagesApache HTTPD  The Apache HTTPD server is part of the prevalent Linux, Apache, MySQL, PHP (LAMP) stack for web applications. The original web server software package was released in 1995. Within less than a year, Apache became the most popular web server on the Internet. It has continued to maintain this level of popularity due to its stability and dependability. The Apache HTTPD server is available not only for Linux, but also for Unix, BSD, Windows, and even macOS. You can learn more at httpd.apache.org.

imagesNGINX  Released in 2002, the NGINX (pronounced Engine X) web server is a relative newcomer to the market. NGINX can retrieve resources on behalf of a client from one or more servers, as well as operate as a mail server. Because of these features, and the fact that it is fast and lightweight, NGINX has won over some major websites, such as Netflix. You can learn more at nginx.org.

The best feature of these two web servers is that you don’t have to choose one or the other. Many server administrators choose a dual setup, using both Apache HTTPD and NGINX. Sometimes a side-by-side architecture is deployed, with each server handling what it does best—Apache managing dynamic content and NGINX managing static content (the same display for every user). Others deploy an Apache-in-Back (or NGINX-in-Front) architecture, allowing NGINX to shine with its resource-retrieval services, and the stable Apache still providing dynamic content as needed.

Installing and Launching Servers

The topic of maintaining server programs is beyond the scope of this book, but you should be aware of the basics of this task. You can install servers in the same way that you install other software, as described later in this chapter and in more detail in Chapter 9.

After the software is installed, you must launch a server. You do this differently than the way you launch a desktop application. Instead of clicking an icon or menu entry in a GUI, you typically launch a server by configuring the computer to run it automatically whenever it boots. Thereafter, the server program runs in the background, as a daemon—that is, as a process that runs unattended.

images The word daemon derives from Greek mythology; daemons were helpful supernatural beings, just as Unix and Linux daemons are helpful programs.

Most servers are started automatically when Linux boots. You can also open a terminal program and type a text-mode command along with a keyword such as start or stop to start or stop the server manually. The nature of server program startup has been changing with recent distributions, and the topic is beyond the scope of this book. However, it is helpful to know that various distributions use a particular initialization daemon both to start and to manage the various server daemons. Be sure to consult your distribution’s documentation to determine which initialization daemon it uses from the following list:

  • System V init (SysV init)
  • systemd
  • Upstart

Some servers run via a super server, such as xinetd. These server programs run constantly, keeping the servers they manage unloaded except when they’re needed. This configuration can minimize the memory impact of running many seldom-used servers. The super server can also function as a security feature, like a bouncer, and keep out the troublemakers.

Securing Servers

Whenever you run a server, you also run the risk of its being compromised and abused. Risks fall into several categories:

  • Servers can contain bugs that enable outsiders to abuse the software to run programs locally.
  • You can misconfigure a server, granting an outsider greater access to your system than you had intended.
  • Users with accounts and remote access via a server can abuse this trust. This risk is particularly great if combined with a server bug or misconfiguration.
  • A server can be used as a stepping-stone to attack others, making it appear as if an attack originated from your computer.
  • Even without breaking into a computer, an attacker can swamp a server with bogus data, thus shutting it down. This technique is called a denial-of-service (DoS) attack.

Server security is an extremely complex topic, and details vary from one server to another. For instance, if you run a server such as a remote login server, Samba, or a POP or IMAP email server, you probably want to pay careful attention to password security, since all of these servers rely on passwords. Passwords are unimportant to a DHCP or DNS server, though. Of course, even if a DHCP or DNS server program doesn’t use passwords, other server programs running on the same computer might.

Broadly speaking, securing a server requires paying attention to each of the risk factors just outlined. Specific steps that you can take to secure your servers include the following:

  • You should keep your server programs up-to-date by using your package management tools to upgrade servers whenever upgrades become available. You can also research specific servers to pick ones that have good security reputations.
  • You should learn enough about server configuration to be sure that you can configure your servers properly.
  • You should remove unused accounts and audit necessary accounts to be sure that they use strong passwords.
  • You can use firewall configurations to restrict outsiders’ access to server computers that are intended for internal use only. You can also use firewalls to minimize the risk of one of your computers being used to attack others.

Managing Programming Languages

Many users never need to deal with programming languages; however, basic knowledge of what they are and how they differ from one another is important for Linux users for a variety of reasons. You might need to install languages for users on systems that you manage or for yourself to compile software from source code. You might also want to learn about programming, particularly if you want to automate computer management tasks using shell scripts.

This section presents basic information on programming languages. It begins by describing the differences between compiled and interpreted languages, which are important to understand so that you can properly handle program files or choose which you want to use. Brief descriptions of some common programming languages are also provided so that you can identify and use their source code files or choose which language you want to learn to use.

Choosing a Compiled vs. an Interpreted Language

At their core, computers understand binary codes—numbers that represent operations, such as adding two numbers or choosing which of two actions to take. People, however, are much better at handling words and symbols, such as + or if. Thus most programming involves writing a program in a symbolic programming language and then translating that symbolic code into the numeric form that computers understand. Dozens, if not hundreds, of such programming languages exist, each with its own unique features.

Among high-level languages, two broad categories exist:

Compiled Languages  Programmers convert (or compile) a program written in a high-level language from its original source code form into the machine code form. The compilation process can take some time—typically a few seconds to several hours, depending on the size of the program and the speed of the computer. Compilation can also fail because of errors in the program. When the compilation succeeds, the resulting machine code executes quickly.

Interpreted Languages  Programs written in interpreted languages are converted to machine code at the time they’re run by a program known as an interpreter. The conversion happens on a line-by-line basis. That is, the program is never completely converted to machine code; the interpreter figures out what each line does and then does that one thing. This means that interpreted programs run much more slowly than compiled programs. The advantage is that interpreted programs are easier to develop, since you don’t need to deal with the compilation process. Interpreted programs are also easy to modify; just open the program file in a text editor and save it back. This feature makes interpreted languages useful for helping with system startup tasks that system administrators might want to change—administrators can make and test changes quickly.

Programming in Assembly Language

In addition to compiled and interpreted languages, another option is assembly language. This is a language with a simple one-to-one correspondence between machine code numbers and the symbols that the programmer uses. Assembly language is very low-level, which means that a skilled assembly language programmer can produce compact and efficient programs. Assembly language is not very portable, though; it takes a lot of effort to convert a program written for, say, the x86-64 CPU to run on an ARM processor. Writing assembly language programs is also harder than writing programs in most high-level languages. For these reasons, assembly language programs have become rarer as computers have become more powerful; the speed and size advantages of assembly language just aren’t very compelling for most purposes in the early 21st century.

In theory, most languages can be implemented either in compiled or interpreted form. In practice, though, most languages are most commonly used in just one form or the other.

Some languages don’t fit neatly into either category. See the “Programming in Assembly Language” sidebar for one important exception. Some others fall into an in-between category, such as Java, which is compiled from source code into a platform-independent form that must be interpreted.

Identifying Common Programming Languages

Linux supports a wide range of programming languages, including the following:

Assembly  As noted earlier, this low-level language can produce efficient programs, but it is difficult to write and is not portable. In fact, referring to assembly as if it were one language is a bit misleading, since each CPU architecture has its own assembly language.

imagesC  C is arguably the most important compiled language for Linux, since most of the Linux kernel, as well as a huge number of Linux applications, are written in C. C can produce fairly efficient code, but it’s also easy to write buggy programs in C because it lacks some error-checking features that are common in many other languages. C source code files typically have filenames that end in .c or .h—the .c files are the main source code files, whereas the .h files are header files, which contain short definitions of the functions in the .c files, for reference by other files in a program. A large program can consist of dozens, if not hundreds or thousands, of individual source code files. In Linux, C programs are generally compiled with the gcc program, which is part of the GNU Compiler Collection (GCC) package.

imagesAlthough the Linux kernel is mostly written in C, parts of it are written in assembly language.

C++  C++ is an extension to C that adds object-oriented features, meaning that greater emphasis is given to data structures and their interactions than to the procedures used to control the flow of the program. Many complex Linux programs, such as KDE and Apache OpenOffice/LibreOffice, are written largely in C++. C++ source code files can have filenames that end in .cc, .cpp, .cxx, or .c++, with header files ending in .h, .hh, .hpp, .hxx, or .h++. In Linux, C++ is generally compiled with the g++ program, which is part of GCC.

imagesJava  Java was created by Sun Microsystems (now owned by Oracle) as a cross-platform language that’s somewhere between being compiled and interpreted. It’s become popular as a language for small applications delivered via websites, although some other programs are Java-based as well. Java source code usually has a name that ends in .java.

imagesJavaScript  Java and JavaScript are often confused with each other, but they are different in many ways. One difference is that JavaScript is an interpreted scripting language. Also, it is one of the most popular website programming languages—far more common than Java. It works alongside Hypertext Markup Language (HTML) and Cascading Style Sheets (CSS) to provide a majority of the Internet’s web pages. Typically dynamic page information, such as animated graphics, scrolling jukeboxes, or interactive maps, is driven by JavaScript programs. Nearly all modern web browsers support JavaScript programs through built-in interpreters. A JavaScript source code file has a .js file extension.

imagesPerl  An interpreted language, Perl is designed for easy manipulation of text, but it’s a general-purpose language that can be used for many other tasks as well. Perl programs typically have filenames that end in .pl, .pm, or .t.

imagesPHP  The PHP: Hypertext Preprocessor, or PHP (a recursive acronym), language was created for use on web servers in order to generate dynamic content—that is, content that varies depending on the user, the time of day, or some other criterion. PHP is an interpreted language, and it requires a PHP-aware web server, such as Apache. Given such a server and appropriate configuration, a website can support user logins, shopping carts, different content based on users’ locations, and so on. PHP files most often have names that end in .php, although several variants are common.

imagesPython  The Python interpreted language makes code readability a major goal. It supports (but does not require) object orientation. It’s often used for scripting purposes, but it can be used to write more complex programs, too. Python programs often use .py filename extensions, although several variants of this are common too.

images The Python programming language’s name is a reference to the cult British TV show Monty Python’s Flying Circus.

imagesShell Scripting  Most Linux text-mode shells—the programs that enable entirely keyboard-based use of the computer—provide their own interpreted languages. Of these, the Bourne Again Shell (Bash) is the most common, so Bash scripting is quite common. Many of the files that control the Linux startup process are in fact Bash scripts. Such scripts frequently have no unique filename extension, although some use a .sh extension.

imagesChapter 11, “Creating Scripts,” covers the basics of creating or modifying Bash scripts.

Handling Software Packages

Installing programs on a Linux distribution has become easier through the years. However, how software is packaged, installed, and managed can vary greatly from distribution to distribution. It is important to understand these differences in order to take full advantage of the Linux programs discussed in this chapter. This section merely provides brief descriptions. More details on installing and managing software packages are provided in Chapter 9.

Understanding Software Packages

On Linux, software programs are bundled into a prebuilt package that has simplified their installation and management. Packages are managed on Linux using a package management system (PMS), which is discussed in detail in Chapter 9.

These packages are stored on repositories, which are official software storage servers on the Internet. The repositories can be accessed over the Internet via your Linux system’s local PMS utilities. The repositories have lots of software packages stored on them, ready to be explored or installed. Each Linux distribution’s developers work hard to maintain and protect their official repositories’ software packages. Thus, in most cases, it’s best to obtain programs from the default distribution repositories. Fortunately, your distribution’s PMS typically does this by default.

Identifying Common Package Tools

Each distribution uses its own PMS and package tools, which are discussed in more detail in Chapter 9. The following are a few of the primary tools used by the major PMSs:

imagesdpkg  A low-level package tool used as the foundation of the Debian-based family of PMS tools. It can be used directly to install, manage, and remove software packages. However, it is limited in function. For example, the dpkg tool cannot download software packages from the repositories.

imagesrpm  The rpm tool is also a low-level package tool similar in function to the dpkg utility. However, it is used as the foundation of the Red Hat Linux package management system. Though you can use rpm to manage packages, it’s best to use a higher-level PMS utility.

imagesapt-get  This is a text-mode tool for the Debian PMS. With apt-get, you can install from repositories and remove software packages from your local Linux system. In addition, you can perform package upgrades for individual packages, all of the packages on your system, or your entire distribution. However, you will need to use the apt-cache text-mode tool for determining various pieces of information concerning software packages.

imagesyum  This is a text-mode tool for the Red Hat PMS. It is used on distributions, such as Red Hat Enterprise Linux (RHEL), Fedora, and CentOS. With yum, you can install from repositories, remove software packages from your local Linux system, upgrade packages, and so on. In addition, you can use yum for determining various pieces of information concerning packages and their management, such as displaying a list of the PMS’s configured repositories.

Exercise 4.1

  • Try at least two Linux desktop environments. Use each desktop environment for your normal computing tasks for a day or two so that you can decide which you prefer.
  • Try at least two Linux web browsers. Use each to visit your favorite websites. Do you notice differences in speed or how the elements on the page are laid out? Which do you prefer?

Summary

When you’re just starting out with Linux, chances are that you’ll begin by using a desktop environment—the first set of programs that you see when you log in. A desktop environment enables you to run more programs, including common productivity tools such as web browsers, email clients, office utilities, and multimedia applications. If you’re configuring a computer as a server, of course, you’ll want to run server programs, but you’ll do this by editing configuration files rather than by launching them from a desktop environment. If you need to do programming, you should be aware of some common Linux programming languages, which enable you to write everything from trivial scripts to huge servers or productivity suites. If your distribution does not come with a needed desktop productivity program or server application preinstalled, you will have to install it via a package tool.

Exam Essentials

Summarize the major features of a Linux desktop.  A Linux desktop environment is a set of programs that control the screen, and it provides access to small utility programs to perform various productivity tasks. It consists of desktop menus (called context menus), which are often located around one or more of the environment window’s edges. Icons used to launch programs can be located in the menus or on the main desktop window. They may also be located within panels if provided by the environment. Search features are also provided either within menus or by clicking icons on the desktop. Text-mode interfaces are offered via a terminal program as well as file managers.

Explain Linux’s use in cloud computing.  Linux can function as a cloud-computing client platform by accessing cloud-based software via a web browser. It can also provide a private cloud via software such as ownCloud and Nextcloud. Due to its strong server software platform, Linux is often the hardware server operating system at cloud-computing provider companies. And it is often the OS used by the client virtual machine as well.

Specify different productivity software products.  On Linux, there are web browsers, such as Firefox, Chrome, Web, Konqueror, and Opera, available in the GUI. There’s even a text-based browser, Lynx, if you need one. For reading and sending email, you have a choice of Thunderbird, Evolution, Kmail, and Mutt (which is a text-based email client). If you need to create a presentation, write a document, or maintain a spreadsheet, on Linux you can use an application from an office suite, such as Calligra, Apache OpenOffice (previously called OpenOffice.org), and LibreOffice. For creating graphics, the choices include GIMP or Blender, and there is a suite of programs that work at the command line, ImageMagik.

Describe Linux programming languages.  Because Linux is a wonderful development platform, it supports several programming languages. Assembly is a low-level language, and its name actually refers to multiple languages, because each CPU’s architecture has its own version of it. Languages that require a program compiler on Linux include C and C++. JavaScript, Perl, PHP, Python, and the Bash shell are interpreted programming languages available for development on Linux. Java is also available, but it is both compiled and interpreted.

Provide an overview of the Linux PMS tools.  The tools for package management systems used on Debian-based systems include dpkg, apt-get, and apt-cache. Limited in function, the dpkg utility is used to install, manage, remove, and check the status of locally available packages. The apt-get and apt-cache tools provide the same features but can download and check on software packages residing on repositories.

Red Hat–based Linux systems use the rpm and yum PMS tools. The rpm utility provides functionality similar to dpkg, whereas yum offers services similar to a combination of what the apt-get and apt-cache tools furnish.

Review Questions

You can find the answers in the Appendix A.

  1. Which of the following are Linux desktop environments? (Choose all that apply.)

    1. GTK+
    2. GNOME
    3. KDE Plasma
    4. Evolution
    5. Xfce

  2. If you want to enable one Linux computer to access files stored on another Linux computer’s hard disk, which of the following network protocols is the best choice?

    1. SMTP
    2. NFS
    3. PHP
    4. DNS
    5. DHCP

  3. In which of the following languages was most of the Linux kernel written?

    1. Bash shell script
    2. Java
    3. C
    4. C++
    5. Perl

  4. True or false: OpenOffice.org forked from Calligra.

  5. True or false: Malicious outsiders can disrupt servers even if the computer that runs them is never broken into.

  6. True or false: Python is generally implemented as an interpreted language.

  7. Thunderbird is a(n) ________ program. (Specify the general category of the software.)

    1. web browser
    2. file manager
    3. email client
    4. office tool
    5. multimedia application

  8. A Linux server that handles the SMB/CIFS protocol normally runs the ________ software.

    1. ProFTPD
    2. telnetd
    3. named
    4. Dovecot
    5. Samba

  9. A program written in a(n)/the ________ programming language is completely converted to binary form before being run.

    1. Python
    2. compiled
    3. Javascript
    4. interpreted
    5. Perl

  10. You can install and manage various Linux software applications via a(n) ________ management system.

    1. office
    2. file
    3. email
    4. package
    5. program

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.222.32.67