SSL Certificate in CentOS WebServer

Yum Install mod_ssl openssl # Generate private keyopenssl genrsa -out ca.key 1024 # Generate CSRopenssl req -new -key ca.key -out your_name.csr # Generate Self Signed Keyopenssl x509 -req -days 365 -in your_name.csr -signkey your_name.key -out your_name.crt # Copy the files to the correct locationscp ca.crt /etc/pki/tls/certs/your_name.crtcp ca.key /etc/pki/tls/private/your_name.keycp ca.csr /etc/pki/tls/private/your_name.csr vi /etc/httpd/conf.d/ssl.conf change path forSSLCertificateKeyFile … Read more

Basic Linux Commands

for move file —>  mv noldfile newfile to make new directory > mkdir dirname to put file into a new directory > mv textfile dirname/ to change file name > rm filename to view the text file …>>>>> less filename to add new user >>> useradd to del user >>> userdel username less command to … Read more

How to make crontab job

field allowed values —– ————– Minute 0-59 hour 0-23 day of month 1-31 month 1-12 (or names, see below) day of week 0-7 (0 or 7 is Sun, or use names) ———————————————- Minute – Hour – Day of Month – Month – Day of Week * * * * * Command goes here —————————————— How … Read more

VI Editor Search and Replace

:s/foo/bar/g Change each ‘foo’ to ‘bar’ in the current line. :%s/foo/bar/g Change each ‘foo’ to ‘bar’ in all lines. :5,12s/foo/bar/g Change each ‘foo’ to ‘bar’ for all lines from line 5 to line 12 inclusive. :’a,’bs/foo/bar/g Change each ‘foo’ to ‘bar’ for all lines from mark a to mark b inclusive. :.,$s/foo/bar/g Change each ‘foo’ … Read more

Installation of Zabbix on CentOS 6.3

Here is my simple steps to Install Zabbix on CentOS machine. 1. yum install zlib-devel mysql-devel glibc-devel curl-devel gcc automake mysql libidn-devel openssl-devel net-snmp-devel rpm-devel OpenIPMI-devel   install repo rpm -Uvh http://download.fedora.redhat.com/pub/epel/5/i386/epel-release-5-4.noarch.rpm yum –enablerepo=epel install iksemel iksemel-devel download zabbix installation file from www.zabbix.com/download or wget http://downloads.sourceforge.net/project/zabbix/ZABBIX%20Latest%20Stable/1.8.1/zabbix-1.8.1.tar.gz?use_mirror=freefr cd zabbix.1.2.3 ./configure –enable-server –with-mysql –with-net-snmp –with-jabber –with-libcurl –with-openipmi … Read more

Rsync over SSH

User of rsync command rsync -Pzarve (P-progress, z-compress, a-archive, r-recursive, v-verbose, e-method) ssh -p (port) -i (ssh key location) /local/dir/ user@hostname:/remote/dir/if you are using rsa key then do rsync -Pzarve "ssh -i /location/rsa_key -p 1234" /source /destination #In this way you have to type password every time you do rsync, if you do not want … Read more

How to install Nagios on CentOS 6+

INSTALLATION OF NAGIOS-CORE 1. # yum install gd gd-devel httpd php gcc glibc glibc-common 2. # mkdir /root/nagios 3.  # cd /root/nagios 4. # wget http://prdownloads.sourceforge.net/sourceforge/nagios/nagios-3.4.4.tar.gz     # wget http://prdownloads.sourceforge.net/sourceforge/nagiosplug/nagios-plugins-1.4.16.tar.gz 5. tar xvzf nagios-3.4.4.tar.gz 6. # cd nagios 7. # ./configure 8. make all, make install, make install-init, make install-commandmode, make install-config, make install-webconf 9. # … Read more

How to Troubleshoot Apache

1. If you are accessing the website by name , make sure it is resolving to an ip address by pinging the address.2. Check the status of apache is it running ?3. Check for any syntax error in apache configuration, if it is not running or is being restarted. [ httpd -t ]2. If the … Read more

How to Install Nagios in Linux/CentOS server

yum install httpd gcc glibc glibc-common gd gd-devel php Create Nagios User account and groupuseradd -m nagios Create nagcmd group for allowing external commands to be submitted through the web interface. Add both the nagios user and the apache usergroupadd nagcmdusermod -a -G nagcmd nagiosusermod -a -G nagcmd apache Create Directory to store Nagios installation … Read more