linux配置笔记

Tomcat

catalina.sh

JAVA_OPTS='-Xms64m -Xmx512m -XX:PermSize=128m -XX:MaxPermSize=512m'

server:

 <Connector port="11007" protocol="org.apache.coyote.http11.Http11AprProtocol"

               connectionTimeout="20000"

               redirectPort="8443"  maxThreads="500"

                          minSpareThreads="20"

                                     acceptCount="100"

                                                disableUploadTimeout="true"

                                                           enableLookups="false"

                                                                      URIEncoding="UTF-8" />

    <!-- A "Connector" using the shared thread pool-->

    <!--

    <Connector executor="tomcatThreadPool"

               port="11007" protocol="org.apache.coyote.http11.Http11AprProtocol"

               connectionTimeout="20000"

               redirectPort="8443" />

<Context path="" docBase="/usr/website/myswservice" reloadable="false" />

<Context path="/myswing" docBase="/usr/website/myswing" reloadable="false" />

 

session管理

tomcat6 用memcached-session-manager-tc6-1.6.5.jar

tomcat7 用memcached-session-manager-tc7-1.6.5.jar

 

在context.xml<host></host>中添加

 

<Manager className="de.javakaffee.web.msm.MemcachedBackupSessionManager" 

memcachedNodes="n1:192.168.189.128:11211" 

requestUriIgnorePattern=".*\.(png|gif|jpg|css|js){1}quot;" 

sticky="false" 

sessionBackupAsync="false" 

lockingMode="auto" 

sessionBackupTimeout="1800000" 

copyCollectionsForSerialization="false" 

transcoderFactoryClass="de.javakaffee.web.msm.serializer.javolution.JavolutionTranscoderFactory"/>

 

 ----------------------------------------------------------------------------------------------------------------

/etc/profile

export JAVA_HOME=/usr/jdk1.7.0_76

 

export JAVA_BIN=/usr/jdk1.7.0_76/bin

 

export PATH=$PATH:$JAVA_HOME/bin

 

export CLASSPATH=.:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar

 

export JAVA_HOME JAVA_BIN PATH CLASSPATH

 

export NGINX_HOME=/usr/local/nginx

 

export PATH=$PATH:$NGINX_HOME/sbin

 

export NGINX_HOME PATH

 

export PATH=$PATH:/usr/local/erlang/bin

 

export PATH=$PATH:/usr/local/apr/lib

 

export PATH=$PATH:/usr/include/freetype2

 

#export LD_LIBRARY_PATH=/usr/local/apr/lib

-------------------------------------------------------------------------------------------------------------------------

Nginx

upstream myswing {

    server 192.168.2.23:11001  weight=1;

    server 192.168.2.23:11002  weight=1;

    server 192.168.2.23:11003  weight=1;

    server 192.168.2.23:11004  weight=1;

    server 192.168.2.23:11005  weight=1;

    server 192.168.2.23:11006  weight=1;

    server 192.168.2.23:11007  weight=1;

    }

    server {

        listen       80;

        server_name  127.0.0.1;

 

        #charset koi8-r;

 

        #access_log  logs/host.access.log  main;

 

        location ~ .*$  {

               proxy_set_header Host $host;

               proxy_pass     http://myswing;

               proxy_set_header   X-Real-IP $remote_addr;

                proxy_set_header REMOTE-HOST $remote_addr;

      proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;

         }

 

   location / {

               proxy_set_header Host $host;

               proxy_pass     http://myswing;

               proxy_set_header   X-Real-IP $remote_addr;

                proxy_set_header REMOTE-HOST $remote_addr;

                proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;

         }

 

你可能感兴趣的:(笔记)