Skip to main content

Posts

Showing posts from May, 2014

How to configure CVS

Steps: 1. install cvs and xinetd on the server $yum install cvs $yum install xinetd NOTE: check whether cvs (or xinetd) has been installed: $rpm -qa | grep cvs create your CVS home repository: mkdir /var/local/cvshome add it as CVSROOT and export to profile vim /etc/profile ##add line  export CVSROOT=/var/local/cvshome 2. set up cvs group and user on the server: $groupadd cvsusers $useradd -g cvsusers -G cvsusers -d /var/local/cvshome cvsadmin $passwd  cvsadmin    # set up password for  cvsadmin Add harun to the cvs group: $usermod -G harun cvsusers Check whether harun is in the cvs group: $groups harun 3. change owner of /home/cvsroot if necessary, chmod for /home/cvsroot: $chown -R cvsadmin:cvsusers /var/local/cvshome $chmod -R 775    /var/local/cvshome 4. initialize cvs: (login as cvsroot) $cd    /var/local/cvshome $cvs -d   /var/local/cvshome  init  # full path is required ...

IPTABLE rules for a Secure App Host

Incoming Rules: Re-route HTTP,HTTPS connections to different port: iptables -t nat -A PREROUTING -i eth1 -p tcp --dport 80 -j REDIRECT --to-port 8080 iptables -t nat -A PREROUTING -i eth1 -p tcp --dport 443 -j REDIRECT --to-port 8443 Allow IP block for SSH connection: iptables -A INPUT -i eth1 -p tcp -s 10.190.0.0/16 --dport 22 -m state --state NEW,ESTABLISHED -j ACCEPT Allow IP block for HTTP,HTTPS connection: i ptables -A INPUT -i eth1 -p tcp -m multiport --dports 8080,8443 -m state --state NEW,ESTABLISHED -j ACCEPT Allow IP block for ICMP: iptables -A INPUT -p icmp --icmp-type 8 -s 10.190.0.0/16 -m state --state NEW,ESTABLISHED,RELATED -j ACCEPT Outgoing rules: Allow outgoing DB connection: i ptables -A OUTPUT -o eth1 -p tcp -m tcp --dport 1521 -m state --state NEW,ESTABLISHED -j ACCEPT iptables -A INPUT  -i eth1 -p tcp -m tcp --sport 1521 -m state --state NEW,ESTABLISHED -j ACCEPT Allow outgoing SSH,HTTP,HTTPS,SMTP connection: iptables -A OU...

iptables rules for outgoing FTP

For establishing outgoing active and passive FTP connection you can apply the following rules: iptables -A INPUT -p tcp --sport 21 -m state --state ESTABLISHED -j ACCEPT iptables -A INPUT -p tcp --sport 20 -m state --state ESTABLISHED,RELATED -j ACCEPT iptables -A INPUT -p tcp --sport 1024: --dport 1024: -m state --state ESTABLISHED -j ACCEPT iptables -A OUTPUT -p tcp --dport 21 -m state --state NEW,ESTABLISHED -j ACCEPT iptables -A OUTPUT -p tcp --dport 20 -m state --state ESTABLISHED -j ACCEPT iptables -A OUTPUT -p tcp --sport 1024: --dport 1024: -m state --state ESTABLISHED,RELATED,NEW -j ACCEPT 21:  for default FTP port, if you don't use this change the port number 20: to establish FTP connection It also allows the random ports >=1024 for related connections.

How to check RHEL version & bit

[root@ijupiter ~]# cat /etc/redhat-release Red Hat Enterprise Linux ES release 4 (Nahant Update 6) [root@ijupiter ~]# lsb_release -i -r Distributor ID: RedHatEnterpriseES Release:        4 [root@ijupiter ~]# uname -m x86_64 [root@ijupiter ~]# uname -a Linux ijupiter 2.6.9-67.ELsmp #1 SMP Wed Nov 7 13:56:44 EST 2007 x86_64 x86_64 x86_64 GNU/Linux [root@ijupiter ~]#

Load balancing using Apache, Tomcat, mod_jk

How Apache httpd web server communicate to Tomcat server                Before we going to detail about how communication happen between httpd server and tomcat. How many ports are bind when we start single tomcat? shutdown port http connector port https connector port (optional) ajp port The port configuration are stored in $CATALINA_HOME/conf/server.xml file. we can change the ports when its necessary. Steps to Implement Virtual Host Concept in this Scenario: Install Apache httpd Web Server Install mod_jk connector Configure JK Connector Configure Apache httpd server apply virtual host concepts Prerequisite  : We already installed Tomcat in different departments and deployed the application and works fine. Install Apache httpd web server:          We can install Apache web server in two ways.               ...