A sample text widget

Etiam pulvinar consectetur dolor sed malesuada. Ut convallis euismod dolor nec pretium. Nunc ut tristique massa.

Nam sodales mi vitae dolor ullamcorper et vulputate enim accumsan. Morbi orci magna, tincidunt vitae molestie nec, molestie at mi. Nulla nulla lorem, suscipit in posuere in, interdum non magna.

Tomcat listen on Server IP Address

Tomcat listen on Server IP Address

Connector Connector address=”″ port=”8080″ protocol=”HTTP/1.1″ maxHttpHeaderSize=”8192″
maxThreads=”300″ minSpareThreads=”25″ maxSpareThreads=”75″
enableLookups=”false” redirectPort=”8443″ acceptCount=”100″
connectionTimeout=”20000″ disableUploadTimeout=”true”

Connector executor=”tomcatThreadPool”
port=”80″ protocol=”HTTP/1.1″

Change Tomcat default port to 80 and 443

Change Tomcat default port to 80 and 443

Tomcat by default runs on port number 8080, However there is high chance get a port conflict with others program. Sometime we just need to change the Tomcat port number.
Steps of changing the Tomcat Port

1) Locate server.xml in {Tomcat installation folder}\ conf \

2) Find following similar statement

Define a non-SSL HTTP/1.1 Connector on port 8180
Connector port=”8080″ maxHttpHeaderSize=”8192″
maxThreads=”150″ minSpareThreads=”25″ maxSpareThreads=”75″
enableLookups=”false” redirectPort=”8443″ acceptCount=”100″
connectionTimeout=”20000″ disableUploadTimeout=”true”


A “Connector” represents an endpoint by which requests are received
and responses are returned. Documentation at :
Java HTTP Connector: /docs/config/http.html (blocking & non-blocking)
Java AJP Connector: /docs/config/ajp.html
APR (HTTP/AJP) Connector: /docs/apr.html
Define a non-SSL HTTP/1.1 Connector on port 8080

Connector port=”8080″ protocol=”HTTP/1.1″

3) About Tomcat’s server.xml file cites it’s runs on port 8080. Change the Connector port=”8080? port to any other port number.

For example

Connector port=”80″ protocol=”HTTP/1.1″

Above statement instruct Tomcat server runs on port 80 and 443.

4) Edit and save the server.xml file. Restart Tomcat. Done

LMD (Linux Malware Detect) on centos server

LMD (Linux Malware Detect) on centos server

Description: Linux Malware Detect (LMD) is a malware scanner for Linux released under the GNU GPLv2 license, that is designed around the threats faced in shared hosted environments. It uses threat data from network edge intrusion detection systems to extract malware that is actively being used in attacks and generates signatures for detection. In addition, threat data is also derived from user submissions with the LMD checkout feature and from malware community resources. The signatures that LMD uses are MD5 file hashes and HEX pattern matches, they are also easily exported to any number of detection tools such as ClamAV.

Step 1: Downloading, Installing LMD

cd /usr/local/src
tar -zxvf maldetect-current.tar.gz
cd maldetect-*

installation completed to /usr/local/maldetect
config file: /usr/local/maldetect/conf.maldet
exec file: /usr/local/maldetect/maldet
exec link: /usr/local/sbin/maldet
exec link: /usr/local/sbin/lmd
cron.daily: /etc/cron.daily/maldet

Creating a self-signed SSL Certificate

Creating a self-signed SSL Certificate


For this you will need the openssl package. First we want to start by generating a private key.

root@localhost# openssl genrsa -out 1024
Generating RSA private key, 1024 bit long modulus
e is 65537 (0×10001)

Then, we need to generate the certificate request and fill in the appropriate information. Make sure that the “Common Name” matches the domain you want to protect via SSL, so if you domain was, use that. If you wanted to protect (without the www.) then use that.

root@localhost# openssl req -new -key -out
You are about to be asked to enter information that will be incorporated
into your certificate request.
What you are about to enter is what is called a Distinguished Name or a DN.
There are quite a few fields but you can leave some blank
For some fields there will be a default value,
If you enter ‘.’, the field will be left blank.
Country Name (2 letter code) [GB]:
State or Province Name (full name) [Berkshire]:
Locality Name (eg, city) [Newbury]:
Organization Name (eg, company) [My Company Ltd]:
Organizational Unit Name (eg, section) []:
Common Name (eg, your name or your server’s hostname) []
Email Address []

Please enter the following ‘extra’ attributes
to be sent with your certificate request
A challenge password []:
An optional company name []:

Next, generate the self-signed certificate. You can specify the number of days the cert is valid for.

root@localhost# openssl x509 -req -days 365 -in -signkey -out
Signature ok
Getting Private key

Next, move the certificate and keyfile into apache’s SSL directory.

mv /etc/httpd/conf/ssl.key/
mv /etc/httpd/conf/ssl.crt/

SSLEngine on
SSLCertificateFile /etc/httpd/conf/ssl.key/
SSLCertificateKeyFile /etc/httpd/conf/ssl.crt/

JBOSS operations script

JBOSS operations script

The scripts are tested on RHEL 5 (for clustered environment)
JAVA_OPTS=”-Xms1303m -Xmx1303m -XX:MaxPermSize=256m
JAVA_OPTS=”$JAVA_OPTS {you can add your custom JVM / application properties here}”

MULTICAST_ADDR={specify multicast addr}
SERVER={specify profile name}

echo “JBOSS start operation completed”
Note: One of the reasons to pass JVM arguments in the startup script is because the same startup script can be used for all servers in the cluster. Any parameter change can be made in this single file. You can also specify it in run.conf but you might want to sync run.conf in all servers.
grep IPADDR /etc/sysconfig/network-scripts/ifcfg-eth0 |awk -F= ‘{print $2}’
HOST=`cat /proc/sys/kernel/hostname`
echo ${HOST:(-2)}
Note: you can customize the script to provide a numeral server peer id. This script gets the last two digits of host name.

Logging on Jboss

Logging on Jboss

Make your logging choices in the file

App logs location can be defined in

For example, rollover can be done for each hour by uncommenting

JBOSS Admin Console urls

JBOSS Admin Console urls




SSL Setup is same as Tomcat Procedure

1) Create a keystore using keytool utility

#keytool can be found from Java runtime – /opt/jre1.6.0_18/bin/keytool
# Enter values as required

mkdir $JBOSS_HOME/ssl
cd $JBOSS_HOME/ssl

$ keytool -genkey -alias jboss -keyalg RSA -keystore jboss.keystore -validity 3650
Enter keystore password:
Re-enter new password:
What is your first and last name?
What is the name of your organizational unit?
What is the name of your organization?
What is the name of your City or Locality?
What is the name of your State or Province?
What is the two-letter country code for this unit?
[Unknown]: US
Is valuescorrect?
[no]: yes

Enter key password for
(RETURN if same as keystore password):
Re-enter new password:

A .keystore file will be created in the current directory.

2) Update /opt/jboss-eap-5.0/jboss-as/server/default/deploy/jbossweb.sar/server.xml with correct keystore values.

3) Restart the server. Test using https://{ip_address}:8443/context-root/filename.jsp

Apache commands

Apache commands

echo “————————”
echo “Verify Configuration”
echo “————————”
/opt/apache/bin/httpd -f /opt/apacheconf/httpd.conf -t -S

echo “————————”
echo “Start Apache”
echo “————————”

/opt/apache/bin/httpd -f /opt/apacheconf/httpd.conf -k start

echo “————————”
echo “List HTTP Processes”
echo “————————”
sleep 3
ps -ef | grep http

Custom script to stop Apache (

echo “————————”
echo “Stop Apache”
echo “————————”
/opt/apache/bin/httpd -f /opt/apacheconf/httpd.conf -k stop

echo “————————”
echo ” List HTTP Processes”
echo “————————”
sleep 3
ps -ef | grep http

rm /opt/apachelogs/*

List statically compiled modules
/opt/apache/bin/httpd -l or /opt/apache/bin/apachectl -l

Which mpm is used by apache?
/opt/apache/bin/apachectl -l

List all loaded modules
/opt/apache/bin/httpd -t -D DUMP_MODULES

Setup X-Forwarded Proto in Apache

Setup X-Forwarded Proto in Apache

RequestHeader set X-Forwarded-Proto “http”

RequestHeader set X-Forwarded-Proto “https”

Page 159 of 163« First...102030...157158159160161...Last »