edit catalina.sh in tomcat bin folder
add
JAVA_OPTS="-Xms256m -Xmx512m"
# yum install yum-downloadonlyLoading "fastestmirror" plugin Loading "security" plugin Loading mirror speeds from cached hostfile * base: centos.mirrors.tds.net * updates: mirror.myriadnetwork.com * addons: mirrors.gigenet.com * extras: holmes.umflint.edu Setting up Install Process Parsing package install arguments Resolving Dependencies --> Running transaction check ---> Package yum-downloadonly.noarch 0:1.1.10-9.el5.centos set to be updated --> Finished Dependency Resolution Dependencies Resolved ============================================================================= Package Arch Version Repository Size ============================================================================= Installing: yum-downloadonly noarch 1.1.10-9.el5.centos base 9.0 k Transaction Summary ============================================================================= Install 1 Package(s) Update 0 Package(s) Remove 0 Package(s) Total download size: 9.0 k Is this ok [y/N]: y Downloading Packages: (1/1): yum-downloadonly-1 100% |=========================| 9.0 kB 00:00 Running rpm_check_debug Running Transaction Test Finished Transaction Test Transaction Test Succeeded Running Transaction Installing: yum-downloadonly ######################### [1/1] Installed: yum-downloadonly.noarch 0:1.1.10-9.el5.centos Complete!
# yum update httpd -y --downloadonly# yum update httpd -y --downloadonly --downloaddir=/optyum install httpd -y --downloadonly Loading "downloadonly" plugin Loading "fastestmirror" plugin Loading "security" plugin Loading mirror speeds from cached hostfile * base: centos.mirrors.mypsh.com * updates: mirror.steadfast.net * addons: mirrors.gigenet.com * extras: holmes.umflint.edu Setting up Install Process Parsing package install arguments Resolving Dependencies --> Running transaction check ---> Package httpd.i386 0:2.2.3-11.el5_1.centos.3 set to be updated filelists.xml.gz 100% |=========================| 2.8 MB 00:03 filelists.xml.gz 100% |=========================| 681 kB 00:11 filelists.xml.gz 100% |=========================| 122 kB 00:00 filelists.xml.gz 100% |=========================| 150 B 00:00 --> Finished Dependency Resolution Dependencies Resolved ============================================================================= Package Arch Version Repository Size ============================================================================= Installing: httpd i386 2.2.3-11.el5_1.centos.3 base 1.1 M Transaction Summary ============================================================================= Install 1 Package(s) Update 0 Package(s) Remove 0 Package(s) Total download size: 1.1 M Downloading Packages: (1/1): httpd-2.2.3-11.el5 100% |=========================| 1.1 MB 00:01 exiting because --downloadonly specifiedTo see downloaded file, enter:
# ls -l /opt/*.rpm-rw-r--r-- 1 root root 1116426 Jan 17 03:36 /opt/httpd-2.2.3-11.el5_1.centos.3.i386.rpm
-rw-r--r-- 1 root root 83452 Oct 2 2007 /opt/lighttpd-fastcgi-1.4.18-1.el5.rf.i386.rpm
-rw-r--r-- 1 root root 635045 Oct 20 2007 /opt/psad-2.1-1.i386.rpm
# yum -y install yum-utils.noarch# yumdownloader httpdLoaded plugins: rhnplugin httpd-2.2.3-31.el5_4.2.x86_64.rpm | 1.2 MB 00:00
# redhat-config-date# setup# cd /etc# ln -sf /usr/share/zoneinfo/EST localtime# ln -sf /usr/share/zoneinfo/EST localtime# ln -sf /usr/share/zoneinfo/Asia/Calcutta localtime$ dateTue Aug 27 14:46:08 EST 2006
$ export TZ=America/Los_Angeles
$ date
Thu Aug 27 11:10:08 PST 2006
# date -s "2 OCT 2006 18:00:00"# date --set="2 OCT 2006 18:00:00"# date +%Y%m%d -s "20081128"# date +%T -s "10:13:13"# date +%T%p -s "6:10:30AM"
# date +%T%p -s "12:10:30PM"/home/me/dir1 /home/me/dir2 /home/me/abc /home/me/xyzHow do I execute zyz and abc file while using a tar command?
$ tar -zcvf /tmp/mybackup.tar.gz --exclude='abc' --exclude='xyz' /home/me$ vi exclude.txtAppend file names:abc
xyz
*.bak
$ tar -zcvf /tmp/mybackup.tar.gz -X exclude.txt /home/me
wget http://prdownloads.sourceforge.net/nagios/nagios-2.9.tar.gz?download
tar -xzvf nagios-2.9.tar.gz
Create Installation Directory
useradd nagios
mkdir /usr/local/nagios
chown nagios.nagios /usr/local/nagios
groupadd nagcmd
Add the users that your web server and Nagios run as to the newly created group
usermod -G nagcmd nagios
usermod -G nagcmd nobody
./configure –prefix=/usr/local/nagios –with-cgiurl=/nagios/cgi-bin –with-htmurl=/nagios/ –with-nagios-user=nagios –with-nagios-group=nagios –with-command-group=nagcmd
make all
make install
make install-init
Compile Binaries- make
make install
ScriptAlias /nagios/cgi-bin/ /usr/local/nagios/sbin/
<Directory /usr/local/nagios/sbin/>
AllowOverride AuthConfig
Options ExecCGI
Allow from all
Order allow,deny
</Directory>
Alias /nagios/ /usr/local/nagios/share/
<Directory /usr/local/nagios/share>
Options None
AllowOverride AuthConfig
Order allow,deny
Allow from all
</Directory>
htpasswd -c /usr/local/nagios/etc/htpasswd.users nagiosadmin
Set use_authentication=0 in cgi.cfg file.
authorized_for_system_information=nagiosadmin
authorized_for_configuration_information=nagiosadmin
authorized_for_system_commands=nagiosadmin
authorized_for_all_services=nagiosadmin
authorized_for_all_hosts=nagiosadmin
authorized_for_all_service_commands=nagiosadmin
authorized_for_all_host_commands=nagiosadmin
cd /user/local/nagios/etc
mkdir hosts.
mkdir services.
cfg_dir=/usr/local/nagios/etc/hosts
cfg_dir=/usr/local/nagios/etc/services
# Prevent root logins: PermitRootLogin no
service sshd restart
AllowUsers alice bob
# Protocol 2,1 Protocol 2
# Run ssh on a non-standard port: Port 2345 #Change me
$ ssh -p 2345 myserver
fish://myserver:2345/remote/dir
# Client ~/.ssh/config
Host myserver
HostName 72.232.194.162
User bob
Port 2345
$ chmod 600 ~/.ssh/config
iptables -A INPUT -p tcp -s 72.232.194.162 --dport 22 -j ACCEPT
iptables -A INPUT -p tcp --dport 22 -m recent --set --name ssh --rsource iptables -A INPUT -p tcp --dport 22 -m recent ! --rcheck --seconds 60 --hitcount 4 --name ssh --rsource -j ACCEPT
iptables -A INPUT -p tcp --dport 22 --syn -m limit --limit 1/m --limit-burst 3 -j ACCEPT iptables -A INPUT -p tcp --dport 22 --syn -j DROP
$ ssh-keygen -t rsa
$ chmod 700 ~/.ssh $ chmod 600 ~/.ssh/id_rsa
$ cat id_rsa.pub >> ~/.ssh/authorized_keys
$ chmod 700 ~/.ssh $ chmod 600 ~/.ssh/authorized_keys
# Disable password authentication forcing use of keys PasswordAuthentication no