Wednesday, April 22, 2015

Liferay Clustering




INTRODUCTION


Once you are done with website portal development you need to make sure that the application is having a high availability and minimum of downtime. To make sure application can handle more requests and arrange for more guaranteed uptime here is a sample Liferay clustering set up.
There can be various clustering configurations based on the availability of webservers, load balancers, application servers and database servers.
This document gives a complete clustering based on below components:


  1. Apache Web server (1)
  2.  Liferay Tomcat Application Servers (2)
  3.   Postgres DB server (1) 
  4.   Actual Physical Servers (3)



SAMPLE SETUP DIAGRAM


Below is the sample clustering used.





WEB SERVER CONFIGURATIONS

Pre-requisites:

a.     Apache Web Server must be installed.
b.     MOD_JK must be installed

1.             In /etc/httpd/conf

Add below entries at the end in httpd.conf file
 

<VirtualHost 10.66.70.184:80>
  ServerName acc01.ad.test.com
  JkMount / loadbalancer
  JkMount /* loadbalancer
</VirtualHost>

#Load the mod_jk connector
# Include mod_jk's specific configuration file 
Include conf/mod_jk.conf

2.             In /etc/httpd/conf

Add below entries at the end in mod_jk.conf file, create a mod_jk.conf file if it is not there
# Load mod_jk module
# Specify the filename of the mod_jk lib
LoadModule jk_module modules/mod_jk.so

# Where to find workers.properties
JkWorkersFile conf/workers.properties

# Where to put jk logs
JkLogFile logs/mod_jk.log

# Set the jk log level [debug/error/info]
JkLogLevel info

# Select the log format
JkLogStampFormat  "[%a %b %d %H:%M:%S %Y]"

# JkOptions indicates to send SSK KEY SIZE
JkOptions +ForwardKeySize +ForwardURICompat -ForwardDirectories

# JkRequestLogFormat
JkRequestLogFormat "%w %V %T"
              
# Mount your applications
JkMount /* loadbalancer

# Add shared memory.
# This directive is present with 1.2.10 and
# later versions of mod_jk, and is needed for
# for load balancing to work properly
JkShmFile logs/jk.shm
             
# Add jkstatus for managing runtime data
<Location /jkstatus/>
    JkMount status
    Order deny,allow
    Deny from all
    Allow from 127.0.0.1
</Location>


 


3.             In /etc/httpd/conf

Add below entries at the end in workers.properties file, create a workers.properties file if it is not there
# Define list of workers that will be used
# for mapping requests
worker.list=loadbalancer,status
# Define Node1
# modify the host as your host IP or DNS name.
worker.node1.port=8009
worker.node1.host=10.66.70.184
worker.node1.type=ajp13
worker.node1.lbfactor=1
worker.node1.socket_timeout=60
worker.node1.connection_pool_timeout=60
worker.node1.ping_mode=A
worker.node1.ping_timeout=20000
worker.node1.connect_timeout=20000

# Define Node2
# modify the host as your host IP or DNS name.
worker.node2.port=8009
worker.node2.host=10.66.70.185
worker.node2.type=ajp13
worker.node2.lbfactor=1
worker.node2.socket_timeout=60
worker.node2.connection_pool_timeout=60
worker.node2.ping_mode=A
worker.node2.ping_timeout=20000
worker.node2.connect_timeout=20000

# Load-balancing behaviour
worker.loadbalancer.type=lb
worker.loadbalancer.balance_workers=node1,node2
worker.loadbalancer.sticky_session=1
# Status worker for managing load balancer
worker.status.type=status




4.         In /etc/httpd/modules

Add the mod_jk.so file if not there. This is basically a header/library file with version which we need to include.
 



LIFERAY TOMCAT APPLICATION SERVER CONFIGURATIONS

Pre-requisites:
a.     Liferay Tomcat must be installed / copied in the required directory.

Note: All the below mentioned file entries from point 1 to 7 must be there in both the application nodes.
  
1.             In    /home/admin/liferay-portal-6.1.1-ce-ga2

Create portal-ext.properties file if it is not there and add the below entries

 
#Below are database entries to connect to database

jdbc.default.driverClassName=org.postgresql.Driver
jdbc.default.url=jdbc:postgresql://10.66.70.183:5432/liferay24feb2014
jdbc.default.username=postgres
jdbc.default.password=postgres

#Below is DB server IP for outgoing link

cluster.link.autodetect.address=10.66.70.183:5432

#Below entries are required to enable EHCACHE

net.sf.ehcache.configurationResourceName=/ehcache/hibernate-clustered.xml
ehcache.multi.vm.config.location=/ehcache/liferay-multi-vm-clustered.xml

#Below entries are required for tomcat clustering

cluster.link.enabled=true
lucene.replicate.write=true
ehcache.cluster.link.replication.enabled=true
web.server.display.node=true
org.quartz.jobStore.isClustered=true

ehcache.bootstrap.cache.loader.factory=com.liferay.portal.cache.ehcache.JGroupsBootstrapCacheLoaderFactory
ehcache.cache.event.listener.factory=net.sf.ehcache.distribution.jgroups.JGroupsCacheReplicatorFactory
ehcache.cache.manager.peer.provider.factory=net.sf.ehcache.distribution.jgroups.JGroupsCacheManagerPeerProviderFactory

# Set this to true to enable the cluster executor debugging. This will
# attach a debugging listener which will log every cluster event it receives.

cluster.executor.debug.enabled=true


2.             In   /home/admin/liferay-portal-6.1.1-ce-ga2/tomcat-7.0.27/bin

In setenv.sh file add the below entries
JAVA_OPTS="$JAVA_OPTS -Dfile.encoding=UTF8 -Dorg.apache.catalina.loader.WebappClassLoader.ENABLE_CLEAR_REFERENCES=false -Duser.timezone=IST -Xmx1024m -XX:MaxPermSize=256m -Djgroups.bind_addr=10.66.70.184 -Djava.net.preferIPv4Stack=true"



3.             In   /home/admin/liferay-portal-6.1.1-ce-ga2/tomcat-7.0.27/conf

In web.xml file add the below entries at the end just before closing tag </web-app>

<distributable/>



4.             In   /home/admin/liferay-portal-6.1.1-ce-ga2/tomcat-7.0.27/conf

In server.xml file add the below entries

For NODE 1
<Engine name="Catalina" defaultHost="localhost" jvmRoute="node1">

For NODE 2
<Engine name="Catalina" defaultHost="localhost" jvmRoute="node2">

For both the nodes add below entry in between <Engine> </Engine> opening and closing tag
<Cluster className="org.apache.catalina.ha.tcp.SimpleTcpCluster"
       channelSendOptions="6">
 
  <Manager className="org.apache.catalina.ha.session.BackupManager"
       expireSessionsOnShutdown="false"
       notifyListenersOnReplication="true"
       mapSendOptions="6"/>

      
  <Channel className="org.apache.catalina.tribes.group.GroupChannel">
    <Membership className="org.apache.catalina.tribes.membership.McastService"
       address="228.0.0.4"
       port="45564"
       frequency="500"
       dropTime="3000"/>
    <Receiver className="org.apache.catalina.tribes.transport.nio.NioReceiver"
      address="auto"
       port="5000"
       selectorTimeout="100"
       maxThreads="6"/>

    <Sender className="org.apache.catalina.tribes.transport.ReplicationTransmitter">
      <Transport className="org.apache.catalina.tribes.transport.nio.PooledParallelSender"/>
    </Sender>
    <Interceptor className="org.apache.catalina.tribes.group.interceptors.TcpFailureDetector"/>
    <Interceptor className="org.apache.catalina.tribes.group.interceptors.MessageDispatch15Interceptor"/>
    <Interceptor className="org.apache.catalina.tribes.group.interceptors.ThroughputInterceptor"/>
  </Channel>

  <Valve className="org.apache.catalina.ha.tcp.ReplicationValve"
        filter=".*\.gif;.*\.js;.*\.jpg;.*\.png;.*\.htm;.*\.html;.*\.css;.*\.txt;"/>

  <ClusterListener className="org.apache.catalina.ha.session.ClusterSessionListener"/>
</Cluster>


5.             In   /home/admin/liferay-portal-6.1.1-ce-ga2/tomcat-7.0.27/conf

In context.xml file add the below entries


<Context distributable="true">
  
6.             In   /home/admin/liferay-portal-6.1.1-ce-ga2/tomcat-7.0.27/webapps /ROOT/WEB-INF/classes/ehcache

Create an ehcache folder if not there also add a file hibernate-clustered.xml with below entries.

<ehcache xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="ehcache.xsd">
        <diskStore path="ehcache.disk.store.dir/hibernate" />
        <cacheManagerEventListenerFactory class="" properties="" />
        <cacheManagerPeerProviderFactory
                class="net.sf.ehcache.distribution.jgroups.JGroupsCacheManagerPeerProviderFactory"
                properties="connect=TCP(bind_port=${jgroups.bind_port:7700};port_range=5;loopback=true;recv_buf_size=20M;send_buf_size=640K;discard_incompatible_packets=true;max_bundle_size=64K;max_bundle_timeout=30;enable_bundling=true;use_send_queues=true;sock_conn_timeout=300;timer_type=new;timer.min_threads=4;timer.max_threads=10;timer.keep_alive_time=3000;timer.queue_max_size=500;thread_pool.enabled=true;thread_pool.min_threads=1;thread_pool.max_threads=10;thread_pool.keep_alive_time=5000;thread_pool.queue_enabled=false;thread_pool.queue_max_size=100;thread_pool.rejection_policy=discard;oob_thread_pool.enabled=true;oob_thread_pool.min_threads=1;oob_thread_pool.max_threads=8;oob_thread_pool.keep_alive_time=5000;oob_thread_pool.queue_enabled=false;oob_thread_pool.queue_max_size=100;oob_thread_pool.rejection_policy=discard):
                           TCPPING(initial_hosts=${jgroups.tcpping.initial_hosts};port_range=10;timeout=3000;num_initial_members=3):
                           VERIFY_SUSPECT(timeout=1500):
                           MERGE2(min_interval=10000;max_interval=30000):
                           FD_SOCK():
                           FD(timeout=3000;max_tries=3):
                           BARRIER():
                           pbcast.NAKACK(use_mcast_xmit=false;gc_lag=0;retransmit_timeout=300,600,1200,2400,4800;discard_delivered_msgs=true):
                           UNICAST(timeout=300,600,1200):
                           pbcast.GMS(join_timeout=5000;join_retry_timeout=2000;print_local_addr=true):
                           pbcast.STABLE(stability_delay=1000;desired_avg_gossip=50000;max_bytes=4M):
                           UFC(max_credits=2M;min_threshold=0.4):
                           MFC(max_credits=2M;min_threshold=0.4):
                           FRAG2(frag_size=60K):
                           pbcast.STREAMING_STATE_TRANSFER()"
                propertySeparator="::"
        />
        <cacheManagerPeerListenerFactory
                class="net.sf.ehcache.distribution.RMICacheManagerPeerListenerFactory"
        />

        <!--
        Hibernate will use the defaultCache unless custom configurations are defined
        below for individual domain objects, collection, queries, etc.
        -->

        <defaultCache
                maxElementsInMemory="10000"
                eternal="false"
                timeToIdleSeconds="30"
                overflowToDisk="false"
        >
        <cacheEventListenerFactory
                        class="net.sf.ehcache.distribution.jgroups.JGroupsCacheReplicatorFactory"
                        properties="replicatePuts=false,replicateUpdatesViaCopy=false"
                        propertySeparator=","
                />
                <bootstrapCacheLoaderFactory class="net.sf.ehcache.distribution.jgroups.JGroupsBootstrapCacheLoaderFactory" />
        </defaultCache>

        <!--
    Tracks the timestamps of the most recent updates to particular tables. It is
    important that the cache timeout of the underlying cache implementation be
    set to a higher value than the timeouts of any of the query caches. In fact,
    it is recommend that the the underlying cache not be configured for expiry
    at all.
    -->

        <cache
                name="org.hibernate.cache.UpdateTimestampsCache"
                maxElementsInMemory="5000"
                eternal="true"
                overflowToDisk="false"
        >
        <cacheEventListenerFactory
                        class="net.sf.ehcache.distribution.jgroups.JGroupsCacheReplicatorFactory"
                />
                <bootstrapCacheLoaderFactory class="net.sf.ehcache.distribution.jgroups.JGroupsBootstrapCacheLoaderFactory" />
        </cache>

        <!--
        The cache name is the same as the class name specified in your Hibernate
        mapping file.
        -->

        <cache
                name="com.liferay.portal.model.impl.UserImpl"
                maxElementsInMemory="10000"
                eternal="false"
        timeToIdleSeconds="30"
                overflowToDisk="false"
        >
        <cacheEventListenerFactory
                        class="net.sf.ehcache.distribution.jgroups.JGroupsCacheReplicatorFactory"
                        properties="replicatePuts=false,replicateUpdatesViaCopy=false"
                        propertySeparator=","
                />
                <bootstrapCacheLoaderFactory class="net.sf.ehcache.distribution.jgroups.JGroupsBootstrapCacheLoaderFactory" />
        </cache>
</ehcache>


7.  In   /home/admin/liferay-portal-6.1.1-ce-ga2/tomcat-7.0.27/webapps/ROOT/WEB-INF/classes/ehcache

Create a ehcache folder if not there also add a file liferay-multi-vm-clustered.xml with below entries.

<ehcache xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="ehcache.xsd">

        <!--
        Caches in this file can be clustered and are configured to be clustered.
        -->

        <diskStore path="ehcache.disk.store.dir/liferay-multi-vm" />
        <cacheManagerEventListenerFactory class="" properties="" />
        <cacheManagerPeerProviderFactory
                class="net.sf.ehcache.distribution.jgroups.JGroupsCacheManagerPeerProviderFactory"
                properties="connect=TCP(bind_port=7800;port_range=5;loopback=true;recv_buf_size=20M;send_buf_size=640K;discard_incompatible_packets=true;max_b
undle_size=64K;max_bundle_timeout=30;enable_bundling=true;use_send_queues=true;sock_conn_timeout=300;timer_type=new;timer.min_threads=4;timer.max_threads=10;t
imer.keep_alive_time=3000;timer.queue_max_size=500;thread_pool.enabled=true;thread_pool.min_threads=1;thread_pool.max_threads=10;thread_pool.keep_alive_time=5
000;thread_pool.queue_enabled=false;thread_pool.queue_max_size=100;thread_pool.rejection_policy=discard;oob_thread_pool.enabled=true;oob_thread_pool.min_threa
ds=1;oob_thread_pool.max_threads=8;oob_thread_pool.keep_alive_time=5000;oob_thread_pool.queue_enabled=false;oob_thread_pool.queue_max_size=100;oob_thread_pool
.rejection_policy=discard):
                           TCPPING(initial_hosts=${jgroups.tcpping.initial_hosts};port_range=10;timeout=3000;num_initial_members=3):
                           VERIFY_SUSPECT(timeout=1500):
                           MERGE2(min_interval=10000;max_interval=30000):
                           FD_SOCK():
                           FD(timeout=3000;max_tries=3):
                           BARRIER():
                           pbcast.NAKACK(use_mcast_xmit=false;gc_lag=0;retransmit_timeout=300,600,1200,2400,4800;discard_delivered_msgs=true):
                           UNICAST(timeout=300,600,1200):
                           pbcast.GMS(join_timeout=5000;join_retry_timeout=2000;print_local_addr=true):
                           pbcast.STABLE(stability_delay=1000;desired_avg_gossip=50000;max_bytes=4M):
                           UFC(max_credits=2M;min_threshold=0.4):
                           MFC(max_credits=2M;min_threshold=0.4):
                           FRAG2(frag_size=60K):
                           pbcast.STREAMING_STATE_TRANSFER()"
                propertySeparator="::"
        />
        <cacheManagerPeerListenerFactory
                class="net.sf.ehcache.distribution.RMICacheManagerPeerListenerFactory"
        />
        <defaultCache
                maxElementsInMemory="10000"
                eternal="false"
        timeToIdleSeconds="30"
                overflowToDisk="false"
        >
        <cacheEventListenerFactory
                        class="net.sf.ehcache.distribution.jgroups.JGroupsCacheReplicatorFactory"
                        properties="replicatePuts=false,replicateUpdatesViaCopy=false"
                        propertySeparator=","
                />
                <bootstrapCacheLoaderFactory class="net.sf.ehcache.distribution.jgroups.JGroupsBootstrapCacheLoaderFactory" />
        </defaultCache>
        <cache
                name="com.liferay.portal.kernel.dao.orm.FinderCache"
                maxElementsInMemory="10000"
                eternal="false"
        timeToIdleSeconds="30"
                overflowToDisk="false"
        >
        <cacheEventListenerFactory
                        class="net.sf.ehcache.distribution.jgroups.JGroupsCacheReplicatorFactory"
                        properties="replicatePuts=false,replicateUpdatesViaCopy=false"
                        propertySeparator=","
                />
                <bootstrapCacheLoaderFactory class="net.sf.ehcache.distribution.jgroups.JGroupsBootstrapCacheLoaderFactory" />
        </cache>
        <cache
                name="com.liferay.portal.security.permission.PermissionCacheUtil"
                maxElementsInMemory="10000"
                eternal="false"
        timeToIdleSeconds="30"
                overflowToDisk="false"
        >
        <cacheEventListenerFactory
                        class="net.sf.ehcache.distribution.jgroups.JGroupsCacheReplicatorFactory"
                        properties="replicatePuts=false,replicateUpdatesViaCopy=false"
                        propertySeparator=","
                />
                <bootstrapCacheLoaderFactory class="net.sf.ehcache.distribution.jgroups.JGroupsBootstrapCacheLoaderFactory" />
        </cache>
        <cache
                name="com.liferay.portal.service.impl.PortletPreferencesLocalUtil"
                maxElementsInMemory="10000"
                eternal="false"
        timeToIdleSeconds="30"
                overflowToDisk="false"
        >
        <cacheEventListenerFactory
                        class="net.sf.ehcache.distribution.jgroups.JGroupsCacheReplicatorFactory"
                        properties="replicatePuts=false,replicateUpdatesViaCopy=false"
                        propertySeparator=","
                />
                <bootstrapCacheLoaderFactory class="net.sf.ehcache.distribution.jgroups.JGroupsBootstrapCacheLoaderFactory" />
        </cache>
        <cache
                name="com.liferay.portal.servlet.filters.cache.CacheUtil"
                maxElementsInMemory="1000"
                eternal="false"
                timeToLiveSeconds="3600"
                overflowToDisk="false"
        >
        <cacheEventListenerFactory
                        class="net.sf.ehcache.distribution.jgroups.JGroupsCacheReplicatorFactory"
                        properties="replicatePuts=false,replicateUpdatesViaCopy=false"
                        propertySeparator=","
                />
                <bootstrapCacheLoaderFactory class="net.sf.ehcache.distribution.jgroups.JGroupsBootstrapCacheLoaderFactory" />
        </cache>
        <cache
                name="com.liferay.portlet.calendar.service.impl.CalEventLocalUtil"
                maxElementsInMemory="10000"
                eternal="false"
        timeToIdleSeconds="30"
                overflowToDisk="false"
        >
        <cacheEventListenerFactory
                        class="net.sf.ehcache.distribution.jgroups.JGroupsCacheReplicatorFactory"
                        properties="replicatePuts=false,replicateUpdatesViaCopy=false"
                        propertySeparator=","
                />
                <bootstrapCacheLoaderFactory class="net.sf.ehcache.distribution.jgroups.JGroupsBootstrapCacheLoaderFactory" />
        </cache>
        <!--
        <cache
                name="com.liferay.portlet.journalcontent.util.JournalContentUtil"
                maxElementsInMemory="1000"
                eternal="false"
                timeToLiveSeconds="3600"
                overflowToDisk="false"
        >
        <cacheEventListenerFactory
                        class="net.sf.ehcache.distribution.jgroups.JGroupsCacheReplicatorFactory"
                        properties="replicatePuts=false,replicateUpdatesViaCopy=false"
                        propertySeparator=","
                />
                <bootstrapCacheLoaderFactory class="net.sf.ehcache.distribution.jgroups.JGroupsBootstrapCacheLoaderFactory" />
        </cache>
        -->
</ehcache>


POSTGRES DATABASE SERVER CONFIGURATIONS


1.             In   /opt/PostgreSQL/9.2/data

In pg_hba.conf file add the below entries at the end

#Below entry allow all IP's and all usernames to connect to all databases  connections

host    all             all              0.0.0.0/0              md5


 

FILES AND LOCATION CHECKLIST








Checklist


Node
Applications
Operating System
Locations
S.No
Files Modified
Location of file








WEBSERVER
1
Apache/2.2.15
Red Hat Enterprise Linux
10.66.70.184
1
httpd.conf
/etc/httpd/conf


mod_jk/1.2.31
Server release 6.2 (Santiago)

2
mod_jk.conf
/etc/httpd/conf





3
mod_jk.so
/etc/httpd/modules





4
workers.properties
/etc/httpd/conf








LIFERAY PORTAL
1
liferay-portal-6.1.1-ce-ga2
Red Hat Enterprise Linux
10.66.70.184
1
context.xml
/home/admin/liferay-portal-6.1.1-ce-ga2/tomcat-7.0.27/conf



Server release 6.2 (Santiago)

2
server.xml
/home/admin/liferay-portal-6.1.1-ce-ga2/tomcat-7.0.27/conf





3
web.xml
/home/admin/liferay-portal-6.1.1-ce-ga2/tomcat-7.0.27/conf





4
setenv.sh
/home/admin/liferay-portal-6.1.1-ce-ga2/tomcat-7.0.27/bin





5
portal-ext.properties
/home/admin/liferay-portal-6.1.1-ce-ga2





6
hibernate-clustered.xml
/home/admin/liferay-portal-6.1.1-ce-ga2/tomcat-7.0.27/webapps/ROOT/WEB-INF/classes/ehcache





7
liferay-multi-vm-clustered.xml
/home/admin/liferay-portal-6.1.1-ce-ga2/tomcat-7.0.27/webapps/ROOT/WEB-INF/classes/ehcache








LIFERAY PORTAL
2
liferay-portal-6.1.1-ce-ga2
Red Hat Enterprise Linux
10.66.70.185
1
context.xml
/home/admin/liferay-portal-6.1.1-ce-ga2/tomcat-7.0.27/conf



Server release 6.2 (Santiago)

2
server.xml
/home/admin/liferay-portal-6.1.1-ce-ga2/tomcat-7.0.27/conf





3
web.xml
/home/admin/liferay-portal-6.1.1-ce-ga2/tomcat-7.0.27/conf





4
setenv.sh
/home/admin/liferay-portal-6.1.1-ce-ga2/tomcat-7.0.27/bin





5
portal-ext.properties
/home/admin/liferay-portal-6.1.1-ce-ga2





6
hibernate-clustered.xml
/home/admin/liferay-portal-6.1.1-ce-ga2/tomcat-7.0.27/webapps/ROOT/WEB-INF/classes/ehcache





7
liferay-multi-vm-clustered.xml
/home/admin/liferay-portal-6.1.1-ce-ga2/tomcat-7.0.27/webapps/ROOT/WEB-INF/classes/ehcache








DATABASE
1
postgresql-9.2.6-1-linux-x64
Red Hat Enterprise Linux
10.66.70.183
1
pg_hba.conf
/opt/PostgreSQL/9.2/data



Server release 6.2 (Santiago)






LINUX COMMANDS USED


S.No
Command
Description
Output




1
httpd –v
To find apache version
Server version: Apache/2.2.15 (Unix)
Server built:   Oct  6 2011 11:06:33
2
(strings /PATH/TO/APACHE/modules/mod_jk.so |grep -i mod_jk)
 strings /usr/lib64/httpd/modules/mod_jk.so |grep -i mod_jk
To find mod_jk version
mod_jk.so
mod_jk.c
mod_jk/1.2.31 (1026297)
logs/mod_jk.log
3
cat /etc/*-release
To find Linux Version
Red Hat Enterprise Linux Server release 6.2 (Santiago)
4
./pg_ctl -D /opt/PostgreSQL/9.2/data stop -m immediate
To immediately stop Postgres from /opt/PostgreSQL/9.2/bin

5
 ./pg_ctl -D /opt/PostgreSQL/9.2/data start
To start Postgres from /opt/PostgreSQL/9.2/bin

6
 ./pg_ctl -D /opt/PostgreSQL/9.2/data stop
To stop Postgres from /opt/PostgreSQL/9.2/bin

7
./pg_ctl -D /opt/PostgreSQL/9.2/data status
To check status from /opt/PostgreSQL/9.2/bin
server is running (PID: 50933)
8
/etc/init.d/httpd status
To check status from apache httpd service
httpd (pid  3062) is running…
9
/etc/init.d/httpd start
To start apache httpd service

10
/etc/init.d/httpd stop
To stop apache httpd service

11
./startup.sh
To start Liferay tomcat from /home/admin/liferay-portal-6.1.1-ce-ga2/tomcat-7.0.27/bin/

12
./shutdown.sh
To stop Liferay tomcat from /home/admin/liferay-portal-6.1.1-ce-ga2/tomcat-7.0.27/bin/

13
 showmount -e 10.66.70.185


14
 mount -t nfs 10.66.70.185:/home/admin/documents_library /home/admin/documents_library


15
service iptables status
To check status of firewall service

16
service iptables start
To start firewall service

17
service iptables stop
To stop firewall service

18
service rpcbind status
To check status of  rpcbind service

19
service rpcbind start
To start rpcbind service

20
service rpcbind stop
To stop rpcbind service

21
service nfs status
To check status of  nfs service

22
service nfs start
To start nfs service

23
service nfs stop
To stop nfs service

24
ps -ef | grep tomcat


25
netstat -nap | grep 111
To find which service is running on port 111

26
rpm -ivh portmap-4.0-65.2.2.1.x86_64.rpm
To install and rpm

27
chmod -R 777 <file/folder name>
To give read/write/access permission to folder/file

28
yum remove java
To uninstall java completey