You are on page 1of 16

LXC CONTAINERS

Requirements
1. A fresh Alibaba Cloud Ubuntu 16.04 instance with minimum 2GB of RAM.
2. A static IP address is configured.
3. A Root password is set up on the server.

4. Launch Alibaba Cloud ECS Instance

5. First, log in to your Alibaba Cloud ECS Console. Create a new ECS instance,


choosing Ubuntu 16.04 as the operating system with at least 2GB RAM.
Connect to your ECS instance and log in as the root user.
6. Update the bse system to latest version.

7. apt-get update -y

8. Install LXC

9. You can install it by running the following command:

10. apt-get install lxc lxc-templates -y

you can check the LXC using the following command:

lxc-checkconfig

Create LXC Container


Now, create your first Ubuntu container with the following command:

lxc-create -n new-container -t ubuntu

You can now list the created container with the following command:

lxc-ls
Output:

new-container

Start Container

You can now start the container with the following command:

lxc-start -n new-container -d

Next, take a console of the container by running the following command:

lxc-console -n new-container

Working with LXC Container

You can get the details of the running container using the following command:

lxc-info -n new-container

You can start and stop the container with the following command:

lxc-start -n new-container
lxc-stop -n new-container

You can Pause and Unpause the container with the following command:

lxc-freeze -n new-container
lxc-unfreeze -n new-container

You can also take a snapshot of the container. First, stop the running container with
the following command:

lxc-stop -n new-container

Install LXC Web Panel


LXC Web Panel is a GUI management tool to manage Linux containers. You can
install the LXC web panel to your system by running the following command:

wget https://lxc-webpanel.github.io/tools/install.sh -O - | bash

Docker

Steps for Installing Docker in linux:

1. Open the terminal on Ubuntu.

2. Remove any Docker files that are running in the system, using the following
command:

$ sudo apt-get remove docker docker-engine docker.io

After entering the above command, you will need to enter the password of the root
and press enter.

3. Check if the system is up-to-date using the following command:

$ sudo apt-get update

4. Install Docker using the following command:

$ sudo apt install docker.io

You’ll then get a prompt asking you to choose between y/n - choose y

5. Install all the dependency packages using the following command:

$ sudo snap install docker

6. Before testing Docker, check the version installed using the following command:
$ docker –version

7. Pull an image from the Docker hub using the following command:

$ sudo docker run hello-world

Here, hello-world is the docker image present on the Docker hub.

8. Check if the docker image has been pulled and is present in your system using
the following command:

$ sudo docker images

9. To display all the containers pulled, use the following command:

$ sudo docker ps –a

10. To check for containers in a running state, use the following command:

$ sudo docker ps

Prerequisites
 2 or more Linux servers running Ubuntu 18.04
 Access to a user account on each system with sudo or root privileges
 The apt package manager, included by default
 Command-line/terminal window (Ctrl–Alt–T)

Steps to Install Kubernetes on Ubuntu


Set up Docker
Step 1: Install Docker

Kubernetes requires an existing Docker installation. If you already have Docker


installed, skip ahead to Step 2.

If you do not have Kubernetes, install it by following these steps:


1. Update the package list with the command:

sudo apt-get update

2. Next, install Docker with the command:

sudo apt-get install docker.io

3. Repeat the process on each server that will act as a node.

4. Check the installation (and version) by entering the following:

docker ––version

Step 2: Start and Enable Docker

1. Set Docker to launch at boot by entering the following:

sudo systemctl enable docker

2. Verify Docker is running:

sudo systemctl status docker

To start Docker if it’s not running:

sudo systemctl start docker

3. Repeat on all the other nodes.

Install Kubernetes
Step 3: Add Kubernetes Signing Key

it is essential to ensure that the software is authentic. This is done by adding a


signing key.

1. Enter the following to add a signing key:

sudo apt-key add

2. Then repeat the previous command to install the signing keys. Repeat for each
server node.

Step 4: Add Software Repositories

Kubernetes is not included in the default repositories. To add them, enter the
following:

sudo apt-add-repository "deb http://apt.kubernetes.io/


kubernetes-xenial main"

Repeat on each server node.

Step 5: Kubernetes Installation Tools

Kubeadm (Kubernetes Admin) is a tool that helps initialize a cluster. The tool gives
you command-line access to clusters.

1. Install Kubernetes tools with the command:

sudo apt-get install kubeadm kubelet kubectl


sudo apt-mark hold kubeadm kubelet kubectl

Allow the process to complete.

2. Verify the installation with:


kubeadm version

3. Repeat for each server node.

Microsoft Exchange server

Installing Exchange Server

1. Log on to the Mailbox server.

2. Start Exchange Server Setup by double-clicking Setup.exe.

4. On the “Check for Updates” page, select whether you want Setup
to download product and security updates for Exchange. Click Next
to proceed.

5. After the Setup has finished copying files on the Copying Files
page, click Next to proceed.

6. Setup is initialized and the Introduction page opens up which


gives further information about the installation process. Read the
content and Click next to continue.

7. The License Agreement page opens up, read the terms and
conditions, select the ‘I accept the terms in the license agreement‘,
and then click Next.

8. The ‘Recommended Settings’ page opens up, select whether you


want the Exchange Server to use recommended settings, or you
want to manually configure these settings after the installation is
complete. Select ‘Use recommended settings’ and click Next.

9. On the Server Role Selection page choose whether you want to


install the Mailbox role or the Edge Server role. Here, the Mailbox
server role has been selected. Once you select the Mailbox Server
Role, the Edge Server role cannot be selected and the Management
Tools option will be selected by default. Select the ‘Automatically
install Windows Server roles and features that are required to install
Exchange Server’ checkbox and click Next to proceed.

10. Specify the installation path for Exchange Server on the


‘Installation Space and Location’ page. You can choose the default
installation location or use Browse button to specify a new location.
Ensure that installation location has suitable storage space.

11. In the next step, you will be asked whether you want to enable or
disable the Malware Protection Setting. Make your choice and click
Next.

12. In the next step, computer will do the readiness check to find
out if the organization and server role prerequisite have completed
successfully. If unsuccessful, click Back to perform the required
tasks and run the readiness check again. If successful, click Install
to continue.

13. The software is installed. And once the setup installs all the
components, the Setup Completed page is displayed. Click Finish to
complete the installation.

Installing the DHCP Service


1. Select Start, Settings, Control Panel, Add or Remove Programs.
2. On the Add or Remove Programs page, click Add/Remove Windows Components to
open the Windows Components Wizard.
3. Select Networking Services, DHCP is located in the Networking Services group in the
Windows Components Wizard.
4. Click the Details button to open the Networking Services window.
5. Select Dynamic Host Configuration Protocol (DHCP) and click OK.
6. Back in the Windows Components Wizard page, click Next to begin the installation.
7. If you are prompted to supply the location of your Windows Server 2003 CD-ROM or
installation files, provide the correct location. Windows installs the DHCP service
files on your computer.
8. When prompted that installation is complete, click Finish to close the Windows
Components Wizard.

Install Proxy Server: Squid Proxy


Step1: Update the server

sudo yum update -y

Step 2: Configure EPEL repo.

sudo yum -y install epel-release

sudo yum -y update

sudo yum clean all

Step 3: Install squid

sudo yum -y install squid

Step 4: Start and enable squid server.

sudo systemctl start squid

sudo systemctl enable squid

Step 5: Check the status of squid server.

sudo systemctl status squid

Configure Proxy Server: Squid Proxy


Configure proxy Sources To Access Internet

First, you need to configure the sources from which squid proxy should
accept connections. For example, you might need to access this proxy
server only from your home network or from specific CIDR ranges.

You can add a source IP range with an ACL using the following format.

acl localnet src 110.220.330.0/24

Open  /etc/squid/squid.config file and add the source

Change the IP to the desired network/IP source based on your needs.

Restart the proxy server after making the ACL changes.

sudo systemctl restart squid

Test proxy Server Connectivity

Test if the proxy server is9 working using a simple curl request. Use the
following curl format. By default squid proxy runs on 3128 port.

curl -x http://<squid-proxy-server-IP>:3128 -L http://google.com

Configure Proxy Authentication

Along with access ACL’s, you can add basic authentication to your proxy
server for extra security. Follow the steps given below for setting up a basic
auth for the squid proxy server.
Step 1: Install httpd-tools

sudo yum -y install httpd-tools

Step 2: Create a passwd file and make squid as the file owner.

sudo touch /etc/squid/passwd && sudo chown squid /etc/squid/passwd

Step 3: Add pxuser  to the password file using htpasswd utility. It will
prompt for a custom password. Enter a strong password you need. This
username and password will be used for all connections through this proxy.

sudo htpasswd /etc/squid/passwd pxuser

Step 4: Open squid config file.

sudo vi /etc/squid/squid.conf

After making desired changes to the config file , save it.

Step 5: Now, restart squid server for the configuration changes to take
place.

sudo systemctl restart squid

Step 6: Now if you test the proxy connection using curl, you will get the
“authentication required message”

Now, test the connectivity with proxy user and password we configured in
step 3. An example syntax is shown below.

curl -x http://35.196.101.43:3128 --proxy-user pxuser:12345 -I http://google.com


With username and password, your proxy request should go through.

Blocking Websites

Another great use of the proxy server is restricting the website access.
Follow the steps below for creating a block list.

Step 1: Open a blocked list file.

sudo vi /etc/squid/blocked_sites

Add the websites to be blocked in the file. For example,

facebook.com

twitter.com

instagram.com

Step 2: Open the squid config file.

sudo vi /etc/squid/squid.conf

Add the following to the ACL list.

acl blocked_sites dstdomain "/etc/squid/blocked_sites"

http_access deny blocked_sites

Step 3: Restart the squid server.

sudo systemctl restart squid


DNS Server
Prerequisites

You must have a working Dynamic Name Services (DNS) server on the network to
run Windows Deployment Services. Administrators may choose to dedicate an entire
server to one role or to install multiple server roles on a single computer. For
simplicity, the Dynamic Host Configuration Protocol (DHCP) and Domain Name
System (DNS) roles can be installed together on one server.

Installation Information

Domain Name System (DNS) is the name resolution protocol for TCP/IP networks,
such as the Internet. A DNS server hosts the information that enables client
computers to resolve memorable, alphanumeric DNS names to the IP addresses that
computers use to communicate with each other. Here is a summary:

To install a DNS server

1. Open Server Manager. To open Server Manager, click Start, and then


click Server Manager.

2. Under Roles Summary, click Add Roles.

3. On Before You Begin, click Next.

4. On Confirm Installation Selections, click Install.

5. On DNS Server, click Next.

6. On Installation Results, click Close.

DNS Configuration
To configure your DNS server, follow these 5 steps:

1. First, you’ll need to start the Configure Your Server Wizard. To do so,


click Start -> All Programs -> Administrative Tools, and then
click Configure Your Server Wizard.
 
2. On the Server Role page, click DNS server, and then click Next.
 
3. On the Summary of Selections page, view and confirm the options
that you have selected. The following items should appear on this page:
•   Install DNS
•   Run the Configure a DNS Wizard to configure DNS
 
If the Summary of Selections page lists these two items, click Next.

4. When the Configure Your Server Wizard installs the DNS service, it


first determines whether the IP address for this server is static or is
configured automatically. If your server is currently configured to obtain
its IP address automatically, the Configuring Components page of the
Windows Components Wizard will prompt you to configure the server
with a static IP address. To do so perform the following actions:
a. In the Local Area Connection Properties dialog box, click Internet
Protocol (TCP/IP), and then click Properties.
 
b. Next, click Use the following IP address, and then type the static
IP address, subnet mask, and default gateway for this server.
 
c. In Preferred DNS, type the IP address of this server.
 
d. In Alternate DNS, either type the IP address of another internal DNS
server, or leave this box blank.
 
e. When you’ve finished setting up the static IP addresses for your
DNS, click OK, and then click Close.
 
5. After you Close the Windows Components Wizard, the Configure a
DNS Server Wizard will start. In the wizard, follow these steps:
a. On the Select Configuration Action page, select the Create a
forward lookup zone check box, and then click Next.
 
b. To specify that this DNS hosts a zone containing DNS resource
records for your network resources, on the Primary Server
Location page, click This server maintains the zone, and then
click Next.
 
c. On the Zone Name page, in Zone name, specify the name of the
DNS zone for your network, and then click Next. The name of the
zone is the same as the name of the DNS domain for your small
organization or branch office.
 
d. On the Dynamic Update page, click Allow both nonsecure and
secure dynamic updates, and then click Next. This makes sure
that the DNS resource records for the resources in your network
update automatically.
 
e. On the Forwarders page, click Yes, it should forward queries to
DNS servers with the following IP addresses, and then click Next.
When you select this configuration, you forward all DNS queries for
DNS names outside your network to a DNS at either your ISP or
central office. Type one or more IP addresses that either your ISP or
central office DNS servers use.
 
f. On the Completing the Configure a DNS Wizard page of the
Configure a DNS Wizard, you can click Back to change any of your
selected settings. Once you’re happy with your selections,
click Finish to apply them.
After finishing the Configure a DNS Wizard, the Configure Your Server Wizard
displays the This Server is Now a DNS Server page. To review the changes
made to your server or to make sure that a new role was installed
successfully, click on the Configure Your Server log. The Configure Your
Server Wizard log is located at: 
%systemroot%\Debug\Configure Your Server.log
To close the Configure Your Server Wizard, just click Finish.

Virtual box installation

 IIS services

You might also like