1. Create test.c Above file contains :--------[kamalma@test-1 C_Programming]$ cat test.c#include#includeint main() { printf("\n I'm kamal \n");return 0;}--------2. Compile it and check its output.OP :-------[kamalma@test-1 C_Programming]$ ./test I'm kamal[kamalma@test-1 C_Programming]$-------3. Modify test.c and add new lines or codes in it. Lets say it test_modifed.c. This file contains following codes :------[kamalma@test-1 C_Programming]$ cat test_modified.c#include#includeint main() { printf("\n I'm kamal \n"); printf("\nI...
Tuesday, 17 July 2012
Sunday, 3 June 2012
How to redirect tomcat log to syslog server?
Posted on 21:49 by Unknown
I assume that you are going to use log4j tool to log the tomcat messages. In order to redirect these messages in syslog file, you should modify4j$CATALINA_BASE/lib/log4j.properties and make sure following entries are present : -------------------log4j.rootLogger=INFO, CATALINA# Define all the appenderslog4j.appender.CATALINA=org.apache.log4j.DailyRollingFileAppenderlog4j.appender.CATALINA.File=${catalina.base}/logs/catalina.log4j.appender.CATALINA.Append=truelog4j.appender.CATALINA.Encoding=UTF-8# Roll-over the log once per daylog4j.appender.CATALINA.DatePattern='.'yyyy-MM-dd'.log'log4j.appender.CATALINA.layout...
Monday, 16 April 2012
How to configure apache-tomcat on linux box?
Posted on 23:10 by Unknown
Environment : RHEL 5.8Package version : JDk 1.7.0_03Apache tomcat : 6.0.35Reference : http://www.puschitz.com/InstallingTomcat.htmlJDK setup :pwd/jdk1.7.0_03[root@vm13 jdk1.7.0_03]# export JAVA_HOME=/jdk1.7.0_03[root@vm13 jdk1.7.0_03]# export PATH=$JAVA_HOME/bin:$PATH[root@vm13 jdk1.7.0_03]# which java/jdk1.7.0_03/bin/java[root@vm13 jdk1.7.0_03]# java -versionjava version "1.7.0_03"Java(TM) SE Runtime Environment (build 1.7.0_03-b04)Java HotSpot(TM) 64-Bit Server VM (build 22.1-b02, mixed mode)[root@vm13 jdk1.7.0_03]# Apache Tomcat setup :[root@vm13...
Wednesday, 21 March 2012
How to enable php in apache on RHEL ?
Posted on 23:05 by Unknown
1. In order to enable php engine in apache, you should make sure php is installed in the system first. Then refer following steps :locate libphp5.so In most of cases, libphp5.so will be present inside /etc/httpd/modules2. Add following in httpd.conf :------------------# Use for PHP 5.x:LoadModule php5_module modules/libphp5.soAddHandler php5-script .php # Add index.php to your DirectoryIndex line:DirectoryIndex index.html index.phpAddType text/html .php# PHP Syntax Coloring# (optional but useful for reading PHP source for debugging):AddType application/x-httpd-php-source...
Wednesday, 14 March 2012
How to store sftp log messages in custom file on RHEL 6?
Posted on 06:01 by Unknown
How to setup chrooted sftp account on RHEL 6?$groupadd sftponly$$useradd user123$usermod -d /myhome -g sftponly -s /bin/false user123$mkdir -p /chroots/user123 ; chmod -R 755 /chroots/user123$mkdir /chroots/user123/myhome ; chown user123:sftponly /chroots/user123/myhome$passwd user123Also make sure below is successfully configured :How to store sftp log messages in custom file on RHEL 6?--------------------------------1. Make sure "AUTHPRIV" facility is used in sshd_config file. Sample file looks like :$ cat /etc/ssh/sshd_config :-------------Subsystem...
Wednesday, 7 March 2012
How to setup multiple gateways for multiple Ethernets?
Posted on 19:05 by Unknown
If you would like to use multiple gateways, you should use iproute package and define the gateway in two tables in conjunction with each interface. Here is an example how to configure it :Let's assume eth0 has gateway 10.1XX.69.1 and eth3's gateway is 10.1XX.66.1.So, you should execute following steps :echo 1 ISP1 >> /etc/iproute2/rt_tablesecho 2 ISP2 >> /etc/iproute2/rt_tablesThe next step is to have some routing rules and routes:For the ISP1 table:ip route add default via 10.1XX.69.1 dev eth0 table ISP1ip rule add from 10.1XX.69.0/24...
Wednesday, 29 February 2012
How to create bridge on top of bonding in linux?
Posted on 02:00 by Unknown
I have created following scripts :------------/etc/sysconfig/network-scripts/ifcfg-eth0DEVICE=eth0NM_CONTROLLED=noBOOTPROTO=noneONBOOT=yesMASTER=bond0SLAVE=yesTYPE=EthernetIPV6INIT=noUSERCTL=no---------------/etc/sysconfig/network-scripts/ifcfg-eth0DEVICE=eth1NM_CONTROLLED=noBOOTPROTO=noneONBOOT=yesMASTER=bond0SLAVE=yesTYPE=EthernetIPV6INIT=noUSERCTL=no--------------/etc/sysconfig/network-scripts/ifcfg-bond0DEVICE=bond0ONBOOT=yesBOOTPROTO=noneUSERCTL=noIPV6INIT=noBONDING_OPTS="mode=1 miimon=100 updelay=200 downdelay=200 primary=eth0"BRIDGE=br0-------------/etc/sysconfig/network-scripts/ifcfg-br0DEVICE=br0TYPE=BridgeBOOTPROTO=noneIPADDR=10.XXX.XXX.X7NETMASK=255.255.255.XXXGATEWAY=10.XXX.XXX.XXXONBOOT=yesDELAY=0IPV6INIT=no-------------Also...
Friday, 24 February 2012
How to start apache uisng worker MPM?
Posted on 06:34 by Unknown
1. Check which MPM is running currently : /usr/sbin/apachectl -lIf you see worker.c in the list of loaded modules, your Apache is running Worker MPM. If prefork.c, it is running prefork.2. To determine if apache has Worker MPM compiled in:/usr/sbin/httpd.worker -lIf you see worker.c in the list of compiled-in modules, Apache can run Worker MPM.3. Un-Comment HTTPD=/usr/sbin/httpd.worker in /etc/sysconfig/httpd4. service httpd restartNote : Please recompile php with thread-safe option(php still doesn't support worker MPM. You need mod_fcgid ), else...
Wednesday, 22 February 2012
How to create reverse DNS record in bind?
Posted on 01:33 by Unknown
How to create reverse DNS record in bind :Used Environment : RHEL 6Steps followed :1. Add following lines in /etc/named.conf :---------zone "0.168.192.in-addr.arpa" IN { type master; file "0.168.192.in-addr.arpa"; allow-update { none; };};---------2. Create zone for this reverse record :-------------------$cat /var/named/0.168.192.in-addr.arpa$TTL 600@ IN SOA ns1.example.com. host.example.com. ( 2012013001 ;Serial Number 86400 ;refresh 7200 ;retry 3600000 ;expire...
Monday, 2 January 2012
Which command will provide IO details of all processes in the system?
Posted on 22:33 by Unknown
You can execute following command to get the details :$ for i in {1..65353}; do if [ -f /proc/$i/io ] ; then echo "---------------------------------------------------"; echo "Process name :" ; cat /proc/$i/cmdline; echo "PID : $i" ; echo "IO Details:" ; cat /proc/$i/io ; fi; d...
Subscribe to:
Posts (Atom)