Thursday, June 18, 2015

How to run tomcat as service

Make sure there is a valid user "tomcat" and that this user has rw permissions in the $CATALINA_HOME/conf and $CATALINA_HOME/logs directories. Also make sure that $JAVA_HOME is set. You will start Tomcat as user "tomcat" to avoid running it as root.

Save the following scripts as /etc/init.d/tomcat.They will automatically be read and run at boot time. Check the log files if it does not start properly.


Do like below for rc3.d rc5.d rc4.d
Make a link to it from /etc/rc5.d such as:
cd /etc/rc5.d
sudo ln -s ../init.d/tomcat S71tomcat


Script for init.d

#!/bin/bash
#
# tomcat        where is tomcat mention is script that need to replace with user
#
# chkconfig: 345 20 80
# description:     Start up the Tomcat servlet engine.

# Source function library.
. /etc/init.d/functions


RETVAL=$?
CATALINA_HOME="/tomcat-apache path/apache-tomcat-7.0.62"

case "$1" in
 start)
        if [ -f $CATALINA_HOME/bin/startup.sh ];
          then
        echo $"Starting Tomcat"
            /bin/su tomcat $CATALINA_HOME/bin/startup.sh
        fi
    ;;
 stop)
        if [ -f $CATALINA_HOME/bin/shutdown.sh ];
          then
        echo $"Stopping Tomcat"
            /bin/su tomcat $CATALINA_HOME/bin/shutdown.sh
        fi
     ;;
 *)
     echo $"Usage: $0 {start|stop}"
    exit 1
    ;;
esac

exit $RETVAL

For boot time active : chkconfig --level 345 tomcat on

To Find from which user service running
ps aux | egrep 'process name' typically will show from which user is service running as.
Tuesday, June 16, 2015

How to check forgot password of plesk & login mysql too

For login plesk mysql without password : mysql -uadmin -p`cat /etc/psa/.psa.shadow`

For Check plesk admin panel password :  /usr/local/psa/bin/admin --show-password

OVF file not able to deploy

Failed to deploy OVF package: The task was canceled by a user

 

There will be three files you have to delete .mf file and edit .ova file and change contain like below
  • .ova – OVF descriptor, written in XML, which describes the hardware requirements
  • .mf – contains SHA1 checksums of the .OVA and .VMDK
  • .vmdk – the virtual hard disk for the virtual machine.
vmware.cdrom.iso
Changing the above line, to read…
vmware.cdrom.atapi
Then import it will work.
Before import right click on virtual system and edit setting and modify and choose Host CD ROME.
Then export vm and then deploy it will work.