Tag Archives: ubuntu

AWSCli Installation & Configuration using Ansible

In this blog post, we’ll learn that how we can use simple Ansible role to install the AWS CLI with all the required dependencies on Ubuntu 14.04 LTS, it should work on other versions of Ubuntu too.

First, clone this Repository from the GitHub:

git clone https://github.com/arbabnazar/ansible-roles.git

Note: If git is not installed then you can simply download the zip file.

To use this role, edit the site.yml file:

vi site.yml

Read more of this post

Advertisements

Installing the VNC server on Ubuntu using Ansible

In this post,we’ll learn that how we can install the VNC server on Ubuntu 14.04 LTS using Ansible. If you don’t know about Ansible, please check this link.

If you want manual step by step procedure to install the VNC server on Ubuntu, please refer this post.

First, download this Repository from the GitHub:

git clone https://github.com/arbabnazar/ansible-roles.git

Note: If git is not installed then you can simply download the zip file.

Read more of this post

Installing the WordPress on Ubuntu using Ansible

In this post,we’ll learn that how we can install the WordPress on Ubuntu 14.04 LTS using Ansible. If you don’t know about Ansible, please check this link.

If you want manual step by step procedure to install the WordPress on Ubuntu, please refer this post.

Note: This role depends on LEMP Stack role, it will automatically install the LEMP Stack before installing the WordPress.

First, download this Repository from the GitHub:

git clone https://github.com/arbabnazar/ansible-roles.git

Note: If git is not installed then you can simply download the zip file.

Read more of this post

Installing the LEMP Stack on Ubuntu using Ansible

In this post,we’ll learn that how we can install the latest LEMP (Nginx, MySQL & PHP) Stack and it’s initial configuration on Ubuntu 14.04 LTS using Ansible. If you don’t know about Ansible, please check this link.

If you want the manual procedure to install the LEMP stack, please refer this link.

First, download this Repository from the GitHub:

git clone https://github.com/arbabnazar/ansible-roles.git

Note: If git is not installed then you can simply download the zip file.

Read more of this post

Installing the Amazon EC2 Command Line Interface Tools on Ubuntu

This tutorial will explain that how to install Amazon EC2 Command Line Interface Tools on an Ubuntu.

Enable the awstools PPA :

sudo apt-add-repository ppa:awstools-dev/awstools

1

Update the apt packages:

sudo apt-get update

2

Read more of this post

InterVLAN Routing with Internet Access on Ubuntu

topology

Scenario:

  • Router: Ubuntu Server with 1 network card.
  • Clients:  WindowsXP in VLAN10,Windows7 in VLAN20.
  • Internet: Internet Router on VLAN30
  • Switch: Cisco 2960
Read more of this post

How to install the RPM Package on Ubuntu

Ubuntu is an excellent Operating System and we can find almost any package through Software Centers or PPA but sometime the software is not available in deb/ppa but only in rpm format than we can convert the rpm file into deb format very easily using one command.

Let’s check that unison package is install or not:

unison -version

1

Suppose, we have unison package in rpm format only 😦

ls

2

Read more of this post

How to set Windows to boot as the default in the boot loader

Many people like to boot Windows as standard/default OS in dual-boot setup instead of Ubuntu, so in this tutorial, I will show you that how you can do this:

In a terminal, type this command to display all your grub entries:

fgrep menuentry /boot/grub/grub.cfg

Copy the underline entry – for example Windows 7 in this screenshot.

Edit the /etc/default/grub file:

sudo nano /etc/default/grub

Change the entry:

GRUB_DEFAULT=0

To

GRUB_DEFAULT="Windows 7 (loader) (on /dev/sda2)"

Note:paste the entry you want (including the quotes)

Then type:

sudo update-grub

That’s it, now Windows 7 will boot as default OS:

Hope this will help you!

Please Remember me in your prayers!

Enjoy 🙂

Configure the DHCP server dynamically update the DNS records on Ubuntu 12.04LTS

 This tutorial is based on Ubuntu 12.04 LTS, in which I will try to show you that how to configure the DHCP server automatically update the DNS records, when it assigns a new lease to a client on local network. We will use the below network diagram as a base for this tutorial:

Before Starting this tutorial:

Before starting this tutorial, you can check my other tutorials to learn that, how i configure DHCP server and Gateway:

Ubuntu as a firewall/gateway router

How to Install the DHCP Server on Ubuntu 12.04LTS

Network Configuration for the Ubuntu Gateway:

Configure the DNS:

Install the DNS (bind9) using this command:

sudo apt-get install bind9 dnsutils

Also edit the hosts settings so that the server will be able to accepts the DNS requests. Here is an example of my server’s host file:

cat /etc/hosts

Move to the bind directory:

cd /etc/bind/

Next, we need to configure the forwards for bind, I am using Google’s DNS servers as an example:

sudo nano named.conf.options

forwarders {
 8.8.8.8;
 8.8.4.4;
 };

Now we create a secret key that will be shared between the DHCP server and the DNS:

sudo dnssec-keygen -r /dev/urandom -a HMAC-MD5 -b 128 -n USER DHCP_UPDATER

Show the generated key:

sudo cat Kdhcp_updater.*.private|grep Key

Edit the named.conf.local file in /etc/bind/ directory:

sudo nano named.conf.local

Define the locations of the forward and reverse zone files as well as the secret shared key here:

Move to the /var/lib/bind/ directory:

cd /var/lib/bind/

Create the forward zone file for your doamin:

sudo nano tendo.local.db

Replace the tendo.local with your domain name. Here’s an example of my forward zone file:

$ORIGIN .
$TTL 907200 ; 1 week 3 days 12 hours
tendo.local IN SOA dnssrv.tendo.local. arbab.tendo.local. (
                   2012071707 ; serial
                   10800 ; refresh (3 hours)
                   3600 ; retry (1 hour)
                   604800 ; expire (1 week)
                   38400 ; minimum (10 hours 40 minutes)
                   )
                   NS dnssrv.tendo.local.
                   A 172.16.10.1
$ORIGIN tendo.local.
dhcpsrv            A 172.16.10.2
dnssrv             A 172.16.10.1
gateway            A 172.16.10.254

Every time you make the changes to the zone file, you need to change the serial before reloading the bind.

Next, create the reverse zone file for your doamin:

sudo nano 10.16.172.rev

Here is my reverse zone file, replace the hosts and domain name with your own that match with the forward zone file just created above:

$ORIGIN .
$TTL 907200 ; 1 week 3 days 12 hours
10.16.172.in-addr.arpa IN SOA dnssrv.tendo.local. arbab.tendo.local. (
                       2012071706 ; serial
                       10800 ; refresh (3 hours)
                       3600 ; retry (1 hour)
                       604800 ; expire (1 week)
                       38400 ; minimum (10 hours 40 minutes)
                       )
                       NS dnssrv.tendo.local.
$ORIGIN 10.16.172.in-addr.arpa.
1                      PTR dnssrv.tendo.local.
2                      PTR dhcpsrv.tendo.local.
254                    PTR gateway.tendo.local.

Restart the bind service:

sudo /etc/init.d/bind9 restart

Configure the DHCP server to send updates to the DNS:
sudo nano /etc/dhcp/dhcpd.conf

Add the secret key that we created on our dns server in the dhcpd.conf file and other option, some of the main configurations are mentioned below:

For given subnet, we need to define the zones and within the zones, we need to tell the DHCP server which key to use to update the DNS server:

Here is a DHCP scope that will be used to assign the IP configuration to the clients:

Restart the dhcp service:

sudo /etc/init.d/isc-dhcp-server restart

Once again, restart the bind service on DNS server:

sudo /etc/init.d/bind9 restart

Check the log messages on both dns and dhcp servers:
sudo tail -f /var/log/syslog

DHCP server successfully add the client to the forward and reverse zone.

DNS server accept the secret key and update it’s forward and reverse zone.

Verification on dhcp client:

Enjoy 🙂

Troubleshooting:

I found some really nice troubleshooting steps regarding dhcp and dns server here (Thanks to original author):

  • error: zone [zone-name]/IN: NS ‘[dns-server-hostname]‘ has no address records (A or AAAA)
    You’ll probably encounter this if you forget to provide records for your DNS server in your zone files; e.g. [dns-server-name] IN A [dns-server-ip-address]
  • error: [some-zone-file]: create: permission denied
    Check to make sure that permissions on the given file are correct. Configuration files must be readable by the bind user, and zone/journal files must be writable by the bind user.
  • updating zone ‘[zone-name]/IN’: error: journal open failed: unexpected error
    It is possible that Ubuntu’s AppArmor is getting in the way of the zone updates. Make sure you check /var/log/syslog for related messages. Also check the AppArmor configuration at /etc/apparmor.d/usr.sbin.named.
  • error: zone [zone-name]/IN: [some-hostname]/A: bad owner name (check-names)
    The hostname that a client is requesting is invalid for use in a FQDN. Change the client’s hostname.
  • error: zone [zone-name]/IN: journal rollforward failed: journal out of sync with zone
    The zone journal file has gotten out of sync with the zone file (usually occurs with forced restarts, or modifying the zone file while BIND9 is running). Delete the .jnl file (in/var/lib/bind), and restart BIND9.

Hope this will help you!

Please Remember me in your prayers!

%d bloggers like this: