Tag Archives: servers

Install Munin (Monitoring Tool) on Ubuntu 17.10 (Artful Aardvark) Server


Sponsored Link

Munin the monitoring tool surveys all your computers and remembers what it saw. It presents all the information in graphs through a web interface. Its emphasis is on plug and play capabilities. After completing a installation a high number of monitoring plugins will be playing with no more effort.

Using Munin you can easily monitor the performance of your computers, networks, SANs, applications, weather measurements and whatever comes to mind. It makes it easy to determine “what’s different today” when a performance problem crops up. It makes it easy to see how you’re doing capacity-wise on any resources.

Munin uses the excellent RRDTool (written by Tobi Oetiker) and the framework is written in Perl, while plugins may be written in any language. Munin has a master/node architecture in which the master connects to all the nodes at regular intervals and asks them for data. It then stores the data in RRD files, and (if needed) updates the graphs. One of the main goals has been ease of creating new plugins (graphs).

Preparing Your system

Install apache web server using the following command

sudo apt-get install apache2

Now proceed with munin server installation using the following command from your terminal

sudo apt-get install munin

Once the package is installed, you only need to make a few changes to get your installation working.

Configuring Munin server

You need to edit the /etc/munin/munin.conf file

sudo vi /etc/munin/munin.conf

Change the following lines

Change 1

#dbdir /var/lib/munin
#htmldir /var/cache/munin/www
#logdir /var/log/munin
#rundir /var/run/munin

to

dbdir /var/lib/munin
htmldir /var/www/munin
logdir /var/log/munin
rundir /var/run/munin

Change 2

#tmpldir /etc/munin/templates

to

tmpldir /etc/munin/templates

Change 3

the server name on the line localhost.localdomain should be updated to display the hostname, domain name, or other identifier you’d like to use for your monitoring server

# a simple host tree
[localhost.localdomain]
address 127.0.0.1
use_node_name yes

to

[MuninMonitor]
address 127.0.0.1
use_node_name yes

Change 4

You need to edit the munin apache configuration

sudo vi /etc/munin/apache.conf

Change the following line in the starting of the file

Alias /munin /var/cache/munin/www

to

Alias /munin /var/www/munin

and

We also need to allow connections from outside of the local computer for this do the following changes

<Directory /var/cache/munin/www>
Order allow,deny
Allow from localhost 127.0.0.0/8 ::1
Options None

to

<Directory /var/munin/www>
Order allow,deny
#Allow from localhost 127.0.0.0/8 ::1
Allow from all
Options None

you will need to create the directory path that you referenced in the munin.conf file and modify the ownership to allow munin to write to it:

sudo mkdir /var/www/munin

sudo chown munin:munin /var/www/munin

Now you need to restart the munin and apache services using the following commands

sudo service munin-node restart

sudo service apache2 restart

It might take a few minutes to generate the necessary graphs and html files. After about five minutes, your files should be created and you will be able to access your data. You should be able to access your munin details at:

http://yourserver_ip_address/munin

Screenshots

1

2

If you get an error message in your browser similar to the following, you need to wait longer for munin to create the files

Forbidden

You don’t have permission to access /munin/

Configure Remote Monitoring

Munin can easily monitor multiple servers at once.If you want to monitor remote servers you need to following this procedure.

First you need to install munin client package using the following commands

sudo apt-get install munin-node

Now you need to edit the munin-node.conf file to specify that your monitoring server is allowed to poll the client for information.

sudo vi /etc/munin/munin-node.conf

Search for the section that has the line “allow ^127.0.0.1$”. Modify the IP address to reflect your monitoring server’s IP address.If your server ip is 172.30.2.100

allow ^.172.30.2.100$

Save and exit the file

You need to restart the munin client using the following information

sudo service munin-node restart

Now you need to login in to your munin server and edit the munin.conf file

sudo vi /etc/munin/munin.conf

Copy the following section and change the ip address to your remote server client ip address

[MuninMonitor]
address 127.0.0.1
use_node_name yes

to

[MuninMonitor]
address 172.30.2.101
use_node_name yes

Finall you need to restart the apache server using the following command

sudo service apache2 restart

Additional Plugins

The munin-plugins-extra package contains performance checks additional services such as DNS, DHCP, Samba, etc. To install the package run the following command from the terminal

sudo apt-get install munin-plugins-extra

Make sure you have install this package on both the server and node machines.

Sponsored Link



Related posts

How to assign static ip address in Ubuntu 17.10 (Artful Aardvark)


Sponsored Link

From ubuntu 17.10 he package ifupdown and so /etc/network/interfaces are no longer used. Ubuntu 17.10 Server uses the package netplan instead, which configures systemd-networkd.

What is Netplan?

Netplan is a YAML network configuration abstraction for various backends (NetworkManager, networkd).

It is a utility for easily configuring networking on a system. It can be used by writing a YAML description of the required network interfaces with what they should be configured to do. From this description it will generate the required configuration for a chosen renderer tool.

Netplan reads network configuration from /etc/netplan/*.yaml which are written by administrators, installers, cloud image instantiations, or other OS deployments. During early boot it then generates backend specific configuration files in /run to hand off control of devices to a particular networking daemon.

You need add the ip address details in

/etc/netplan/01-netcfg.yaml

file.

Netplan Examples

If you want to add the ip address,gateway and DNS servers use the following syntax

enp0s8:
dhcp4: no
addresses: [192.168.56.10/24]
gateway4: 192.168.56.1
nameservers:
addresses: [8.8.8.8]

In the above example enp0s8 is interface name

If you want to add static routes add the following syntax

routes:
— to: 0.0.0.0/0
via: gateway address
metric: 1

Once you add the above syntax you can run the following commands as root to test & activate the configuration

sudo netplan –debug generate

sudo netplan apply

If you want more information related to netplan check this document.

Sponsored Link



Related posts

How to Change Your Linux Console Fonts | Linux.com


I try to be a peaceful soul, but some things make that difficult, like tiny console fonts. Mark my words, friends, someday your eyes will be decrepit and you won’t be able to read those tiny fonts you coded into everything, and then you’ll be sorry, and I will laugh.

Fortunately, Linux fans, you can change your console fonts. As always, the ever-changing Linux landscape makes this less than straightforward, and font management on Linux is non-existent, so we’ll muddle along as best we can. In this article, I’ll show what I’ve found to be the easiest approach.

What is the Linux Console?

Let us first clarify what we’re talking about. When I say Linux console, I mean TTY1-6, the virtual terminals that you access from your graphical desktop with Ctrl+Alt+F1 through F6. To get back to your graphical environment, press Alt+F7. (This is no longer universal, however, and your Linux distribution may have it mapped differently. You may have more or fewer TTYs, and your graphical session may not be at F7. For example, Fedora puts the default graphical session at F2, and an extra one at F1.) I think it is amazingly cool that we can have both X and console sessions running at the same time.

The Linux console is part of the kernel, and does not run in an X session. This is the same console you use on headless servers that have no graphical environments. I call the terminals in a graphical session X terminals, and terminal emulators is my catch-all name for both console and X terminals.

But that’s not all. The Linux console has come a long way from the early ANSI days, and thanks to the Linux framebuffer, it has Unicode and limited graphics support. There are also a number of console multimedia applications that we will talk about in a future article.

Console Screenshots

The easy way to get console screenshots is from inside a virtual machine. Then you can use your favorite graphical screen capture program from the host system. You may also make screen captures from your console with fbcat or fbgrab. fbcat creates a portable pixmap format (PPM) image; this is a highly portable uncompressed image format that should be readable on any operating system, and of course you can convert it to whatever format you want. fbgrab is a wrapper script to fbcat that creates a PNG file. There are multiple versions of fbgrab written by different people floating around. Both have limited options and make only a full-screen capture.

fbcat needs root permissions, and must redirect to a file. Do not specify a file extension, but only the filename:

$ sudo fbcat > Pictures/myfile

After cropping in GIMP, I get Figure 1.

It would be nice to have a little padding on the left margin, so if any of you excellent readers know how to do this, please tell us in the comments.

fbgrab has a few more options that you can read about in man fbgrab, such as capturing a different console, and time delay. This example makes a screen grab just like fbcat, except you don’t have to explicitly redirect:

$ sudo fbgrab Pictures/myOtherfile

Finding Fonts

As far as I know, there is no way to list your installed kernel fonts other than looking in the directories they are stored in: /usr/share/consolefonts/ (Debian/etc.), /lib/kbd/consolefonts/ (Fedora), /usr/share/kbd/consolefonts (openSUSE)…you get the idea.

Changing Fonts

Readable fonts are not a new concept. Embrace the old! Readability matters. And so does configurability, which sometimes gets lost in the rush to the new-shiny.

On Debian/Ubuntu/etc. systems you can run sudo dpkg-reconfigure console-setup to set your console font, then run the setupcon command in your console to activate the changes. setupcon is part of the console-setup package. If your Linux distribution doesn’t include it, there might be a package for you at openSUSE.

You can also edit /etc/default/console-setup directly. This example sets the Terminus Bold font at 32 points, which is my favorite, and restricts the width to 80 columns.

ACTIVE_CONSOLES="/dev/tty[1-6]"
CHARMAP="UTF-8"
CODESET="guess"
FONTFACE="TerminusBold"
FONTSIZE="16x32"
SCREEN_WIDTH="80"

The FONTFACE and FONTSIZE values come from the font’s filename, TerminusBold32x16.psf.gz. Yes, you have to know to reverse the order for FONTSIZE. Computers are so much fun. Run setupcon to apply the new configuration. You can see the whole character set for your active font with showconsolefont. Refer to man console-setup for complete options.

Systemd

Systemd is different from console-setup, and you don’t need to install anything, except maybe some extra font packages. All you do is edit /etc/vconsole.conf and then reboot. On my Fedora and openSUSE systems I had to install some extra Terminus packages to get the larger sizes as the installed fonts only went up to 16 points, and I wanted 32. This is the contents of /etc/vconsole.conf on both systems:

KEYMAP="us"
FONT="ter-v32b"

Come back next week to learn some more cool console hacks, and some multimedia console applications.

Learn more about Linux through the free “Introduction to Linux” course from The Linux Foundation and edX.

Step By Step Ubuntu 17.10 (Artful Aardvark) LAMP Server Setup


Sponsored Link

In around 15 minutes, the time it takes to install Ubuntu Server Edition, you can have a LAMP (Linux, Apache, MySQL and PHP) server up and ready to go. This feature, exclusive to Ubuntu Server Edition, is available at the time of installation.The LAMP option means you don’t have to install and integrate each of the four separate LAMP components, a process which can take hours and requires someone who is skilled in the installation and configuration of the individual applications. Instead, you get increased security, reduced time-to-install, and reduced risk of misconfiguration, all of which results in a lower cost of ownership.Currently this installation provide PostgreSQL database, Mail Server, Open SSH Server,Samba File Server, Print Server, Tomcat Java Server,Virtual Machine Host,LAMP and DNS options for pre-configured installations, easing the deployment of common server configurations.

Ubuntu LAMP server Install the following Versions

Ubuntu 17.10 (Artful Aardvark)
Apache 2.4.27
Mysql 5.7.20
PHP 7.1.8

First you need to download server version of Ubuntu from here after that create a CD and start booting with the CD Once it starts booting you should see the following screen in this you need to select your language and press enter

1

Now you need to select “Install Ubuntu Server” and press enter

2

Select your language and press enter

Select your location and press enter

If you want to try to have your keyboard layout detected by pressing a series of keys you need to select yes option.If you want to choose from a list click no

Select Origin of keyboard and press enter

Select keyboard layout and press enter

Detecting hardware to find CD-ROM Drivers in progress

Loading additional components in progress

Configures the network with DHCP if there is a DHCP server in your network

Enter your server Hostname

You need enter the Full name of the user you want to create for your server in this example i have created ubuntu user select continue and press enter

12

Enter your user account name here

13

Entered the password for test user select continue and press enter

9

Confirm password for test user

10

If you want to configure encrypted private directory select yes otherwise no and press enter

Configuring clock option

Detecting disks and all other hardware

You have to partition your hard disk in this example i have selected use entire disk option.If you want to do manually you can choose manual option and press enter.Make sure you have swap partition in place

Warning message about data lost on your hard disk

Guided Partitioning

Write the changes to disk here you need to select yes and press enter

Creating ext4 file system in progress

Installing system in progress

Configuring the package manager select continue and press enter

Configuring package mirror this will be related to your country option

Select and install software in progress

Select how do you want to configure automatic update press enter

Now it will start Installing software and here you need to select the server options here i have selected as openssh server and LAMP server installation.

At the time of software installation it will prompt for mysql server root password enter root password of your choice and select continue

12

Confirm mysql server root password and select continue

13

 

Software installation is in progress

Installing GRUB Boot loader in progress

Finishing installation in Progress

Installation complete message here you need to remove your CD select continue and press enter it will reboot your server

After rebooting your server it will prompt for username and password once you logged in you should see similar to the following screen

This will complete the Ubuntu 17.10 ubuntu LAMP Server Installation and your server is ready for installing applications which supports Apache2,Mysql and PHP7.

Configuring Static ip address in Ubuntu server

Ubuntu installer has configured our system to get its network settings via DHCP, Now we will change that to a static IP address for this you need to edit

Edit /etc/network/interfaces and enter your ip address details (in this example setup I will use the IP address 10.0.2.10):

sudo nano /etc/network/interfaces

and enter the following save the file and exit (In vi, ESC, then ZZ to save and exit)

# The primary network interface

auto enp0s3
iface enp0s3 inet static
address 10.0.2.10
netmask 255.255.255.0
network 10.0.0.0
broadcast 10.0.2.255
gateway 10.0.2.1

Now you need to restart your network services using the following command

sudo service networking restart

You need to setup manually DNS servers in resolv.conf file when you are not using DHCP.

sudo vi /etc/resolv.conf

You need to add look something like this
search domain.com
nameserver xxx.xxx.xxx.xxx

Sponsored Link



Related posts

Nethserver: An Ideal Server Platform for Your Small Business | Linux.com


If you run a small business, you might need an in-house operating system to serve as a veritable multi-tool. Many businesses opt for Microsoft Windows Small Business Server. However, if you’re looking to cut costs and work with open source software, you have plenty of choices, each of which can perfectly function to meet your small business needs.

One such option is the CentOS 7 based Nethserver. It’s an outstanding small business platform that’s flexible enough to be just what you need and nothing more. Once installed, you can add the software necessary make business happen. Nethserver is quick to install, easy to set up, and simple to manage.

The versions

When you visit the official site of Nethserver, you will notice there are different versions of the platform. Specifically, a Community and an Enterprise edition. I’m going to be discussing the Community options as it offers plenty of features, is community supported, and free.

Did I say “plenty of features”? I did. The feature list for the Community edition of Nethserver includes:

  • Easy to use web-based interface

  • Software Center, where you can add only the packages you need

  • Full data backup

  • Manual upgrades

  • CentOS 7 foundation for solid security and reliability

  • Built-in Samba Active Directory Controller

  • Nextcloud integration

  • Certificate management

  • Transparent HTTPS proxy

  • Greatly improved firewall

  • Built-in email server

The Software Center especially should appeal to many administrators and business owners. Why? Because Nethserver allows you to install only what you need to make your workflow manageable and easy.

Let’s install Nethserver

Installing Nethserver is as easy as installing CentOS 7. In fact, it’s exactly like the installation of everyone’s favorite open source server platform. If you’ve installed CentOS 7, you won’t have any trouble installing Nethserver. And the installation of the basic platform can be completed in about five to ten minutes.

Once you’ve downloaded the Nethserver ISO, burn it to a disk or USB drive, or place it in a directory your virtual machine platform can access. I’ll be installing Nethserver via VirtualBox, so there is at least one small variation to the installation. Said variation is making sure to set the Networking option (in VirtualBox) to Bridged mode (otherwise, the machines on your network will not be able to reach your Nethserver instance). Other than that, boot the Nethserver ISO and begin the installation.

As you can see (Figure 1), the Nethserver installation doesn’t change anything from CentOS 7.

After completing the basic installation, Nethserver will reboot. Upon rebooting, you will need to log in with the credentials you created during the installation. Once authenticated, you will be dropped into a bash prompt. Chances are, you may have not configured networking to use a static address. If that’s the case, issue the command ifconfig from the prompt to find your Nethserver IP address (we’ll change it to static in a bit).
With that IP address in hand, point a browser (on the same network) to https://SERVER_IP (Where SERVER_IP is the actual address of your Nethserver machine). In the next few screens you will need to answer some fairly simple questions. The first of these screens is just to welcome you to the setup wizard. Click NEXT. In the resulting window, you are asked if you want to skip the manual configuration and restore a backup file (Figure 2).

If this is a new installation, keep the box unchecked and click NEXT.

It’s time to set a fully qualified domain name. This is especially important for two reasons:

Chances are, you’re going to need that FDQN here (Figure 3). If you don’t have one, you can always use something like nethserver.localhost.localdomain and use the box for test purposes. However, once you need to start using Nethserver as a real business-class solution, you’ll need that FDQN.

The next few screens require you to do the following:

  • Set your timezone.

  • Set the SSH port (the default is 22, Nethserver recommends using port 2222).

  • Agree (or disagree) to send usage statistics.

Once you’ve completed the above screens of the wizard, you will land on the main Nethserver page, where you will be prompted to change the server from a DHCP to Static IP address (Figure 4).

Click the Edit button, select static (when prompted), and fill out the details for the static address (Figure 5).

Once you’ve done that, you will see a DNS tab, where you can set the necessary DNS servers. Chances are, Nethserver picked up the DNS servers from your network’s router. If you find Nethserver cannot reach the outside world, make sure to visit the DNS option and make that change.

Adding software

At this point, you need to install software. To do this, click on the Software Center entry under Administration. The first time you click the Software Center entry, it will take some time for it to populate the titles, before it becomes available. Give it time and the Software Center will finally appear, ready for you to install everything you need (Figure 6).

As this is a new installation, you will probably be informed of available updates. Before you install any software, click on the Updates tab and then click DOWNLOAD AND INSTALL. I will warn you that, because this is a new install, the upgrade process can take some time. Step away from the keyboard and undertake some other task. When you come back, you will probably see yet another DOWNLOAD AND INSTALL button. I recommend rebooting before you attempt to download and install the next upgrade. Keep repeating that until there are no more updates to download and install. Once there are no more updates, comb through the listing of software and install everything you need to make Nethserver your perfect small business server.

Adding users

Adding users for Nethserver isn’t quite the same as it might be on other Linux servers. You must first decide the method to be used to serve as the user directory. When you go to Management > Users and groups, you will be prompted to select between LDAP and Active Directory (Figure 7).

The route you choose will depend upon your needs. If you select LDAP, you will then have to set up a local LDAP server or bind a remote LDAP server. If you go the Active Directory route, you will have to either join a domain or create a new domain. Once you’ve either created a new local LDAP server or created a new Domain, you can then begin the process of adding users and groups.

Make it yours

That’s the gist of getting Nethserver up and running. Beyond that point, you will have to install and configure the server to make it perfectly fit your small business needs. Nethserver is very powerful and could easily take the place of the more costly Microsoft Small Business server. Give Nethserver a go and see if it doesn’t make for an outstanding solution for your business.