Selasa, 26 Juni 2018

How to start TomcatStack apache tomcat mysql from command line

  Tidak ada komentar
Some time as sys admin we face a some request from developer to deploy or maintenance the tomcat webserver, we have to restart and trouble shoot the webserver here are some experience that i did when i was got the case.
Step 1: Check status service
Enter the tomcat stack directory as following figure
[[email protected] tomcatstack-7.0.86-0]# ls
apache2        bnsupport       config        licenses               properties.ini  uninstall
apache-ant     bnsupport-tool  README.txt      uninstall.dat
apache-tomcat  changelog.txt   img           mysql                  scripts         use_tomcatstack
apps           common          java          php                    sqlite
[[email protected] tomcatstack-7.0.86-0_dua]#
Make sure the ctrl script path was right
[[email protected] tomcatstack-7.0.86-0]$ cat

# Allow only root execution
if [ `id|sed -e s/uid=//g -e s/\(.*//g` -ne 0 ]; then
    echo "This script requires root privileges"
    exit 1

# Disabling SELinux if enabled
if [ -f "/usr/sbin/getenforce" ] && [ `id -u` = 0 ] ; then
    /usr/sbin/setenforce 0 2> /dev/null


if [ -r "$INSTALLDIR/scripts/" ]; then
. "$INSTALLDIR/scripts/"
Execute following command
sudo ./ status
It will response
apache not running
tomcat not running
mysql not running

Step 2: Start the service
Execute the following command if you down know the command to do it
[[email protected] tomcatstack-7.0.86-0]# ./ help
usage: ./ help
       ./ (start|stop|restart|status)
       ./ (start|stop|restart|status) mysql
       ./ (start|stop|restart|status) apache
       ./ (start|stop|restart|status) tomcat

help       - this screen
start      - start the service(s)
stop       - stop  the service(s)
restart    - restart or start the service(s)
status     - show the status of the service(s)
You can start all services by running following command
[[email protected] tomcatstack-7.0.86-0]# ./ start
Or you can start a service (example tomcat ) by running following command
[[email protected] tomcatstack-7.0.86-0]# ./ start tomcat

Tidak ada komentar :

Posting Komentar