Install a Complete Mail Server with Postfix and Webmail in Debian 9

This tutorial will guide you on how to install and configure a complete mail server with Postfix in Debian 9 release. It will also cover how to configure accounts mailboxes using Dovecot in order to retrieve and compose mails via IMAP protocol. The users will use Rainloop Webmail interface as the mail user agent to handle mail.

Requirements

  1. Debian 9 Minimal Installation
  2. A static IP address configured for the network interface
  3. A local or a public registered domain name.

In this tutorial we’ll use a private domain account for mail server setup configured via /etc/hosts file only, without any DNS server involved in handling DNS resolution.

Step 1: Initial Configurations for Postfix Mail Server on Debian

1. In the first step, login to your machine with an account with root privileges or directly with the root user and make sure your Debian system is up to date with the latest security patches and software and packages releases, by issuing the following command.

# apt-get update # apt-get upgrade 

2. On the next step install the following software packages that will be used for system administration, by issuing the following command.

# apt-get install curl net-tools bash-completion wget lsof nano


3. Next, open /etc/host.conf file for editing with your favorite text editor and add the following line at the beginning of the file in order for DNS resolution to read the hosts file first.

order hosts,bind
multi on

4. Next, setup your machine FQDN and add your domain name and your system FQDN to /etc/hosts file. Use your system IP address to resolve the name of the domain and FQDN as illustrated in the below screenshot.

Replace IP address and domain accordingly. Afterwards, reboot the machine in order to apply the hostname properly.

# hostnamectl set-hostname mail.tecmint.com
# echo "192.168.0.102 tecmint.com mail.tecmint.com" >> /etc/hosts
# init 6
Set Hostname in Debian

Set Hostname in Debian

5. After reboot, verify if the hostname has been correctly configured by issuing the following series of commands. The domain name, the FQDN, the hostname and the IP address of the system should be returned by hostname command.

# hostname
# hostname -s
# hostname -f
# hostname -A
# hostname -i
# cat /etc/hostname 
Check Hostname in Debian

Check Hostname in Debian

6. Also, test if the domain correctly replies to local queries by issuing the below commands. Be aware that the domain won’t replay to remote queries issued by other systems in your network, because we’re not using a DNS server.

However, the domain should reply from other systems if you manually add the domain name to each of their /etc/hosts file. Also, be aware that the DNS resolution for a domain added to /etc/hosts file won’t work via host, nslookup or dig commands.

# getent ahosts mail.tecmint.com
# ping tecmint.com
# ping mail.tecmint.com
Query Domain DNS

Query Domain DNS

Step 2: Install Postfix Mail Server on Debian

7. The most important piece of software required for a mail server to function properly is the MTA agent. The MTA is a software built in a server-client architecture, which is responsible for mail transfer between mail servers.

In this guide we’ll use Postfix as the mail transfer agent. To install postfix in Debian from official repositories execute the following command.

# apt-get install postfix

8. During the installation process of Postfix you will be asked a series of questions. On the first prompt, select Internet Site option as the general type for Postfix configuration and press [enter] key to continue and then add your domain name to system mail name, as illustrated in the following screenshots.

Postfix Mail Configuration

Postfix Mail Configuration

Configure Postfix Mail Domain

Configure Postfix Mail Domain

Step 3: Configure Postfix Mail Server on Debian

9. Next, backup Postfix main configuration file and configure Postfix for your domain by using the following commands.

# cp /etc/postfix/main.cf{,.backup}
# nano /etc/postfix/main.cf

Now configure Postfix configuration in the main.cf file as shown.

# See /usr/share/postfix/main.cf.dist for a commented, more complete version
smtpd_banner = $myhostname ESMTP
biff = no
# appending .domain is the MUA's job.
append_dot_mydomain = no
readme_directory = no
# See http://www.postfix.org/COMPATIBILITY_README.html -- default to 2 on
# fresh installs.
compatibility_level = 2
# TLS parameters
smtpd_tls_cert_file=/etc/ssl/certs/ssl-cert-snakeoil.pem
smtpd_tls_key_file=/etc/ssl/private/ssl-cert-snakeoil.key
smtpd_use_tls=yes
smtpd_tls_session_cache_database = btree:${data_directory}/smtpd_scache
smtp_tls_session_cache_database = btree:${data_directory}/smtp_scache
# See /usr/share/doc/postfix/TLS_README.gz in the postfix-doc package for
# information on enabling SSL in the smtp client.
smtpd_relay_restrictions = permit_mynetworks permit_sasl_authenticated defer_unauth_destination
myhostname = mail.debian.lan
mydomain = debian.lan
alias_maps = hash:/etc/aliases
alias_database = hash:/etc/aliases
#myorigin = /etc/mailname
myorigin = $mydomain
mydestination = $myhostname, $mydomain, localhost.$mydomain, localhost
relayhost = mynetworks = 127.0.0.0/8, 192.168.1.0/24
mailbox_size_limit = 0
recipient_delimiter = +
inet_interfaces = all
#inet_protocols = all
inet_protocols = ipv4
home_mailbox = Maildir/
# SMTP-Auth settings
smtpd_sasl_type = dovecot
smtpd_sasl_path = private/auth
smtpd_sasl_auth_enable = yes
smtpd_sasl_security_options = noanonymous
smtpd_sasl_local_domain = $myhostname
smtpd_recipient_restrictions = permit_mynetworks,permit_auth_destination,permit_sasl_authenticated,reject

Replace the myhostname, mydomain and mynetworks variables to match your own configurations.

You can run postconf -n command in order to dump Postfix main configuration file and check eventual errors, as shown in the below screenshot.

# postconf -n
Postfix Mail Configuration

Postfix Mail Configuration

10. After all configurations are in place, restart Postfix daemon to apply changes and verify if the service is running by inspecting if Postfix master service is binding on port 25 by running netstat command.

# systemctl restart postfix
# systemctl status postfix
# netstat -tlpn
Start and Verify Postfix

Start and Verify Postfix

Step 3: Test Postfix Mail Server on Debian

11. In order to test if postfix can handle mail transfer, first install mailutils package by running the following command.

# apt-get install mailutils

12. Next, using mail command line utility, send a mail to the root account and check if the mail was successfully transmitted by issuing the below command in order to check mail queue and listing the content of the root’s home Maildir directory.

# echo "mail body"| mail -s "test mail" root
# mailq
# mail
# ls Maildir/
# ls Maildir/new/
# cat Maildir/new/[TAB]
Test Postfix by Sending Mail

Test Postfix by Sending Mail

13. You can also verify in what manner the mail was handled by postfix service by inspecting the content of the mail log file by issuing the following command.

# tailf /var/log/mail.log

Step 4: Install and Configure Dovecot IMAP on Debian

14. The mail delivery agent that we’ll be using in this guide to deliver e-mail messages to a local recipient’s mailboxes is Dovecot IMAP. IMAP is a protocol which runs on 143 and 993 (SSL) ports, which is responsible reading, deleting or moving mails across multiple email clients.

The IMAP protocol also uses synchronization in order to assure that a copy of each message is saved on the server and allows users to create multiple directories on the server and move mails to this directories in order to sort the e-mails.

This is not the case with POP3 protocol. POP3 protocol won’t allow users to create multiple directories on the server to sort your mail. You only have the inbox folder to manage mail.

To install Dovecot core server and Dovecot IMAP package on Debian execute the following command.

# apt install dovecot-core dovecot-imapd

15. After Dovecot has been installed in your system, open the below dovecot files for editing and make the following changes. First, open /etc/dovecot/dovecot.conf file, search and uncomment the following line:

listen = *, ::
Configure Dovecot Connection

Configure Dovecot Connection

16. Next, open /etc/dovecot/conf.d/10-auth.conf for editing and locate and change the below lines to look like in the below excerpt.

disable_plaintext_auth = no
auth_mechanisms = plain login

17. Open /etc/dovecot/conf.d/10-mail.conf file and add the following line to use Maildir location instead of Mbox format to store emails.

mail_location = maildir:~/Maildir
Configure Postfix Maildir

Configure Postfix Maildir

18. The last file to edit is /etc/dovecot/conf.d/10-master.conf. Here search for Postfix smtp-auth block and make the following change:

# Postfix smtp-auth
unix_listener /var/spool/postfix/private/auth {
mode = 0666
user = postfix
group = postfix
}
Configure Postfix SMTP Auth

Configure Postfix SMTP Auth

19. After you’ve made all the above changes, restart Dovecot daemon to reflect changes, check its status and verify if Dovecot is binding on port 143, by issuing the below commands.

# systemctl restart dovecot.service # systemctl status dovecot.service # netstat -tlpn
Start and Verify Dovecot

Start and Verify Dovecot

20. Test if the mail server is running properly by adding a new user account to the system and use telnet or netcat command to connect to the SMTP server and send a new mail to the new added user, as illustrated in the below excerpts.

# adduser matie
# nc localhost 25
# ehlo localhost
mail from: root
rcpt to: matie
data
subject: test
Mail body
.
quit
Test Postfix SMTP

Test Postfix SMTP

21. Check if the mail has arrived to the new user mailbox by listing the content of user’s home directory as shown in the below screenshot.

# ls /home/test_mail/Maildir/new/
Verify User Mail

Verify User Mail

22. Also, you can connect to user’s mailbox from command line via IMAP protocol, as shown in the below excerpt. The new mail should be listed in user’s Inbox.

# nc localhost 143
x1 LOGIN matie user_password
x2 LIST "" "*"
x3 SELECT Inbox
x4 LOGOUT

Step 5: Install and Configure Webmail in Debian

23. Users will manage their emails via Rainloop Webmail client. Before installing Rainloop mail user agent, first install Apache HTTP server and the following PHP modules required by Rainloop, by issuing the following command.

# apt install apache2 php7.0 libapache2-mod-php7.0 php7.0-curl php7.0-xml

24. After Apache web server has been installed, change directory path to /var/www/html/ directory, remove the index.html file and issue the following command in order to install Rainloop Webmail.

# cd /var/www/html/
# rm index.html # curl -sL https://repository.rainloop.net/installer.php | php

25. After Rainloop Webmail client has been installed in the system, navigate to your domain IP address and login to Rainloop admin web interface with the following default credentials:

http://192.168.0.102/?admin
User: admin
Password: 12345
Postfix Webmail Login

Postfix Webmail Login

26. Navigate to Domains menu, hit on Add Domain button and add your domain name settings as shown in the below screenshot.

Add Domain in Webmail

Add Domain in Webmail

27. After you’ve finished adding your domain settings, log out from Ranloop admin interface and point the browser to your IP address in order to log in to webmail client with an e-mail account.

After you’ve successfully logged in to Rainloop webmail you should see the email sent earlier from command line into your Inbox folder.

http://192.168.0.102
User: [email protected]
Pass: the matie password
Postfix Webmail User Login

Postfix Webmail User Login

Postfix Webmail User Inbox

Postfix Webmail User Inbox

27. To add a new user issue useradd command with -m flag in order to create the user home directory. But, first make sure you configure the Maildir path variable for every user with the following command.

# echo 'export MAIL=$HOME/Maildir' >> /etc/profile
# useradd -m user3
# passwd user3

28. If you want to redirect all root’s email to a specific local mail account from the system, run the below commands. All mails redirected or destined to root account will be forwarded to your mail user as shown in the below image.

# echo "root: test_mail" >> /etc/aliases
# newaliases

That’s all! You have successfully installed and configured a mail server at your premises in order for local users to communicate via e-mails. However, this type of mail configuration is not secured in any way and it’s advisable to be deployed only for small setups in systems and networks under your full control.

How to Install PHP 7 in CentOS 6

The CentOS 6 official software repositories has PHP 5.3 which has reached end of life and no longer actively maintained by the developers.

To keep up with the latest features and security updates, you need a newer (probably the latest) version of PHP on your CentOS 6 system.

If you’re looking to install different versions of PHP in CentOS 6, go through the following article.

  1. How to install PHP 5.4, PHP 5.5 or PHP 5.6 on CentOS 6

For the purpose of this guide, we will be operating the system as root, if that is not the case for you, make use of the sudo command to acquire root privileges.

Installing PHP 7 on CentOS 7


1. To install latest PHP 7, you need to add EPEL and Remi repository to your CentOS 6 system like so.

# yum install https://dl.fedoraproject.org/pub/epel/epel-release-latest-6.noarch.rpm
# yum install http://rpms.remirepo.net/enterprise/remi-release-6.rpm

2. Now install yum-utils, a group of useful tools that enhance yum’s default package management features.

Yum-utils can be used for manipulating package repositories and additional package management operations such as enabling or disabling packages without any manual configuration by a system administrator.

You can install it as follows:

# yum install yum-utils

3. In this step, you need to enable Remi repository using yum-config-manager utility, as the default repository for installing PHP.

# yum-config-manager --enable remi-php70 [Install PHP 7.0]

If you want to install PHP 7.1 or PHP 7.2 on CentOS 6, just enable it as shown.

# yum-config-manager --enable remi-php71 [Install PHP 7.1]
# yum-config-manager --enable remi-php72 [Install PHP 7.2]

4. Then finally install PHP 7 on CentOS 6 with all necessary PHP modules using the following command.

# yum install php php-mcrypt php-cli php-gd php-curl php-mysql php-ldap php-zip php-fileinfo 
Install PHP 7 on CentOS 6

Install PHP 7 on CentOS 6

If you are curious, double check the installed version of PHP on your system as follows.

# php -V 
Check PHP Version in CentOS 6

Check PHP Version in CentOS 6

You might also want to check out these useful PHP articles:

  1. How to Use and Execute PHP Codes in Linux Command Line
  2. How to Find MySQL, PHP and Apache Configuration Files
  3. How to Test PHP MySQL Database Connection Using Script
  4. How to Run PHP Script as Normal User with Cron

In this article, we have explained how to install PHP 7 on CentOS 6 Linux. You can send us any questions or additional thoughts via the feedback form below.

How to Disconnect Inactive or Idle SSH Connections in Linux

‘,
enableHover: false,
enableTracking: true,
buttons: { twitter: {via: ‘tecmint’}},
click: function(api, options){
api.simulateClick();
api.openPopup(‘twitter’);
}
});
jQuery(‘#facebook’).sharrre({
share: {
facebook: true
},
template: ‘{total}’,
enableHover: false,
enableTracking: true,
click: function(api, options){
api.simulateClick();
api.openPopup(‘facebook’);
}
});
jQuery(‘#googleplus’).sharrre({
share: {
googlePlus: true
},
template: ‘{total}’,
enableHover: false,
enableTracking: true,
urlCurl: ‘https://www.tecmint.com/wp-content/themes/tecmint/js/sharrre.php’,
click: function(api, options){
api.simulateClick();
api.openPopup(‘googlePlus’);
}
});
jQuery(‘#linkedin’).sharrre({
share: {
linkedin: true
},
template: ‘{total}’,
enableHover: false,
enableTracking: true,
buttons: {
linkedin: {
description: ‘How to Disconnect Inactive or Idle SSH Connections in Linux’,media: ‘https://www.tecmint.com/wp-content/uploads/2017/10/Auto-Disconnect-Idle-SSH-Sessions.png’ }
},
click: function(api, options){
api.simulateClick();
api.openPopup(‘linkedin’);
}
});
// Scrollable sharrre bar, contributed by Erik Frye. Awesome!
var shareContainer = jQuery(“.sharrre-container”),
header = jQuery(‘#header’),
postEntry = jQuery(‘.entry’),
$window = jQuery(window),
distanceFromTop = 20,
startSharePosition = shareContainer.offset(),
contentBottom = postEntry.offset().top + postEntry.outerHeight(),
topOfTemplate = header.offset().top;
getTopSpacing();
shareScroll = function(){
if($window.width() > 719){ var scrollTop = $window.scrollTop() + topOfTemplate,
stopLocation = contentBottom – (shareContainer.outerHeight() + topSpacing);
if(scrollTop > stopLocation){
shareContainer.offset({top: contentBottom – shareContainer.outerHeight(),left: startSharePosition.left});
}
else if(scrollTop >= postEntry.offset().top-topSpacing){
shareContainer.offset({top: scrollTop + topSpacing, left: startSharePosition.left});
}else if(scrollTop 1024)
topSpacing = distanceFromTop + jQuery(‘.nav-wrap’).outerHeight();
else
topSpacing = distanceFromTop;
}
});
]]>

Initial Server Setup and Configurations on CentOS 7

This tutorial will explain the first basic steps you need to go through after installing a minimal CentOS 7 system with no graphical environment in order to obtain information about the installed system, the hardware on top of which runs the system and configure other specific system tasks, such as networking, root privileges, software, services and others.

Requirements

  1. CentOS 7 Minimal Installation

Important: RHEL 7 users, can follow this article to do a Initial Server Setup on RHEL 7.

Update CentOS 7 System

The first step you need to perform on a fresh installed CentOS system is to make sure the system is up-to-date with the latest kernel and system security patches, software repositories and packages.

To fully update a CentOS 7 system, issue the following commands with root privileges.

# yum check-update
# yum upgrade


After the upgrade process completes, in order to release disk space you can remove all downloaded packages that where used in the process of upgrading alongside with all cached repositories information by executing the following command.

# yum clean all
Yum Clean All on CentOS 7

Yum Clean All on CentOS 7

Install System Utilities on CentOS 7

The following utilities packages can prove to be useful for day-by-day system administration: nano (text editor to replace vi editor), wget, curl (utilities used for downloading packages over network mostly) net-tools, lsof (utilities for managing local networking) and bash-completion (command line autocomplete).

Install them all in one-shot by executing the below command.

# yum install nano wget curl net-tools lsof bash-completion
Install System Utilities

Install System Utilities

Setup Networking in CentOS 7

CentOS 7 has a wide range of tools that can be used to configure and manage networking, from manually editing the network configuration file to using commands such as ip, ifconfig, nmtui, nmcli or route.

The easiest utility a beginner can use to manage and change network configurations is nmtui graphical command line.

In order to change the system hostname via nmtui utility, execute nmtui-hostname command, set your machine hostname and press OK to finish, as illustrated in the below screenshot.

# nmtui-hostname
Set Hostname in CentOS 7

Set Hostname in CentOS 7

To manipulate a network interface, execute nmtui-edit command, choose the interface you want to edit and select edit from the right menu, as shown in the below screenshot.

# nmtui-edit
Configure Network in CentOS 7

Configure Network in CentOS 7

Once you’re in the graphical interface provided by nmtui utility you can setup the network interface IP settings as illustrated in the below screenshot. When you finish, navigate to OK using [tab] key to save the configuration and quit.

Setup Network IP Address

Setup Network IP Address

In order to apply the network interface new configuration, execute nmtui-connect command, select the interface you want to manage and hit on Deactivate/Activate option to decommission and rise-up the interface with the IP settings, as presented in the below screenshots.

# nmtui-connect
Active Network Interface

Active Network Interface

In order to view the network interface settings, you can inspect the content of the interface file or you can issue the below commands.

# ifconfig enp0s3
# ip a
# ping -c2 google.com
Verify Network Configuration

Verify Network Configuration

Other useful utilities that can be used to manage speed, link state or obtain information about machine network interfaces are ethtool and mii-tool.

# ethtool enp0s3
# mii-tool enp0s3
Check Network Connection

Check Network Connection

An important aspect of your machine networking is to list all open network sockets in order to see what programs are listening on what ports and what’s the state of the established network connections.

To list all servers that have opened TCP or UDP sockets in listening state issue the following commands. However, UDP server won’t list any socket state due to the fact that UDP is a connectionless protocol which only sends packets over network and doesn’t establish connections.

# netstat -tulpn
# ss -tulpn
# lsof -i4 -6

Manage Services in CentOS 7

CentOS 7 manages daemons or service via systemctl utility. In order to list all services state, issue the following command.

# systemctl list-units
List All Services State

List All Services State

To check if a daemon or service is enabled to automatically start when the system starts, issue the following command.

# systemctl list-unit-files -t service
List Enabled Services

List Enabled Services

To list the old SysV services present in your system and disable them issue the following chkconfig commands.

# chkconfig --list
# chkconfig service_name off

5. Disable Unwanted Services in CentOS 7

It’s recommended after installing CentOS 7, to list what services are running in the system by running the above commands and disable and remove them in order to reduce the attacks vectors against your system.

For instance, Postfix daemon is installed and enabled by default in CentOS 7. If your system don’t require running a mail server, it’s best to stop, disable and remove the postfix service by issuing the below commands.

# systemctl stop postfix
# systemctl disable postfix
# yum remove postfix

In addition to netstat, ss, lsof or systemctl commands, you can also run ps, top or pstree commands in order to discover and identify what unwanted services are running in your system and disable or remove them.

By default, pstree utility is not installed in CentOS 7. To install it execute the following command.

# yum install psmisc
# pstree -p
List Linux Processes in Tree Format

List Linux Processes in Tree Format

Enable Firewall in CentOs 7

Firewalld is the main firewall utility that uses interacts with in order to manage iptables rules.
To enable and start and verify the firewall in CentOS 7, execute the following commands.

# systemctl enable firewalld
# systemctl start firewalld
# systemctl status firewalld

In order to open a specific service to incoming connections, first verify if the application is already present in firewalld rules and, then, add the rule for the service, as shown in the below example which allows SSH incoming connections. Use --permanent switch to add the rule permanently.

# firewall-cmd --add-service=[tab] #List services
# firewall-cmd --add-service=ssh
# firewall-cmd --add-service=ssh --permanent
Open Service in Firewalld

Open Service in Firewalld

In case the service is now already defined in firewalld rules, you can manually add the service port, as shown in the below example.

# firewall-cmd --add-port=22/tcp --permanent
# firewall-cmd --reload #Apply the rule on-fly

Enable Sudo Permissions on User Accounts

In order to grant root permissions for a normal user, first create the user by issuing adduser command, set the password for the user and grant root permissions to the user by executing the below command which adds the new user to the administrative wheel group.

# adduser tecmint
# passwd tecmint
# usermod -aG wheel tecmint

To test if the new user has root privileges, login to the system with user’s credentials and run yum command with sudo permissions, as shown in the below excerpt.

# su - tecmint
# sudo yum update
Verify Sudo User Permissions

Verify Sudo User Permissions

Configure SSH Public Key Authentication on CentOS 7

In order to secure SSH your server and set up public key authentication to increase the security of your server with a private SSH key to log in, first generate a SSH Key Pair with a following command.

Don’t not enter a passphrase in case you want to automate server management via SSH.

# ssh-keygen -t RSA

After the SSH key pairs had been generated, copy the key to the server you want to connect to by issuing the below command. Initially, enter you remote SSH user password in order to copy the public key.

# ssh-copy-id [email protected]_SERVER_IP

After the SSH public key has been copied to the remote server, login to the remote SSH server with the following command.

# ssh [email protected]_SERVER_IP

Finally, in order to secure the SSH server, make sure you disallow remote SSH access to the root account by opening the configuration SSH file /etc/ssh/sshd_config with your text editor as root and change it from Yes to No.

PermitRootLogin no

To apply the setting you need to restart the SSH service so that it will use the new configuration.

# systemctl restart sshd

That’s all! These are just a few basic settings and commands every system administrator needs to know and apply on a fresh installed CentOS system or in order to perform day to day tasks on the system.

To secure and harden CentOS 7 server, check out these following articles.

  1. The Mega Guide To Harden and Secure CentOS 7 – Part 1
  2. The Mega Guide To Harden and Secure CentOS 7 – Part 2

If you’re planning to deploy websites on this CentOS 7 system, learn how to setup and configure LAMP stack or LEMP stack.

TMOUT – Auto Logout Linux Shell When There Isn’t Any Activity

‘,
enableHover: false,
enableTracking: true,
buttons: { twitter: {via: ‘tecmint’}},
click: function(api, options){
api.simulateClick();
api.openPopup(‘twitter’);
}
});
jQuery(‘#facebook’).sharrre({
share: {
facebook: true
},
template: ‘{total}’,
enableHover: false,
enableTracking: true,
click: function(api, options){
api.simulateClick();
api.openPopup(‘facebook’);
}
});
jQuery(‘#googleplus’).sharrre({
share: {
googlePlus: true
},
template: ‘{total}’,
enableHover: false,
enableTracking: true,
urlCurl: ‘https://www.tecmint.com/wp-content/themes/tecmint/js/sharrre.php’,
click: function(api, options){
api.simulateClick();
api.openPopup(‘googlePlus’);
}
});
jQuery(‘#linkedin’).sharrre({
share: {
linkedin: true
},
template: ‘{total}’,
enableHover: false,
enableTracking: true,
buttons: {
linkedin: {
description: ‘TMOUT – Auto Logout Linux Shell When There Isn’t Any Activity’,media: ‘https://www.tecmint.com/wp-content/uploads/2017/10/Tmout-Auto-Logout-Linux-Shell.png’ }
},
click: function(api, options){
api.simulateClick();
api.openPopup(‘linkedin’);
}
});
// Scrollable sharrre bar, contributed by Erik Frye. Awesome!
var shareContainer = jQuery(“.sharrre-container”),
header = jQuery(‘#header’),
postEntry = jQuery(‘.entry’),
$window = jQuery(window),
distanceFromTop = 20,
startSharePosition = shareContainer.offset(),
contentBottom = postEntry.offset().top + postEntry.outerHeight(),
topOfTemplate = header.offset().top;
getTopSpacing();
shareScroll = function(){
if($window.width() > 719){ var scrollTop = $window.scrollTop() + topOfTemplate,
stopLocation = contentBottom – (shareContainer.outerHeight() + topSpacing);
if(scrollTop > stopLocation){
shareContainer.offset({top: contentBottom – shareContainer.outerHeight(),left: startSharePosition.left});
}
else if(scrollTop >= postEntry.offset().top-topSpacing){
shareContainer.offset({top: scrollTop + topSpacing, left: startSharePosition.left});
}else if(scrollTop 1024)
topSpacing = distanceFromTop + jQuery(‘.nav-wrap’).outerHeight();
else
topSpacing = distanceFromTop;
}
});
]]>

10 Practical Examples Using Wildcards to Match Filenames in Linux

Wildcards (also referred to as meta characters) are symbols or special characters that represent other characters. You can use them with any command such as ls command or rm command to list or remove files matching a given criteria, receptively.

Read Also: 10 Useful Practical Examples on Chaining Operators in Linux

These wildcards are interpreted by the shell and the results are returned to the command you run. There are three main wildcards in Linux:

  • An asterisk (*) – matches one or more occurrences of any character, including no character.
  • Question mark (?) – represents or matches a single occurrence of any character.
  • Bracketed characters ([ ]) – matches any occurrence of character enclosed in the square brackets. It is possible to use different types of characters (alphanumeric characters): numbers, letters, other special characters etc.

You need to carefully choose which wildcard to use to match correct filenames: it is also possible to combine all of them in one operation as explained in the examples below.

How to Match Filenames Using Wildcards in Linux


For the purpose of this article, we will use following files to demonstrate each example.

createbackup.sh list.sh lspace.sh speaker.sh
listopen.sh lost.sh rename-files.sh topprocs.sh

1. This command matches all files with names starting with l (which is the prefix) and ending with one or more occurrences of any character.

$ ls -l l* 
List Files with Character

List Files with Character

2. This example shows another use of * to copy all filenames prefixed with users-0 and ending with one or more occurrences of any character.

$ mkdir -p users-info
$ ls users-0*
$ mv -v users-0* users-info/ # Option -v flag enables verbose output
List and Copy All Files

List and Copy All Files

3. The following command matches all files with names beginning with l followed by any single character and ending with st.sh (which is the suffix).

$ ls l?st.sh 
Match File with Character Name

Match File with Character Name

4. The command below matches all files with names starting with l followed by any of the characters in the square bracket but ending with st.sh.

$ ls l[abdcio]st.sh 
Matching Files with Names

Matching Files with Names

How to Combine Wildcards to Match Filenames in Linux

You can combine wildcards to build a complex filename matching criteria as described in the following examples.

5. This command will match all filenames prefixed with any two characters followed by st but ending with one or more occurrence of any character.

$ ls
$ ls ??st*
Match File Names with Prefix

Match File Names with Prefix

6. This example matches filenames starting with any of these characters [clst] and ending with one or more occurrence of any character.

$ ls
$ ls [clst]*
Match Files with Characters

Match Files with Characters

7. In this examples, only filenames starting with any of these characters [clst] followed by one of these [io] and then any single character, followed by a t and lastly, one or more occurrence of any character will be listed.

$ ls
$ ls [clst][io]?t*
List Files with Multiple Characters

List Files with Multiple Characters

8. Here, filenames prefixed with one or more occurrence of any character, followed by the letters tar and ending with one or more occurrence of any character will be removed.

$ ls
$ rm *tar*
$ ls
Remove Files with Character Letters

Remove Files with Character Letters

How to Match Characters Set in Linux

9. Now lets look at how to specify a set of characters. Consider the filenames below containing system users information.

$ ls
users-111.list users-1AA.list users-22A.list users-2aB.txt users-2ba.txt
users-111.txt users-1AA.txt users-22A.txt users-2AB.txt users-2bA.txt
users-11A.txt users-1AB.list users-2aA.txt users-2ba.list
users-12A.txt users-1AB.txt users-2AB.list users-2bA.list

This command will match all files whose name starts with users-i, followed by a number, a lower case letter or number, then a number and ends with one or more occurrences of any character.

$ ls users-[0-9][a-z0-9][0-9]*

The next command matches filenames beginning with users-i, followed by a number, a lower or upper case letter or number, then a number and ends with one or more occurrences of any character.

$ ls users-[0-9][a-zA-Z0-9][0-9]*

This command that follows will match all filenames beginning with users-i, followed by a number, a lower or upper case letter or number, then a lower or upper case letter and ends with one or more occurrences of any character.

$ ls users-[0-9][a-zA-Z0-9][a-zA-Z]*
Match Characters in Filenames

Match Characters in Filenames

How to Negate a Set of Characters in Linux

10. You can as well negate a set of characters using the ! symbol. The following command lists all filenames starting with users-i, followed by a number, any valid file naming character apart from a number, then a lower or upper case letter and ends with one or more occurrences of any character.

$ ls users-[0-9][!0-9][a-zA-Z]*

That’s all for now! If you have tried out the above examples, you should now have a good understanding of how wildcards work to match filenames in Linux.

You might also like to read these following articles that shows examples of using wildcards in Linux:

  1. How to Extract Tar Files to Specific or Different Directory in Linux
  2. 3 Ways to Delete All Files in a Directory Except One or Few Files with Extensions
  3. 10 Useful Tips for Writing Effective Bash Scripts in Linux
  4. How to Use Awk and Regular Expressions to Filter Text or String in Files

If you have any thing to share or a question(s) to ask, use the comment form below.

Arch Linux Installation and Configuration on UEFI Machines

Arch Linux is one of the most versatile GNU Linux distribution due to its simplicity and cutting age software packages due to its Rolling Release model, Arch Linux is not addressed for beginners in Linux world. It also provides a complicated command line installer, with no Graphical Interface support. The command line installation model makes the job of installing the system very flexible but also very difficult for Linux beginners.

On top of all, Arch Linux provides its own software packages repositories via Pacman Package Manager. Arch Linux also provides a Multiarch environment for different CPU Architectures, such as 32bit, 64bit and ARM.

The software packages, dependencies and security patches are mostly updated on regular basis, making Arch Linux a cutting-age distribution with a few solid tested packages for a production environment.

Arch Linux also maintains AUR – Arch User Repository, which is a huge community driven software repositories mirror. AUR repo mirrors allows users to compile software from sources and install it via Pacman and Yaourt (Yet Another User Repository Tool) package managers.


This tutorial presents a step by step basic Arch Linux installation process through a CD/USB bootable image on UEFI based machines. For other customizations or details visit Official Arch Linux Wiki page at https://wiki.archlinux.org.

Requirements

  1. Download Arch Linux ISO Image

Step 1: Create Disk Partitions Layout

1. First of all go do Arch Linux download page and grab the latest CD image (i.e. current stable version: 2017.10.01), create a bootable CD/USB then plug it into your system CD/USB drive.

2. IMPORTANT STEP! Also make sure your system has an Ethernet plugged in cable with internet connectivity and also an active DHCP server enabled.

3. After the CD/USB boots up you will be presented with first Arch Linux Installer options. Here, select Arch Linux archiso x86_64 UEFI CD and press Enter key to continue.

Arch Linux Boot Menu

Arch Linux Boot Menu

4. After the installer decompresses and loads the Linux Kernel you will be automatically thrown to an Arch Linux Bash terminal (TTY) with root privileges.

A good step now is to list your machine NICs and verify internet network connection by issuing the following commands.

# ifconfig
# ping -c2 google.com
Check Arch Linux Network

Check Arch Linux Network

In case you don’t have a DHCP server configured at your premises to dynamically allocate IP addresses to clients, issue the below commands to manually configure an IP address for Arch Live media.

Replace the network interface and IP addresses accordingly.

# ifconfig eno16777736 192.168.1.52 netmask 255.255.255.0 # route add default gw 192.168.1.1
# echo “nameserver 8.8.8.8” >> /etc/resolv.conf
Configure IP Address on Arch Linux

Configure IP Address on Arch Linux

On this step you can also list your machine hard disk by issuing the following commands.

# cat /proc/partitions
# ls /dev/[s|x|v]d*
# lsblk
# fdisk –l 
Check Arch Linux Disk

Check Arch Linux Disk

In case your machine is a virtual based machine, the hard disks can have other names than sdx, such as xvda, vda etc. Issue the below command to list virtual disk if you’re unaware of the disk naming scheme.

# ls /dev | grep ‘^[s|v|x][v|d]’$* 
Check Virtual Disks

Check Virtual Disks

Important to note is that the name convention for Raspberry PI drive storage usually is /dev/mmcblk0 and for some types of hardware RAID cards can be /dev/cciss.

5. On the next step we’ll start to configure the Hard Disk partitions. For this stage you can run cfdisk, cgdisk, parted or gdisk utilities to perform a disk partition layout for a GPT disk. I strongly recommend using cfdisk for its wizard driven and simplicity in use.

For a basic partition layout table use the following structure.

  • EFI System partition (/dev/sda1) with 300M size, FAT32 formatted.
  • Swap partition (/dev/sda2) with 2xRAM recommended size, Swap On.
  • Root partition (/dev/sda3) with at least 20G size or rest of HDD space, ext4 formatted.

Now let’s actually start creating disk layout partition table by running cfdisk command against machine hard drive, select GPT label type, then select Free Space then hit on New from bottom menu, as illustrated in the below screenshots.

# cfdisk /dev/sda
Select Arch Linux Label Type

Select Arch Linux Label Type

Select Arch Linux Installation Disk

Select Arch Linux Installation Disk

6. Type the partition size in MB (300M) and press enter key, select Type from bottom menu and choose EFI System partition type, as shown in the following screenshots.

EFI System Size

EFI System Size

EFI System Type

EFI System Type

Select EFI System

Select EFI System

You’ve finished configuring the EFI System partition.

7. Next, let’s create the Swap partition using the same procedure. Use down arrow key and select again the remaining Free Space and repeat the steps above: New -> partition size 2xRAM size recommended (you can safely use 1G) -> Type Linux swap.

Use the below screenshots as a guide to create the swap partition.

Create Swap Partition

Create Swap Partition

Set Swap Partition Size

Set Swap Partition Size

Select Partition Type

Select Partition Type

Select Swap Partition

Select Swap Partition

8. Finally, for /(root) partition use the following configuration: New -> Size: rest of free space -> Type Linux filesystem.

After you review Partition Table select Write, answer with yes in order to apply disk changes and then, type quit to exit cfdisk utility, as shown in the below images.

Create Root Partition

Create Root Partition

Set Root Partition Size

Set Root Partition Size

Select Type for Root Partition

Select Type for Root Partition

Select Linux Filesystem

Select Linux Filesystem

Partition Table Summary

Partition Table Summary

Confirm Partition Changes

Confirm Partition Changes

Quit Disk Management Console

Quit Disk Management Console

9. For now, your partition table has been written to HDD GPT but no file system was yet created on top of it. You can also review partition table summary by running fdisk command.

# fdisk -l

10. Now, it’s time to format the partitions with the required file systems. Issue the following commands to create a FAT32 file system for EFI System partition (/dev/sda), to create the EXT4 file system for the root partition (/dev/sda3) and create the swap partition for /dev/sda2.

# mkfs.fat -F32 /dev/sda1
# mkfs.ext4 /dev/sda3
# mkswap /dev/sda2
Create Arch Linux Filesystem

Create Arch Linux Filesystem

Step 2: Install Arch Linux

11. In order to install Arch Linux, the /(root) partition must be mounted to /mnt directory mount point in order to be accessible. Also the swap partition needs to be initialized. Issue the below commands to configure this step.

# mount /dev/sda3 /mnt
# ls /mnt # swapon /dev/sda2
Mount Root Partition

Mount Root Partition

12. After the partitions had been made accessible, is time to perform Arch Linux system installation. To increase installation packages download speed you can edit /etc/pacman.d/mirrorlist file and select the closest mirror website (usually choose your country server location) on top of mirror file list.

# nano /etc/pacman.d/mirrorlist

You can also enable Arch Multilib support for the live system by uncommenting the following lines from /etc/pacman.conf file.

[multilib]
Include = /etc/pacman.d/mirrorlist
Enable Arch Multilib

Enable Arch Multilib

13. Next, start installing Arch Linux by issuing the following command.

# pacstrap /mnt base base-devel
Install Arch Linux

Install Arch Linux

Depending on your system resources and internet speed the installer can take from 5 to 20 min to complete.

14. After the installation completes, generate fstab file for your new Arch Linux system by issuing the following command.

# genfstab -U -p /mnt >> /mnt/etc/fstab

Subsequently inspect fstab file content by running the below command.

# cat /mnt/etc/fstab
Generate fstab File

Generate fstab File

Step 3: Arch Linux System Configuration

15. In order to further configure Arch Linux, you must chroot into /mnt system path and add a hostname for your system by issuing the below commands.

# arch-chroot /mnt
# echo "archbox" > /etc/hostname

16. Next, configure your system Language. Choose and uncomment your preferred encoding languages from /etc/locale.gen file then set your locale by running the following commands.

# nano /etc/locale.gen

locale.gen file excerpt:

en_US.UTF-8 UTF-8
en_US ISO-8859-1
Set Arch Linux Language

Set Arch Linux Language

Generate your system language layout.

# locale-gen
# echo LANG=en_US.UTF-8 > /etc/locale.conf
# export LANG=en_US.UTF-8

17. Next step is to configure your system time zone by creating a symlink for your sub time zone (/usr/share/zoneinfo/Continent/Main_city) to /etc/localtime file path.

# ls /usr/share/zoneinfo/
# ln -s /usr/share/zoneinfo/Europe/Bucharest /etc/localtime

You should also configure hardware clock to use UTC (the hardware clock is usually set to the local time).

# hwclock --systohc --utc
Configure Arch Linux Timezone

Configure Arch Linux Timezone

18. As many famous Linux distributions, Arch Linux uses repo mirrors for different world locations and multiple system architectures. The standard repos are enabled by default, but if you want to activate Multilib repositories you must uncomment [multilib] directives from /etc/pacman.conf file, as shown in the below excerpt.

# nano /etc/pacman.conf
Enable Arch Multilib

Enable Arch Multilib

19. If you want to enable Yaourt Package Tool support (used for downloading and building AUR packages) go to bottom of the /etc/pacman.conf file and add the following directives.

[archlinuxfr]
SigLevel = Never
Server = http://repo.archlinux.fr/$arch
Activate Yaourt Package Tool

Activate Yaourt Package Tool

20. After the repository file has been edited, synchronize and update database mirrors and packages by running the below command.

# pacman -Syu
Synchronize and Update Database

Synchronize and Update Database

21. Next, setup a password for the root account and create a new user with sudo privileges in Arch box by issuing the commands below. Also, expire the user password in order to force the new user to change the password at first log in.

# passwd
# useradd -mg users -G wheel,storage,power -s /bin/bash your_new_user
# passwd your_new_user
# chage -d 0 your_new_user
Create Arch Linux User

Create Arch Linux User

22. After the newly user has been added you need to install the sudo package and update the wheel group line from /etc/sudoers file in order to grant root privileges to the newly added user.

# pacman -S sudo
# visudo 

Add this line to /etc/sudoers file:

%wheel ALL=(ALL) ALL
Enable Sudo Privileges

Enable Sudo Privileges

24. On the last step, install the Boot Loader in order for Arch to boot up after restart. The default boot loader for Linux distributions and Arch Linux also is represented by the GRUB package.

To install the GRUB boot loader in UEFI machines on the first hard-disk and also detect Arch Linux and configure the GRUB boot loader file, run the following commands as illustrated in the following screenshots.

# pacman -S grub efibootmgr dosfstools os-prober mtools
# mkdir /boot/EFI
# mount /dev/sda1 /boot/EFI #Mount FAT32 EFI partition # grub-install --target=x86_64-efi --bootloader-id=grub_uefi --recheck
Install Grub Boot Loader in Arch Linux

Install Grub Boot Loader in Arch Linux

Configure Grub Boot Loader in Arch Linux

Configure Grub Boot Loader in Arch Linux

25. Finally, create the GRUB configuration file by issuing the following command.

# grub-mkconfig -o /boot/grub/grub.cfg
Create Grub Configuration file

Create Grub Configuration file

Congratulations! Arch Linux is now installed and configured for your box. The last steps needed now are to exit chroot environment, unmount the partitions and reboot system by issuing the below commands.

# exit
# umount -a
# telinit 6

26. After reboot, remove the installation media image and the system will boot directly into GRUB menu as shown below.

Arch Linux Grub Menu

Arch Linux Grub Menu

27. When the system boots-up into Arch Linux, login with the credentials configured for your user during the installation process and change the user account password as shown below.

Arch Linux Login

Arch Linux Login

28. You will lose the internet network connection, because no DHCP client is running by default in the system. In order to overcome this problem, issue the following command with root privileges in order to start and enable the DHCP client.

Also, check if the network interface is up and has an IP address allocated by the DHCP server and if the internet connection works as expected. Ping a random domain to test internet connection.

$ sudo systemctl start dhcpcd
$ sudo systemctl enable dhcpcd
# ip a
# ping -c2 google.com

For now, the Arch Linux system contains only the basic software packages needed to manage the system from Command Line, with no Graphical User Interface.

Due to its high-portability, rolling release cycles, source packages compilation, granular control over installed software and processing speed, Arch Linux resembles in many ways with Gentoo Linux, but cannot rise to Gentoo complex architectural design.

However, the process of managing an Arch Linux system is not recommended for Linux beginners. Linux beginners that want to operate an Arch-like Linux system should first learn Arch Linux principles by installing the Manjaro Linux distribution.

How to manage Linux containers with Ansible Container

I love containers and use the technology every day. Even so, containers aren’t perfect. Over the past couple of months, however, a set of projects has emerged that addresses some of the problems I’ve experienced.

I started using containers with Docker, since this project made the technology so popular. Aside from using the container engine, I learned how to use docker-compose and started managing my projects with it. My productivity skyrocketed! One command to run my project, no matter how complex it was. I was so happy.

After some time, I started noticing issues. The most apparent were related to the process of creating container images. The Docker tool uses a custom file format as a recipe to produce container images—Dockerfiles. This format is easy to learn, and after a short time you are ready to produce container images on your own. The problems arise once you want to master best practices or have complex scenarios in mind.

Let’s take a break and travel to a different land: the world of Ansible. You know it? It’s awesome, right? You don’t? Well, it’s time to learn something new. Ansible is a project that allows you to manage your infrastructure by writing tasks and executing them inside environments of your choice. No need to install and set up any services; everything can easily run from your laptop. Many people already embrace Ansible.

Imagine this scenario: You invested in Ansible, you wrote plenty of Ansible roles and playbooks that you use to manage your infrastructure, and you are thinking about investing in containers. What should you do? Start writing container image definitions via shell scripts and Dockerfiles? That doesn’t sound right.

Some people from the Ansible development team asked this question and realized that those same Ansible roles and playbooks that people wrote and use daily can also be used to produce container images. But not just that—they can be used to manage the complete lifecycle of containerized projects. From these ideas, the Ansible Container project was born. It utilizes existing Ansible roles that can be turned into container images and can even be used for the complete application lifecycle, from build to deploy in production.

Let’s talk about the problems I mentioned regarding best practices in context of Dockerfiles. A word of warning: This is going to be very specific and technical. Here are the top three issues I have:

1. Shell scripts embedded in Dockerfiles.

When writing Dockerfiles, you can specify a script that will be interpreted via /bin/sh -c. It can be something like:

RUN dnf install -y nginx

where RUN is a Dockerfile instruction and the rest are its arguments (which are passed to shell). But imagine a more complex scenario:

RUN set -eux; \
    \
# this “case” statement is generated via “update.sh”
    %%ARCH-CASE%%; \
    \
    url=“https://golang.org/dl/go${GOLANG_VERSION}.${goRelArch}.tar.gz”; \
    wget -O go.tgz $url; \
    echo ${goRelSha256} *go.tgz” | sha256sum -c -; \

This one is taken from the official golang image. It doesn’t look pretty, right?

2. You can’t parse Dockerfiles easily.

Dockerfiles are a new format without a formal specification. This is tricky if you need to process Dockerfiles in your infrastructure (e.g., automate the build process a bit). The only specification is the code that is part of dockerd. The problem is that you can’t use it as a library. The easiest solution is to write a parser on your own and hope for the best. Wouldn’t it be better to use some well-known markup language, such as YAML or JSON?

3. It’s hard to control.

If you are familiar with the internals of container images, you may know that every image is composed of layers. Once the container is created, the layers are stacked onto each other (like pancakes) using union filesystem technology. The problem is, that you cannot explicitly control this layering—you can’t say, “here starts a new layer.” You are forced to change your Dockerfile in a way that may hurt readability. The bigger problem is that a set of best practices has to be followed to achieve optimal results—newcomers have a really hard time here.

Comparing Ansible language and Dockerfiles

The biggest shortcoming of Dockerfiles in comparison to Ansible is that Ansible, as a language, is much more powerful. For example, Dockerfiles have no direct concept of variables, whereas Ansible has a complete templating system (variables are just one of its features). Ansible contains a large number of modules that can be easily utilized, such as wait_for, which can be used for service readiness checks—e.g., wait until a service is ready before proceeding. With Dockerfiles, everything is a shell script. So if you need to figure out service readiness, it has to be done with shell (or installed separately). The other problem with shell scripts is that, with growing complexity, maintenance becomes a burden. Plenty of people have already figured this out and turned those shell scripts into Ansible.

If you are interested in this topic and would like to know more, please come to Open Source Summit in Prague to see my presentation on Monday, Oct. 23, at 4:20 p.m. in Palmovka room.

Learn more in Tomas Tomecek’s talk, From Dockerfiles to Ansible Container, at Open Source Summit EU, which will be held October 23-26 in Prague.

The illustrated Open Organization is now available

In April, the Open Organization Ambassadors at Opensource.com released the second version of their Open Organization Definition, a document outlining the five key characteristics any organization must embrace if it wants to leverage the power openness at scale.

Today, that definition is a book.

Richly illustrated and available immediately in full-color paperback and eBook formats, The Open Organization Definition makes an excellent primer on open principles and practices.

Download or purchase (completely at cost) your copies today, and share them with anyone in need of a plain-language introduction to transparency, inclusivity, adaptability, collaboration, and community.

Installation of Zentyal 5.0 Server

This tutorial will guide you on to install the latest version of Zentyal on a bare-metal server or on a VPS in order to subsequently configure Zentyal system as an Active Directory Domain Controller.

Requirements

  1. Download Zentyal Installation ISO Image

Installing Zentyal Server 5.0.1

1. On the first step, download the ISO image and burn it to a DVD or create a bootable ISO image. Place the ISO media into your machine appropriate drive, reboot the machine and instruct the BIOS to boot from Zentyal ISO.

On the first Zentyal installation screen choose the language for installation process and press [enter] key to continue.

Select Zentyal Language

Select Zentyal Language

2. On the next screen select Install Zentyal 5.0.1-development (expert mode) and press [enter] to move forward with the installation process.

Select Zentyal Installation Mode

Select Zentyal Installation Mode


3. Next, choose the language that will be used during the installation process and as default language of the installed system and press [enter] key to continue.

Select Zentyal Installation Language

Select Zentyal Installation Language

4. On the next series of screens, select your system location for the provided list, as well as your Continent and Country as illustrated in the below screenshots and press [enter] to continue.

Select Location

Select Location

Select Zentyal Continent

Select Zentyal Continent

Select Zentyal Country

Select Zentyal Country

5. On the next screen choose your system locales from the locales list and press [enter] to continue.

Configure Zentyal Locales

Configure Zentyal Locales

6. Next, manually configure your system keyboard by choosing No option from Detect keyboard layout and press [enter] to move to the keyboard screen.

Configure Zentyal Keyboard

Configure Zentyal Keyboard

7. On the keyboard screen select the origin country of the keyboard and the keyboard layout as illustrated in the below screenshots and press enter to continue.

Select Keyboard Layout Origin

Select Keyboard Layout Origin

Select Keyboard Layout

Select Keyboard Layout

8. After the installer detects your machine hardware and loads the required kernel modules into RAM, it will start to configure your network interface via DHCP protocol.

After assigning the proper network settings you will be asked to enter your system hostname. Choose a descriptive hostname for this server and press enter to continue with the installation process.

Configure Zentyal Network

Configure Zentyal Network

Configure Zentyal Hostname

Configure Zentyal Hostname

9. On the next series of installation screens select a username and a strong password for your administrative account with root privileges as shown in the below screenshots.

Create User for Zentyal

Create User for Zentyal

Set Zentyal User Password

Set Zentyal User Password

10. Next, if the system is connected to internet, the installer will detect your system time zone based on the physical location. If the time zone is correctly detected and configured, choose Yes and press enter to continue. Otherwise choose No and select the system tine zone from the provided list.

Configure Zentyal Timezone

Configure Zentyal Timezone

11. On the next step, partition your machine hard disk by choosing the Guided – use the entire disk method, as illustrated in the below image.

Select Zentyal Partitioning

Select Zentyal Partitioning

12. Next, select the disk you want to partition and press enter to continue.

Select Zentyal Installation Disk

Select Zentyal Installation Disk

13. On the next screen, the installer will present a summary of the disk partition table and will ask you whether you want to write partition table to disk. Select Yes and press enter to apply disk changes.

Confirm Zentyal Partition Changes

Confirm Zentyal Partition Changes

14. Next, select Yes option from Remote Administration only screen in order to continue the installation process and install no graphical environment for the server. The Zentyal server will be remotely administered via the web panel and SSH.

Select Zentyal Remote Administration

Select Zentyal Remote Administration

15. After this step, the installer will automatically start the installation process. During the installation, a new screen will appear, which will ask you to add a proxy address in order to configure the package manager and install the software.

In case you’re not using a proxy service to access the internet, leave the HTTP proxy filed blank and press enter to continue.

Configure Zentyal Package Manager

Configure Zentyal Package Manager

16. Next, the installer will configure apt package manager, download and install all required Zentyal software and the GRUB boot loader.

While installing the GRUB boot loader you will be asked to install the GRUB boot loader to your hard disk MBR sector. Select Yes to install the GRUB boot loader and press enter to continue.

Install Zentyal Grub Boot Loader

Install Zentyal Grub Boot Loader

17. When the installation process reaches the final phase, choose to set the system clock to UTC and press enter to finish the installation, as illustrated in the below screenshot.

Finish Zentyal Installation

Finish Zentyal Installation

18. Finally, after the installation completes, remove the installation media image from the appropriate drive and hit on Continue option to reboot the machine.

Zentyal Installation Completes

Zentyal Installation Completes

19. After the first reboot, the system will start installing some Zentyal core packages needed for the server to operate properly. Wait for the packages to finish installing and, then, log in to Zentyal server in console with the credentials configured during the installation process as presented in the below screenshot.

Zentyal Console Login

Zentyal Console Login

That’s all! You have successfully install the latest version of Zentyal server on your machine. On the next series of topics we’ll discuss more advanced Zentyal topics, such as how to remotely manage a Zentyal system and how to setup a Zentyal server as an Active Directory Domain Controller.