Cut
Grep
Tail
Syslogd
#ls -l | ask '{print $2}'
12
5
13
#ls -l | ask '{print $2}'
12
5
13
We are going to see YUM Configuration in RHEL7/ CentOS 7 in this post.
In Linux mostly we are using RPM and Yum Package management.
YUM- Yellowdog Updater Modified
Yum is mostly used to install a package without fail by resolving software dependencies.
We can configure yum locally/in network
Required RPM:
1. Yum
2. Createrepo
3. deltarpm
4. python-deltarpm
Configuring YUM in RHEL7
1. Insert RHEL7 media and mount it under /mnt
#mount /dev/cdrom /mnt
2. All the RPM’s available under Packages directory. change to Package Directory and
copy all the RPM’s under any local directory which you have already created.
3. Creating local directory to use as repository
#mkdir /yumpkg
4. Copying RPM’s from media to local directory
#cd /mnt/Packages
#cp *.* /yumpkg
5. Ensure all the required RPM’s installed or not by using below commands
#rpm -qa yum
#rpm -qa createrepo
6. Generate local repository files from yumpkg and create xml file
#cp /mnt/repodata/59eXXXXXX.xml /yumpkg/comps.xml #cd /yumpkg #createrepo -g /yumpkg/comps.xml .
#vi /etc/yum.repos.d/yum.repo
[server_name]
name=YUM_Server
baseurl=file:///yumpkg
enabled=1
gpgcheck=0
:wq save and exit from yum.repo file
Note: For using ftp/http as repository, we must enter the concerns path in baseurl field
#yum clean all
#yum makecache
8. Now check yum by listing all available RPM’s
#yum list all
9. Than try to install any package using YUM
# yum install vsftp
Other commands of yum
#yum remove <package_name>
#yum update <package_name>
#yum search <package_name>
#yum info <package_name>
#yum list installed
#yum check-update
#yum update
yum groupinstall <package_name>
Follow the below steps to fix Two private IP’s not responding each other in Multicasting – Linux:
Cloud is loaded terminal. Cloud is convenient, on demand network access to a share pool of configurable computing service. that include application/services.
characteristics:
Self-service
Multitenancy
Elasticity
Telemetry
Cloud types:
Private cloud
Public cloud
Hybrid cloud
What is private cloud?
Private Cloud will provide all basic benefits of public cloud like below.
Service and scalability, multi-tenancy, ability to provision machines, changing computing resources ondemand and creating multiple machines for complete jobs.
In this cloud type limited people only will able to access web based apps/websites.
Disadvantage:
We need staffing system and will be handled and managed by third party service.
Advantage:
To reduce implementing Rack space and VMWare by deploying private cloud.
What is Public cloud?
Public cloud is a standard cloud computing. In this method service provider have to provide all the resources like application, Hardware’s,etc.. and
its available in public over the internet.
This service could be a free a service or payable service.
Advantages:
Expense is low because of provider will pay for hardware,application and bandwidth.
Easy to access.
Scalability.
Resources usage is low.
Example: Amazon Elastic Compute Cloud (EC2), Sun Cloud, Google AppEngine, etc…
What is Hybrid Cloud?
In hybrid cloud organizations will deploy their apps in Private and Public cloud both.
So, it’s maintained by both provider internal and external.
Dynamic or changeable applications using this module cloud. Application might be deployed in private cloud and it will access public cloud resources when the computing demand is high. To connect Private and Public cloud resources, hybrid cloud is required.
Other topics will be covered in next post
1. Standalone
2. High Availability
3. Tiered
1. Machine with RedHat server operating system with FQDN.
2. Mail agent which will help chef server to send notification.
3. Should know to work with cron jobs to schedule jobs
We are going to see Standalone chef server in this post.
In this method will use single machine for chef server installation.
1. Download “chef-server-core-<ver>” and kept under /tmp directory on a server which will run the server.
2. Install the package as root user using below commands.
#rpm -ivh chef-server-core-xxx.rpm
It will take some minutes to install it.
Execute the following server to start all services.
#chef-server-ctl reconfigure
#chef-server-ctl user-create <username> <firstname> <lastname> <email> ‘Password’ –filename /path/uname.pem
Download and install additional packages:
We can use Chef management console to manage the data bags, attributes, run-lists, roles, environments, and cookbooks from a web user interface.
#chef-server-ctl install chef-manage
#chef-server-ctl reconfigure
#chef-manage-ctl reconfigure
Run the below commands on chef server.
#chef-server-ctl install opscode-push-jobs-server
#chef-server-ctl reconfigure
#opscode-push-jobs-server-ctl reconfigure
Run the below commands on chef server:
#chef-server-ctl install opscode-reporting
#chef-server-ctl reconfigure
#opscode-reporting-ctl reconfigure
While using more than 25 nodes, configuration should be updated by us for license.
for that, need to edit chef-server.rb file. follow the below steps to edit
#mkdir /etc/opscode && sudo touch /etc/opscode/chef-server.rb
open new chef-server.rb file
#vi /etc/opscode/chef-server.rb
append the below line on that file
#license[‘nodes’] = N (number of licensed nodes you have purchased)
save and exit from the file using :wq
run below command to update the modified changes on chef server
#chef-server-ctl reconfigure
•A linux server with ip address 192.168.1.1 and hostname Server
•A linux client with ip address 192.168.1.2 and hostname Client1
•A Configured DNS server on Linux server
•Updated /etc/hosts file on both linux system
•Running portmap and xinetd services
•Firewall should be off on server
1.Sendmail
2.M4
#yum install sendmail
#yum install m4
Mail server program reads the /etc/mail/sendmail.cf. When Sendmail is started or restarted with the service sendmail restart command a new sendmail.cf file is automatically generated if sendmail.mc has been modified.
open /etc/mail/sendmail.mc for editing
#vi /etc/mail/sendmail.mc
show hidden line with : set nu option on vi command mode
By default, the following line limits sendmail access to connect local host only [line no 116]
You can allow other computers to use your sendmail server by commenting out this line.
DAEMON_OPTION(‘Port=smtp, Addr=127.0.0.1, Name=MTA’)dnl
comment this line with dnl keyword followed by # sign
dnl # DAEMON_OPTION(‘Port=smtp, Addr=127.0.0.1, Name=MTA’)dnl
save this file with :wq and exit.
Now generate new sendmail.cf file by using m4 command as shown here
#m4 /etc/mail/sendmail.mc > /etc/mail/sendmail.cf
Now restart sendmail service and also set it on with chkconfig
#chkconfig sendmail on
#service sendmail restart
if sendmail service restart without any error means you have configured sendmail successfully.
1.Sendmail
2.M4
Now generate new sendmail.cf file by using m4 command as shown here
#m4 /etc/mail/sendmail.mc > /etc/mail/sendmail.cf
Now restart sendmail service and also set it on with chkconfig
#chkconfig sendmail on
#service sendmail restart
We will test sendmail server by sending and receiving mail in lab environment. for this we use two user one on each system.
Now create one user on each system abu on server
#useradd abu
#passwd abu
and Thagir on client system
#useradd thagir
#passwd thagir
Now send mail from user abu to thagir and from thagir to user abu and also check each other’s mail by mail command
Use full user name to send mail. For example to send mail to nikita use thagir@client1
#mail [email protected]
Subjest: test mail
This is test mail
Press Ctrl+C
Now check on user abu mail box.
We are going to see Apache configuration/Web server configuration in RHEL 6 Linux.
Remember before configuring web server, we must configure DNS/DHCP server to receive the correct traffic.
Required RPM’s:
1. Httpd
2. Httpd-devel
Install the required RPM’s using below commands.
#yum install http* -> command will install the required rpm package including dependency.
Now configure the IP Address with 192.168.1.10 and check whether its configured properly or not. Without proper network configuration httpd service will wont start.
#ifconfig eth0 192.168.1.10 255.255.255.0
#ifconfig eth0
Now start httpd daemons and check the status
#chkconfig httpd on
#service httpd start
#service httpd status
We will host www.exampleweb.com to apache server and create index page under the root directory.
#mkdir –p /var/www/virtual/www.exampleweb.com/html
#vi /var/www/virtual/www.exampleweb.com/html/index.html
Just enter some text for testing purpose in index.html
<b> this is test page</b>
Bind system ip with www.exampleweb.com on /etc/hosts file. Usinf vi editor open the file and append like below.
#vi /etc/hosts
192.168.1.10 www.exampleweb.com
Save and exit from the file using :wq
Now locate virtual host tag and remove # on apache configuration file (/etc/httpd/conf/httpd.conf)
#vi /etc/httpd/conf/httpd.conf
NameVirtualHost 192.168.1.10
Copy and paste the last seven line from the file and change as shown below.
<VirtualHost 192.168.1.10>
ServerAdmin [email protected]
DocumentRoot /var/www/cirtual/www.exampleweb.com/html
ServerName www.exampleweb.com
ErrorLog logs/dummy-www.exampleweb.com-error_log
CustomerLog logs/ dummy-www.exampleweb.com-access_log common
</Virtualhost>
Now restart the httpd service to effect the new configuration
#service httpd restart
Using links command will check the page
#links www.exampleweb.com
This is a test page
If you got out as whatever you have entered in index.html page than you have configured very well.