This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.mycomp; | |
import ognl.OgnlRuntime; | |
import javax.servlet.ServletContextEvent; | |
import javax.servlet.ServletContextListener; | |
import java.util.logging.Logger; | |
/** |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Copyright (c) 2000-2012 Liferay, Inc. All rights reserved. | |
* | |
* This library is free software; you can redistribute it and/or modify it under | |
* the terms of the GNU Lesser General Public License as published by the Free | |
* Software Foundation; either version 2.1 of the License, or (at your option) | |
* any later version. | |
* | |
* This library is distributed in the hope that it will be useful, but WITHOUT | |
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /bin/sh | |
# ================================================================== | |
#https://gist.github.com/terrancesnyder/986029 | |
# Multi-instance Apache Tomcat installation with a focus | |
# on best-practices as defined by Apache, SpringSource, and MuleSoft | |
# and enterprise use with large-scale deployments. | |
# Credits: | |
# Google -> Couldn't survive without it | |
# Stackoverflow.com -> Community support |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
### BEGIN INIT INFO | |
# Provides: tomcat | |
# Required-Start: $remote_fs $syslog | |
# Required-Stop: $remote_fs $syslog | |
# Default-Start: 2 3 4 5 | |
# Default-Stop: 0 1 6 | |
# Short-Description: Start and stop Apache Tomcat | |
# Description: Enable Apache Tomcat service provided by daemon. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export CATALINA_OPTS="$CATALINA_OPTS -Dfile.encoding=UTF8 -Djava.net.preferIPv4Stack=true -Dorg.apache.catalina.loader.WebappClassLoader.ENABLE_CLEAR_REFERENCES=false" | |
export CATALINA_PID=$CATALINA_HOME/bin/tomcat.pid | |
export JAVA_OPTS="$JAVA_OPTS -Xms128m -Xmx1024m -XX:PermSize=64m -XX:MaxPermSize=256m" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
TOMCAT_HOME="/opt/yosport/yosport_app/tomcat8" | |
TOMCAT_USER=root | |
#all app name that start with yo prefix | |
app_name="yo*" | |
# stop tomcat if it is running | |
TOMCAT_PID=`ps -ef | grep "$TOMCAT_HOME/" | grep 'Bootstrap start$' | awk '{print $2}'` | |
if [ ! -z $TOMCAT_PID ] ; then | |
echo "Tomcat still be running with PID $TOMCAT_PID." |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Autowire Quartz Jobs with Spring context dependencies | |
* @see http://stackoverflow.com/questions/6990767/inject-bean-reference-into-a-quartz-job-in-spring/15211030#15211030 | |
*/ | |
public final class AutowiringSpringBeanJobFactory extends SpringBeanJobFactory implements ApplicationContextAware { | |
private transient AutowireCapableBeanFactory beanFactory; | |
public void setApplicationContext(final ApplicationContext context) { | |
beanFactory = context.getAutowireCapableBeanFactory(); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* remove cache items | |
* eg : $this->clearCache(array('clips')); | |
*/ | |
public function clearCache(array $keyList) { | |
$redis = Cache::getRedis(); | |
$cursor = 0; | |
while($data = $redis->scan($cursor)) | |
{ | |
$cursor = $data[0]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* remove cache items | |
* eg : $this->clearCache(array('clips')); | |
* link : http://stackoverflow.com/questions/14873506/deleting-from-laravel-cache-using-pattern-for-key\ | |
oki voi redis 3.0 (die voi 3.0.3) | |
*/ | |
/* | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<Host name="localhost" appBase="webapps" unpackWARs="true" autoDeploy="true"> | |
<!-- | |
SingleSignOn valve, share authentication between web applications | |
Documentation at: /docs/config/valve.html | |
--> | |
<!-- | |
<Valve className="org.apache.catalina.authenticator.SingleSignOn" /> | |
--> |
OlderNewer