Friday, August 24, 2012

Request for a certficate with multiple DNS names


We can secure a larger number of domains with only one certificate.

On the basis of this concept I installed single certificate on more then one websites.

To request a certificate which includes more than one FQDN (fully qualified domain name), We need to create a specially formatted CSR with more than one commonName (CN) in its subject.

Below are the steps to create and sign such certificate.

Step 1) Create a private key for requesting a certificate

[root@host2 load]# openssl genrsa -out www.domain.tld.key 2048

Step 2) Generate csr for multiple domains.

[root@host2 load]#openssl req -new -key  www.domain.tld.key -subj "/C=IE/O=inst_name/CN=first_fqdn/CN=second_fqdn/CN=third_fqdn"  -out www.domain.tld.csr

Step 3) As a CA Sign csr to certificate

[root@host2 load]# openssl ca -in www.domain.tld.csr -out www.domain.tld.crt

Wednesday, August 1, 2012

CHATTR & LSATTR COMMAND SYNTEX

Dear friend 
Last day one of my friend who was appearing in RHCE exam face a problem in troubleshooting section
That he was unable to modify /etc/passwd file 

then i suggest him to use
lsattr /etc/passwd 

then he find 
----i--------  /etc/passwd

& then he use

chattr -i /etc/passwd
so i am posting syntax & attributes for chattr command

SYNTAX & COMMAND FOR CHATTR
                 
chattr - change file attributes on a Linux second extended file system
SYNOPSIS
chattr [ -RV ] [ -v version ] [ mode ] files...
DESCRIPTION
chattr changes the file attributes on a Linux second extended file system. 

OPTIONS

-R
Recursively change attributes of directories and their contents. Symbolic links encountered during 

recursive directory traversals are ignored. 
-V
Be verbose with chattr's output and print the program version. 
-v version
Set the file's version/generation number. 

Opcodes
+
Add attribute.
-
 Remove attribute.
=
Assign attributes (removing unspecified attributes).


ATTRIBUTES

1) A file with the `i' attribute cannot be modified: it cannot be deleted or renamed, no link can be 

created to this file and no data can be written to the file. Only the superuser or a process pessessing 

the CAP_LINUX_IMMUTABLE capability can set or clear this attribute.

2) A file with the `j' attribute has all of its data written to the ext3 journal before being written to 

the file itself, if the filesystem is mounted with the "data=ordered" or "data=writeback" options. When 

the filesystem is mounted with the "data=journalled" option all file data is already journalled and this 

attribute has no effect. Only the superuser or a process possessing the CAP_SYS_RESOURCE capability can 

set or clear this attribute.

3)  When a file with the `s' attribute set is deleted, its blocks are zeroed and written back to the disk.

4) When a file with the `S' attribute set is modified, the changes are written synchronously on the disk; 

this is equivalent to the `sync' mount option applied to a subset of the files. 

5) When a file with the `u' attribute set is deleted, its contents are saved. This allows the user to ask 

for its undeletion. 

6) A file with the `a' attribute set can only be open in append mode for writing. Only the superuser or a 

process pessessing the CAP_LINUX_IMMUTABLE capability can set or clear this attribute.

7) A file with the `c' attribute set is automatically compressed on the disk by the kernel. A read from 

this file returns uncompressed data. A write to this file compresses data before storing them on the 

disk.

8) When a directory with the `D' attribute set is modified, the changes are written synchronously on the 

disk; this is equivalent to the `dirsync' mount option applied to a subset of the files.

9) A file with the `d' attribute set is not candidate for backup when the "dump" program is run. 

Tuesday, February 14, 2012

cacti configuration

Introduction:

Cacti is a complete frontend to RRDTool, it stores all of the necessary information to create graphs and populate them with data
in a MySQL database. The frontend is completely PHP driven. Along with being able to maintain Graphs, Data Sources, and Round Robin Archives in a database, cacti handles the data gathering. There is also SNMP support for those used to creating traffic graphs with MRTG.

Cacti requirement:

MySQL Server : Store cacti data. 
NET-SNMP server - SNMP  for network management.              
PHP with net-snmp module - Access SNMP data using PHP. 
Apache / lighttpd / ngnix webserver : Web server to display graphs created with PHP and RRDTOOL.
 
Step1: Install required dependencies
#yum install cairo-devel libxml2-devel pango-devel pango libpng-devel freetype freetype-devel libart_lgpl-devel mysql-server mysql php-mysql php-pear php-common php-gd php-devel  php php-mbstring php-cli php-snmp php-pear-Net-SMTP php-mysql httpd mysql-devel make patch openssl-devel openssl net-snmp-devel gcc gcc+ libtool


Step2: Download and install RRDTool

#wget http://people.ee.ethz.ch/~oetiker/webtools/rrdtool/pub/rrdtool.tar.gz
#tar -zxvf rrdtool-1.4.5.tar.gz
#cd rrdtool-1.4.5
#./configure
#make
# make install

Step3: Configure MySQL

#useradd cactiuser
#/sbin/service mysqld start
#mysqladmin --user=root password    password _of_ root
#mysqladmin --user=root --password reload
# mysql -u root -p
Enter password: 
mysql> create database cactidb;
mysql> grant all on cactidb.* to root;
mysql> grant all on cactidb.* to root@localhost;
mysql> grant all on cactidb.* to cactiuser;
mysql> grant all on cactidb.* to cactiuser@localhost;
mysql> set password for cactiuser@localhost=password('
password_of_ cactiuser');
mysql> flush privileges;
mysql> exit

Step4: Install and Configure Cacti

# wget http://www.cacti.net/downloads/cacti-0.8.7g.tar.gz
#tar -zxvf cacti-0.8.7g.tar.gz
#mv cacti-0.8.7g.tar.gz  cacti
#cp -rf  cacti  /var/www/html/
#vi /var/www/html/cacti/include/config.php
$database_type = "mysql";
$database_default = "cactidb";
$database_hostname = "localhost";
$database_username = "cactiuser";
$database_password = "password_of_cactiuser";
(save & exit)
#cd /var/www/html/cacti
#mysql --user=root  --password=rootpw cactidb < cacti.sql
#chown -R  cactiuser rra/  log/
#vi /etc/etc/crontab
*/5 * * * * cactiuser php /var/www/html/cacti/poller.php > /dev/null 2>&1
# service crond restart
#chkconfig crond on
#service httpd restart
#chkconfig httpd on
#service mysqld restart
#chkconfig mysqld on
open browser:- http://localhost/cacti
username/password- admin/admin
*******************************************************************************
With the help of Mohit Kumar

Sunday, February 12, 2012

recompile PHP5 with mysql support in redhat

Hello Friends,

Today I tried to use phpMiniAdmin for accessing my database through Apache.
 So I Install php ,Apache& mysql on my system.But I didn't get any response from apache.
Upon investigating I found that mysql connector for php is not installed.
So i follow below link to re-install php with mysql.

How To:Steps to Install phpMyAdmin on Linux

Hello Friend,

Recentely i tried to install PhpMyAdmin on my RHEL6 machine.
I tried the following link to complete it.

http://www.thegeekstuff.com/2010/09/install-phpmyadmin/

You could also follow above link to install PhpMyAdmin.

Renew k8s certificates

Check If certificate expires: amikum@~:03:06:54(⎈ |local-cluster:default):sudo kubeadm certs check-expiration CERTIFICATE                EXP...