Chinaunix首页 | 论坛 | 博客
  • 博客访问: 8179
  • 博文数量: 1
  • 博客积分: 25
  • 博客等级: 民兵
  • 技术积分: 10
  • 用 户 组: 普通用户
  • 注册时间: 2011-12-25 11:05
文章分类
文章存档

2014年(1)

我的朋友
最近访客

分类: 系统运维

2014-03-30 11:21:29

原文地址:jdk+tomcat+memcached 支持jsp 作者:kefatong

jdk+tomcat+memcached 支持jsp
============================

iptables  selinux disabled

server1  config

jdk install
get jdk-6u26-linux-x64.bin

sh  jdk-6u26-linux-x64.bin
mv jdk-* /usr/local/jdk

vim /etc/profile
add
export JAVA_HOME=/usr/local/jdk
export CLASSPATH=:$JAVA_HOME/lib
export PATH=$PATH:$JAVA_HOME/bin


tomcat install   

get apache-tomcat-7.0.8.tar.gz

tar zxf apache-tomcat-7.0.8.tar.gz -C /usr/local
mv /usr/local/apache-tomcat /usr/local/tomcat
cd /usr/local/tomcat/bin
./startup.sh
netstat -tanlp |grep 8080

get
kryo-1.03.jar
kryo-serializers-0.8.jar
memcached-2.5.jar
memcached-session-manager-1.5.1.jar
memcached-session-manager-tc7-1.5.1.jar
minlog-1.2.jar
msm-kryo-serializer-1.5.1.jar
reflectasm-0.9.jar

mv * /usr/local/tomcat/lib

cd /usr/local/tomcat


vim conf/context.xml
add
memcachedNodes="n1:192.168.0.68:11211,n2:192.168.0.60:11211"
failoverNodes="n1"
requestUriIgnorePattern=".*\.(ico|png|gif|jpg|css|js)$"
transcoderFactoryClass="de.javakaffee.web.msm.serializer.kryo.KryoTranscoderFactory"
/>


memcached install
yum install memcached -y
vim /etc/sysconfig/memcached.conf

service memcached start

nginx install

yum install pcre-devel openssl-devel
get nginx-1.0.8.tar.gz nginx-sticky-module-1.0.tar.gz

tar zxf nginx-1.0.8.tar.gz
tar zxf nginx-sticky-module-1.0.tar.gz -C nginx-1.0.8

cd nginx-1.0.8/
vim auto/cc/gcc

find /debug
modify
# debug
# CFLAGS="$CFLAGS -g"


cd nginx-1.0.8/
vim src/core/nginx.h
modify
#define NGINX_VERSION      "1.0.8"
#define NGINX_VER          "nginx"


cd nginx-1.0.8/

./configure --add-module=nginx-sticky-module-1.0/ --user=nginx --group=nginx  --with-http_ssl_module --with-http_sub_module
make && make install

cd /usr/local/nginx/
vim conf/nginx.conf

user  nginx nginx;
worker_processes  8;

#error_log  logs/error.log;
#error_log  logs/error.log  notice;
#error_log  logs/error.log  info;

#pid        logs/nginx.pid;


events {
    worker_connections  1024;
     use epoll;
}


http {
    upstream {
        sticky;
        server 192.168.0.60:8080;
        server 192.168.0.68:8080;
}
    include       mime.types;
    default_type  application/octet-stream;

    #log_format  main  '$remote_addr - $remote_user [$time_local] "$request" '
    #                  '$status $body_bytes_sent "$http_referer" '
    #                  '"$http_user_agent" "$http_x_forwarded_for"';

    #access_log  logs/access.log  main;

    sendfile        on;
    #tcp_nopush     on;

    #keepalive_timeout  0;
    keepalive_timeout  65;

    #gzip  on;

    server {
        listen       80;
        server_name  www,example.com;

        #charset koi8-r;

        #access_log  logs/host.access.log  main;

        location / {
            root   html;
            index  index.html index.htm;
        }

        #error_page  404              /404.html;

        # redirect server error pages to the static page /50x.html
        #
        error_page   500 502 503 504  /50x.html;
        location = /50x.html {
            root   html;
        }

        # proxy the PHP scripts to Apache listening on 127.0.0.1:80
        #
        location ~ \.jsp$ {
            proxy_pass   http://;
}



server2 config

yum install memcached -y
service memcached start
jdk install
tomcat install

cd /usr/local/tomcat
vim conf/context.xml

add
memcachedNodes="n1:192.168.0.68:11211,n2:192.168.0.60:11211"
failoverNodes="n2"
requestUriIgnorePattern=".*\.(ico|png|gif|jpg|css|js)$"
transcoderFactoryClass="de.javakaffee.web.msm.serializer.kryo.KryoTranscoderFactory"
/>


ok



阅读(1229) | 评论(0) | 转发(0) |
0

上一篇:没有了

下一篇:没有了

给主人留下些什么吧!~~