CREATING REPOSITORIES IN VM AND OTHER BASIC CONFIGURATIONS

From a previous post we talked about installing a VM and the basic configurations. From this post I’m going to show you how to create a local repository on a VM and how to connect to that local repo from another VM. This is known as a http repo.

Local Repo

  • First on one of the VM’s create a new directory.

mkdir localrepo

  • Then mount the RHEL 6.7 ISO file to the directory.

mount -o loop /dev/cdrom /localrepository

  • Now we should create a .repo file at /etc/yum.repos.d/

[id]

name=<name>

baseurl=file:///<location>

gpgcheck=0

enabled=1

5

6

  • Now clean all. Then update and check the repolist.

7

8

9

  • To check your local repo install httpd using yum.

yum install httpd

HTTP Repo

  • Now you can create a symbolic link to the local repo inside /var/www/html/

ln -s    /localrepository    /var/www/html/

  • Now try to access the symlink from your local machine’s browser. httpd service should be running and the iptables should be stopped as well.

10

11

4

  • Next go to the next VM. Here we are going to create a http repo.
  • Inside /etc/yum.repos.d/ directory create a .repo file with following details.

[id]

name=<name>

baseurl=http://<ip_address>/<location>

gpgcheck=0

enabled=1

13.png

  • Again clean all, update and check the repo list.

7

8

9

  • Now your http repo is running. So you can use yum commands here as well.
  • To check that let’s install dos2unix on 2nd VM.

yum install dos2unix

WHAT IS SWAPPINESS?

The swappiness parameter controls the tendency of the kernel to move processes out of physical memory and onto the swap disk. Because disks are much slower than RAM, this can lead to slower response times for system and applications if processes are too aggressively moved out of memory.

  • Now let’s configure the swappiness.
  • Go to /etc/sysctl.conf and do the following change. It should be between 0 and 100.

20.png

  • Next restart to take the change in to effect.

OPEN FILE COUNT AND NUMBER OF PROCESS LIMITS.

Also we can configure the open file count and the process limits on a VM as well.

  • Go to /etc/security/limits.conf and do the following changes.

30

  • Also /etc/security/limits.d/90-nproc.conf you need to change as well.

31

  • Then using following commands you can check the configurations.

32

ADD A DNS SERVER

Now let’s check how to add a DNS server to your VM and how to use nslookup check.

  • Go to /etc/resolv.conf  and do the following changes.

40.png

  • Now using nslookup we can check the DNS resolving as follows.

41.png

Hope now you have a clear idea on repos, swappiness, open file configurations and DNS configurations. See you soon with another important topic. Thank You!

 

 

Advertisements

One thought on “CREATING REPOSITORIES IN VM AND OTHER BASIC CONFIGURATIONS

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s