영문윈도우와 한글윈도우 화면 깨짐 현상

http://blog.naver.com/boatrain/20094241346


화면 깜빡임처리 - 더블 버퍼링

http://cowvoice.tistory.com/8


DataGridView의 다양한 활용

http://blissfuljoon.tistory.com/45


C# SocketAsyncEventArgs High Performance Socket Code

http://www.codeproject.com/Articles/83102/C-SocketAsyncEventArgs-High-Performance-Socket-Cod


Json for C# 

http://blog.naver.com/elastica/50090991637


Thread에서 Progressbar 값을 변경하기

http://kimstar.pe.kr/blog/236


C#에서 define 사용하기

http://superzun.tistory.com/263


외부 응용프로그램 실행하기

http://www.cyworld.com/nowy/192742


TcpConnectionInformation Class

http://msdn.microsoft.com/en-us/library/system.net.networkinformation.tcpconnectioninformation(v=vs.90).aspx


Implementing a Sortable BindingList Very, Very Quickly

http://www.codeproject.com/Articles/31418/Implementing-a-Sortable-BindingList-Very-Very-Quic


.NET Remoting with an easy example

http://www.codeproject.com/Articles/14791/NET-Remoting-with-an-easy-example


방법: 시스템 시간 가져오기 또는 설정

http://msdn.microsoft.com/ko-kr/library/ms172517(v=vs.90).aspx


Smart Thread Pool

http://www.codeproject.com/Articles/7933/Smart-Thread-Pool


방법: 스레드로부터 안전한 방식으로 Windows Forms 컨트롤 호출

http://msdn.microsoft.com/ko-kr/library/ms171728(v=vs.90).aspx


NBug - Automated bug, error, and exception reports, crash minidumps.. for .NET

http://www.nbusy.com/projects/nbug


Debugging Windows Services under Visual Studio .NET

http://www.codeproject.com/Articles/10153/Debugging-Windows-Services-under-Visual-Studio-NET


How To Manage Windows Service Application on our Local Computer

http://www.codeproject.com/Articles/38746/How-To-Manage-Windows-Service-Application-on-our-L


.NET Interprocess Communication Revisited

http://www.codeproject.com/Articles/47341/NET-Interprocess-Communication-Revisited


 NTP 서버에서 시간 가져오기

http://www.devpia.com/MAEUL/Contents/Detail.aspx?BoardID=18&MAEULNO=8&no=1770&page=10

'개발 > 링크모음' 카테고리의 다른 글

C# 관련 찾아본 링크  (0) 2014.05.07
Posted by lovepoet

GeoIP filtering on Ubuntu 12.04 LTS

 

Though Ubuntu Linux offers packages for GeoIP filtering, some manual steps are still required for realization.

 

Install the Kernel module + userspace programs

sudo aptitude install xtables-addons-common

Create the directory for the GeoIP list

sudo mkdir /usr/share/xt_geoip

Install the Perl module (optional)

sudo aptitude install libtext-csv-xs-perl

Download GeoIP list

sudo /usr/lib/xtables-addons/xt_geoip_dl

This will download the list to the current directory, if you want to change this, do that before execution of this command!

Convert the GeoIP list

sudo /usr/lib/xtables-addons/xt_geoip_build -D /usr/share/xt_geoip *.csv

This will build the output files in /usr/share/xt_geoip and assumes the GeoIP list is located in the current directory. Please also note, that you have to specify "*.csv", otherwise nothing will happen.

Test everything

sudo iptables -F && iptables -A OUTPUT -m geoip --dst-cc US -j DROP

This will block all outgoing traffic to IP addresses located in the USA, next you can try to visit Google, this should not work anymore.

If you want your firewall changes to be undone, just enter sudo iptables -F.

References:

 

Robert Haddon's Blog, Words from High, (last visited on 2012-10-27)

xtables on sourceforge.net, (last visited on 2012-10-27)

'개발 > 자료조사' 카테고리의 다른 글

GeoIP filtering on Ubuntu 12.04 LTS  (0) 2014.05.07
VPN설정절차 (CentOS5.8: PPTPD+FreeRadius2+Mysql)  (0) 2014.05.07
Posted by lovepoet

root@localhost:/home# mkdir -p \/data/app/tomcat/tomcat01/bin \/data/app/tomcat/tomcat01/conf \/data/app/tomcat/tomcat01/logs \/data/app/tomcat/tomcat01/temp \/data/app/tomcat/tomcat01/webapps/ROOT

root@localhost:/home# mkdir -p \/data/app/tomcat/tomcat02/bin \/data/app/tomcat/tomcat02/conf \/data/app/tomcat/tomcat02/logs \/data/app/tomcat/tomcat02/temp \/data/app/tomcat/tomcat02/webapps/ROOT

root@localhost:/home# cp /usr/local/tomcat-7.0.30/conf/* /data/app/tomcat/tomcat01/conf

cp: `/usr/local/tomcat-7.0.30/conf/Catalina' ▒▒▒͸▒ ▒▒ ▒▒

root@localhost:/home# vi /data/app/tomcat/tomcat01/conf/server.xml

root@localhost:/home# cp /usr/local/tomcat-7.0.30/conf/* /data/app/tomcat/tomcat02/conf

cp: `/usr/local/tomcat-7.0.30/conf/Catalina' ▒▒▒͸▒ ▒▒ ▒▒

root@localhost:/home# vi /data/app/tomcat/tomcat02/conf/server.xml

root@localhost:/home# touch /data/app/tomcat/tomcat01/bin/tomcat.sh

root@localhost:/home# vi /data/app/tomcat/tomcat01/bin/tomcat.sh

root@localhost:/home# touch /data/app/tomcat/tomcat02/bin/tomcat.sh

root@localhost:/home# vi /data/app/tomcat/tomcat02/bin/tomcat.sh

root@localhost:/home# chmod 755 /data/app/tomcat/tomcat01/bin/tomcat.sh

root@localhost:/home# chmod 755 /data/app/tomcat/tomcat02/bin/tomcat.sh

root@localhost:/home# chown -R daemon:daemon /data/app/tomcat/

root@localhost:/home# ln -s /data/app/tomcat/tomcat01/bin/tomcat.sh /etc/init.d/tomcat01

root@localhost:/home# ln -s /data/app/tomcat/tomcat02/bin/tomcat.sh /etc/init.d/tomcat02

root@localhost:/home# update-rc.d tomcat01 defaults

update-rc.d: warning: /etc/init.d/tomcat01 missing LSB information

update-rc.d: see <http://wiki.debian.org/LSBInitScripts>

 Adding system startup for /etc/init.d/tomcat01 ...

   /etc/rc0.d/K20tomcat01 -> ../init.d/tomcat01

   /etc/rc1.d/K20tomcat01 -> ../init.d/tomcat01

   /etc/rc6.d/K20tomcat01 -> ../init.d/tomcat01

   /etc/rc2.d/S20tomcat01 -> ../init.d/tomcat01

   /etc/rc3.d/S20tomcat01 -> ../init.d/tomcat01

   /etc/rc4.d/S20tomcat01 -> ../init.d/tomcat01

   /etc/rc5.d/S20tomcat01 -> ../init.d/tomcat01

root@localhost:/home# update-rc.d tomcat02 defaults

update-rc.d: warning: /etc/init.d/tomcat02 missing LSB information

update-rc.d: see <http://wiki.debian.org/LSBInitScripts>

 Adding system startup for /etc/init.d/tomcat02 ...

   /etc/rc0.d/K20tomcat02 -> ../init.d/tomcat02

   /etc/rc1.d/K20tomcat02 -> ../init.d/tomcat02

   /etc/rc6.d/K20tomcat02 -> ../init.d/tomcat02

   /etc/rc2.d/S20tomcat02 -> ../init.d/tomcat02

   /etc/rc3.d/S20tomcat02 -> ../init.d/tomcat02

   /etc/rc4.d/S20tomcat02 -> ../init.d/tomcat02

   /etc/rc5.d/S20tomcat02 -> ../init.d/tomcat02



<?xml version='1.0' encoding='utf-8'?>
<!-- server.xml -->
<!--
  Licensed to the Apache Software Foundation (ASF) under one or more
  contributor license agreements.  See the NOTICE file distributed with
  this work for additional information regarding copyright ownership.
  The ASF licenses this file to You under the Apache License, Version 2.0
  (the "License"); you may not use this file except in compliance with
  the License.  You may obtain a copy of the License at

      http://www.apache.org/licenses/LICENSE-2.0

  Unless required by applicable law or agreed to in writing, software
  distributed under the License is distributed on an "AS IS" BASIS,
  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  See the License for the specific language governing permissions and
  limitations under the License.
-->
<!-- Note:  A "Server" is not itself a "Container", so you may not
     define subcomponents such as "Valves" at this level.
     Documentation at /docs/config/server.html
 -->
<Server port="${tomcat.port.shutdown}" shutdown="SHUTDOWN">
  <!-- Security listener. Documentation at /docs/config/listeners.html
  <Listener className="org.apache.catalina.security.SecurityListener" />
  -->
  <!--APR library loader. Documentation at /docs/apr.html -->
  <Listener className="org.apache.catalina.core.AprLifecycleListener" SSLEngine="on" />
  <!--Initialize Jasper prior to webapps are loaded. Documentation at /docs/jasper-howto.html -->
  <Listener className="org.apache.catalina.core.JasperListener" />
  <!-- Prevent memory leaks due to use of particular java/javax APIs-->
  <Listener className="org.apache.catalina.core.JreMemoryLeakPreventionListener" />
  <Listener className="org.apache.catalina.mbeans.GlobalResourcesLifecycleListener" />
  <Listener className="org.apache.catalina.core.ThreadLocalLeakPreventionListener" />

  <!-- Global JNDI resources
       Documentation at /docs/jndi-resources-howto.html
  -->
  <GlobalNamingResources>
    <!-- Editable user database that can also be used by
         UserDatabaseRealm to authenticate users
    -->
    <Resource name="UserDatabase" auth="Container"
              type="org.apache.catalina.UserDatabase"
              description="User database that can be updated and saved"
              factory="org.apache.catalina.users.MemoryUserDatabaseFactory"
              pathname="conf/tomcat-users.xml" />
  </GlobalNamingResources>

  <!-- A "Service" is a collection of one or more "Connectors" that share
       a single "Container" Note:  A "Service" is not itself a "Container",
       so you may not define subcomponents such as "Valves" at this level.
       Documentation at /docs/config/service.html
   -->
  <Service name="Catalina">

    <!--The connectors can use a shared executor, you can define one or more named thread pools-->
    <!--
    <Executor name="tomcatThreadPool" namePrefix="catalina-exec-"
        maxThreads="150" minSpareThreads="4"/>
    -->

    <!-- 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 ${tomcat.port.http}
    -->
    <Connector port="${tomcat.port.http}" 
protocol="HTTP/1.1"
disableUploadTimeout="true"
redirectPort="${tomcat.port.https}"
URIEncoding="UTF-8" />
    <!-- A "Connector" using the shared thread pool-->
    <!--
    <Connector executor="tomcatThreadPool"
               port="${tomcat.port.http}" protocol="HTTP/1.1"
               connectionTimeout="20000"
               redirectPort="${tomcat.port.https}" />
    -->   
    <!-- Define a SSL HTTP/1.1 Connector on port ${tomcat.port.https}
         This connector uses the JSSE configuration, when using APR, the
         connector should be using the OpenSSL style configuration
         described in the APR documentation -->
    <!--
    <Connector port="${tomcat.port.https}" protocol="HTTP/1.1" SSLEnabled="true"
               maxThreads="150" scheme="https" secure="true"
               clientAuth="false" sslProtocol="TLS" />
    -->

    <!-- Define an AJP 1.3 Connector on port ${tomcat.port.ajp} -->
    <Connector port="${tomcat.port.ajp}" protocol="AJP/1.3" redirectPort="${tomcat.port.https}" URIEncoding="UTF-8" />

    <!-- An Engine represents the entry point (within Catalina) that processes
         every request.  The Engine implementation for Tomcat stand alone
         analyzes the HTTP headers included with the request, and passes them
         on to the appropriate Host (virtual host).
         Documentation at /docs/config/engine.html -->

    <!-- You should set jvmRoute to support load-balancing via AJP ie :
    <Engine name="Catalina" defaultHost="localhost" jvmRoute="jvm1">
    -->
    <Engine name="Catalina" defaultHost="localhost"  jvmRoute="tomcat01">

      <!--For clustering, please take a look at documentation at:
          /docs/cluster-howto.html  (simple how to)
          /docs/config/cluster.html (reference documentation) -->
      <!--
      <Cluster className="org.apache.catalina.ha.tcp.SimpleTcpCluster"/>
      -->

      <!-- Use the LockOutRealm to prevent attempts to guess user passwords
           via a brute-force attack -->
      <Realm className="org.apache.catalina.realm.LockOutRealm">
        <!-- This Realm uses the UserDatabase configured in the global JNDI
             resources under the key "UserDatabase".  Any edits
             that are performed against this UserDatabase are immediately
             available for use by the Realm.  -->
        <Realm className="org.apache.catalina.realm.UserDatabaseRealm"
               resourceName="UserDatabase"/>
      </Realm>

       <Host name="localhost"  appBase="${catalina.base}/webapps" workDir="${catalina.base}/work"
            unpackWARs="true" autoDeploy="true" >

        <!-- SingleSignOn valve, share authentication between web applications
             Documentation at: /docs/config/valve.html -->
        <!--
        <Valve className="org.apache.catalina.authenticator.SingleSignOn" />
        -->

        <!-- Access log processes all example.
             Documentation at: /docs/config/valve.html
             Note: The pattern used is equivalent to using pattern="common" -->
<!--
        <Valve className="org.apache.catalina.valves.AccessLogValve" directory="logs"
               prefix="localhost_access_log." suffix=".txt"
               pattern="%h %l %u %t &quot;%r&quot; %s %b" />
-->
<Context path="" docBase="/docBase" debug="0" reloadable="true">
<Valve className="org.apache.catalina.valves.AccessLogValve" directory="logs"
  prefix="localhost_access_log." suffix=".txt"
  pattern="%h %l %u %t &quot;%r&quot; %s %b" />
</Context>
      </Host>
    </Engine>
  </Service>

</Server>


#!/bin/bash

# tomcat.sh

# chkconfig: 2345 95 20

# description: tomcat01

# processname: tomcat01

 

SERVER_NAME=tomcat01

TOMCAT_USER=daemon

SHUTDOWN_WAIT=10

UNAME=`id -u -n`

 

export JAVA_OPTS="-server"

export JAVA_OPTS="$JAVA_OPTS -Xms256m"

export JAVA_OPTS="$JAVA_OPTS -Xmx256m"

export JAVA_OPTS="$JAVA_OPTS -XX:NewSize=128m"

export JAVA_OPTS="$JAVA_OPTS -XX:MaxNewSize=128m"

export JAVA_OPTS="$JAVA_OPTS -XX:PermSize=128m"

export JAVA_OPTS="$JAVA_OPTS -XX:MaxPermSize=128m"

export JAVA_OPTS="$JAVA_OPTS -XX:+DisableExplicitGC"

export JAVA_OPTS="$JAVA_OPTS -XX:+UseParallelGC"

export JAVA_OPTS="$JAVA_OPTS -XX:+UseParallelOldGC"

 

export JAVA_OPTS="$JAVA_OPTS -Dtomcat.port.shutdown=8505"

export JAVA_OPTS="$JAVA_OPTS -Dtomcat.port.http=8580"

export JAVA_OPTS="$JAVA_OPTS -Dtomcat.port.https=8943"

export JAVA_OPTS="$JAVA_OPTS -Dtomcat.port.ajp=8509"

 

export CATALINA_HOME=/usr/local/tomcat-7.0.30

export CATALINA_BASE=/app/tomcat/$SERVER_NAME

export CATALINA_OPTS="$CATALINA_OPTS -Djava.security.egd=file:/dev/./urandom"

 

tomcat_pid() {

    echo `ps aux | grep "$CATALINA_BASE[ ]" | grep -v grep | awk '{ print $2 }'`

}

 

start() {

    pid=$(tomcat_pid)

 

    if [ -n "$pid" ]

    then

        echo "Tomcat is already running (pid: $pid)"

    else

        echo "Starting tomcat (pid: $pid)"

 

        if [ e$UNAME = "eroot" ]

        then

            ulimit -n 100000

            umask 007

            /bin/su -p -s /bin/sh $TOMCAT_USER $CATALINA_HOME/bin/startup.sh

        else

            $CATALINA_HOME/bin/startup.sh

        fi

    fi

 

    return 0

}

 

stop() {

    pid=$(tomcat_pid)

 

    if [ -n "$pid" ]

    then

        echo "Stoping Tomcat"

 

        if [ e$UNAME = "eroot" ]

        then

            /bin/su -p -s /bin/sh $TOMCAT_USER $CATALINA_HOME/bin/shutdown.sh

        else

            $CATALINA_HOME/bin/shutdown.sh -force

        fi

 

        let kwait=$SHUTDOWN_WAIT

        count=0;

        until [ `ps -p $pid | grep -c $pid` = '0' ] || [ $count -gt $kwait ]

        do

            echo -n -e "\nwaiting for processes to exit (pid: $pid)\n";

            sleep 1

            let count=$count+1;

        done

 

        if [ $count -gt $kwait ]; then

            echo -n -e "\nkilling processes which didn't stop after $SHUTDOWN_WAIT seconds (pid: $pid)"

            kill -9 $pid

        fi

    else

        echo "Tomcat is not running"

    fi

 

    return 0

}

 

case $1 in

    start)

        start

        ;;

    stop)

        stop

        ;;

    restart)

        stop

        start

        ;;

    status)

        pid=$(tomcat_pid)

        if [ -n "$pid" ]

        then

            echo "Tomcat is running with pid: $pid"

        else

            echo "Tomcat is not running"

        fi

        ;;

    *)

        echo $"Usage : $0 {start|stop|restart}"

        exit 1

esac

exit 0



# apache httpd.conf 변경내용

#Mod_jk Setting

<IfModule mod_jk.c>

JkWorkersFile conf/workers.properties

JkLogFile logs/mod_jk.log

JkLogLevel error

JkLogStampFormat "[%a %b %d %H:%M:%S %Y] "

JkOptions +ForwardKeySize +ForwardURICompat -ForwardDirectories

JkRequestLogFormat "%w %V %T"

 

JkMount /* loadbalancer

JkMount /*.do loadbalancer

JkMount /*.jsp loadbalancer

JkMount /servlet/* loadbalancer

</IfModule>



# apache workers.properties 변경내용

worker.list=loadbalancer

 

worker.loadbalancer.type=lb

worker.loadbalancer.balance_workers=tomcat01, tomcat02

worker.loadbalancer.recover_time=20

worker.loadbalancer.retries=2

 

#Define a template worker

worker.template.type=ajp13

worker.tomcat01.host=localhost

#worker.template.distance=1

#worker.template.lbfactor=1

worker.template.socket_timeout=30

worker.template.socket_connect_timeout=30

worker.template.connect_timeout=30

worker.template.prepost_timeout=30

worker.template.fail_on_status=400,503

worker.template.connection_pool_timeout=30

 

#Define workers using ajp13

worker.tomcat01.reference=worker.template

worker.tomcat02.reference=worker.template

 

#Define workers detail

worker.tomcat01.port=8509

worker.tomcat02.port=8510



'개발 > 작업내용모음' 카테고리의 다른 글

우분투 톰캣 멀티인스턴스설정  (0) 2014.05.07
haproxy.cfg  (0) 2014.05.07
Mysql Cluster 7.3.2 Initial Configuration  (0) 2014.05.07
Mysql Cluster 7.3.2 Compile & installing  (0) 2014.05.07
Posted by lovepoet


티스토리 툴바