Thursday, December 30, 2010

How To Configure Apache Web Server

Apache is the most widely used web server in the world and one of the most reliable one.
To install the Apache first of all you should have the yum configured so that you can install all the packages have dependencies with it.
Than use the following command to install the Apache
#yum install httpd*        //it will install the Apache and its related packages

Than go to the main directory of the Apache Web server and create a index.html file there so that server can read this file and can show it as our first page
#vi /var/www/html/index.html

Write any information in this file which you want to show by going to insert mode and than saving it.

Now open the main configuration file of the Apache so that we can make entry in that file about the changes which we want to take effect.
#vi /etc/httpd/conf/httpd.conf

Go to the following line and do the entry of your ip from which you want to run the web server
 972 NameVirtualHost

972 is the line no, uncomment it by removing the # from its front and wirte your ip address in the end.

Copy lines from 985 to 991 in the end of file so that we can make changes in that

<VirtualHost>                                 //your ip address:port no
      ServerAdmin       //root@your host name
      DocumentRoot /var/www/html/                            //directory address of index file
      ServerName                  //your host name

#    ErrorLog logs/   //keep it commented
#    CustomLog logs/ common  //keep it commanted

Save it and come out of the file.
restart the service Apache and the network

#service httpd restart
#service network restart

Now go to browser and open your it by ip or host name but remember it will only work by host name if you had configured it correctly and your system was pinging your host name.
for any query write in the comment box

Wednesday, December 29, 2010

Important Port No's in Linux and similar OS

these are the port nos which are generally asked when you face an interview or a system administrator should know them, The respective service run on these port no's

42-Whois service

Tuesday, December 28, 2010

Insert Key in RPM Packages

There are case in Linux that when you install the rpm on your system the error comes that it is unable to find the required key in that case use the following commands to run your rpm so that it does not give the error again...

rpm --import /etc/pki/rpm-gpg/*
rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-beta
rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-auxiliary
rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release

This will import the keys in your system and packages will run.
It will also work when your YUM Server would also require the keys for installation.

Configuring YUM Server

YUM Server is used to install the RPM in your system in such a way that it resolve the dependencies it self.
A YUM Server can be configured in local system by storing the packages in your system it self or by accessing the though the remote location by the help of ftp.
these are the following steps while configuring it..

Go to the yum directory in
#cd /etc/yum.repos.d/

Copy the main configuration file in other file so that we can use the original file in case of any mistake. The name of the new file which i have put here is server.repo, you can put it anything you like
#cp rhel-debuginfo.repo server.repo

Go to the server.repo file so that we can edit the contant
#vi server.repo

In the file make the changes similar to these one according to your requirment.
[server.repo] //name of the file which you have put
name=Red Hat Enterprise Linux server //name of the server you want
baseurl=file:///home/Server //address where your rpm is stored
enabled=1 //enable it to 1 from 0
gpgcheck=1 //do it # if you want to dont use GPG
#gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release //keep it commented( # )

If you want to get the RPM's via ftp the in the address write the baseurl=ftp://your ftp address with the location of packages.

save the file with

Go to the directory where you have your packages present and install the create repo rpm.
#cd /home/Server/ //This is where i have kept my packages so go to your location

#rpm -ivh createrepo-0.4.11-3.el5.noarch.rpm

Run create repo command in your pakages directory to create repo
#createrepo /home/Server/

#yum clean all
#yum list all

To install and remove any package use the following commands
#yum install packagename*
#yum remove packagename*

For any query write in the comments section or general comments are also accepted:)

Configure Host name of System without DNS

If you want to configure the host name of your system so that you can ping it by its host name as well as other systems than follow the following steps..

First of all keep note down your ip as it would be required, use this command

Go to the main hosts configuration file and add your and other systems host name and ip which you want to ping
#vi /etc/hosts

In the file do these type of similar changes
# Do not remove the following line, or various programs     //default
# that require network functionality will fail.                         //default               localhost.localdomain localhost                //default
#::1            localhost6.localdomain6 localhost6                      //default                                  //your hostname & ip                                  //other system hostname & ip which you want ping

Save this file by pressing esc than :wq!

Now go to the network file to edit there as well..
#vi /etc/sysconfig/network

HOSTNAME=localhost.localdomain  //replace it by name which you want to put for example what i have use

Save the file and come out

To know the host name type

Change the host name to which you have written in file by this command

Restart the system or log off to things to take effect.

to make the communication between the systems write the following commands before starting the processes
#service iptables stop          //it stops the firewall
#service network restart     //it restart the network
#chkconfig network on        //to make service permament
#chkconfig iptables off        //to make service permament

Setup fully configurable EFK Elasticsearch Fluentd Kibana setup in Kubernetes

In the following setup, we will be creating a fully configurable Elasticsearch, Flunetd, Kibana setup better known as EKF setup. There is a...