设为首页 加入收藏

TOP

nginx+memcached+tomcat集群session共享完整版(一)
2015-11-21 02:05:02 来源: 作者: 【 】 浏览:4
Tags:nginx memcached tomcat 集群 session 共享 整版

集群环境

1.nginx版本 nginx-1.6.2.tar.gz

2.jdk 版本 jdk-7u21-linux-x64.tar.gz

3.tomcat 版本 7.0.29

4.memcached 版本 memcached-1.4.22.tar.gz

5. CentOS 6.5 系统采用一台服务做测试

?

一、nginx安装

安装依赖包 yum -y install gcc gcc-c++

1.安装pcre库

tar zxvf pcre-8.36.tar.gz

cd pcre-8.36

./configure

make && make install

2.安装zlib库

tar zxvf zlib-1.2.8.tar.gz

cd zlib-1.2.8

./configure

make && make install

3.安装openssl

wget http://www.openssl.org/source/openssl-1.0.1c.tar.gz

tar zxvf openssl-1.0.1c.tar.gz

4.安装nginx 注意指定prce zlib openssl原码包位置

tar zxvf nginx-1.6.2.tar.gz

?

cd nginx-1.6.2

?

./configure --prefix=/usr/local/nginx \

--with-http_ssl_module \

--with-pcre=/root/pcre-8.36 \

--with-zlib=/root/zlib-1.2.8 \

--with-openssl=/root/openssl-1.0.1c

?

make && make install

5.安装成功后配置

vi /usr/local/nginx/conf/nginx.conf 修改配置文件

?

#user nobody;

worker_processes 2;

?

#error_log logs/error.log;

#error_log logs/error.log notice;

#error_log logs/error.log info;

?

#pid logs/nginx.pid;

?

worker_rlimit_nofile 65535;

events {

use epoll;

worker_connections 65535;

}

?

?

http {

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 150;

fastcgi_connect_timeout 300;

fastcgi_send_timeout 300;

fastcgi_read_timeout 300;

#gzip on;

?

gzip on;

?

?

##cache##

client_max_body_size 10m;

client_body_buffer_size 1m;

proxy_connect_timeout 5;

proxy_read_timeout 60;

proxy_send_timeout 5;

proxy_buffer_size 64k;

proxy_buffers 4 128k;

proxy_busy_buffers_size 128k;

proxy_temp_file_write_size 1m;

proxy_temp_path /home/temp_dir;

proxy_cache_path /home/cache levels=1:2 keys_zone=cache_one:200m inactive=1d max_size=30g;

##end##

?

?

?

?

#server {

# listen 80;

# server_name localhost;

?

#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 ~ \.php$ {

# proxy_pass http://127.0.0.1;

#}

?

# pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000

#

#location ~ \.php$ {

# root html;

# fastcgi_pass 127.0.0.1:9000;

# fastcgi_index index.php;

# fastcgi_param SCRIPT_FILENAME /scripts$fastcgi_script_name;

# include fastcgi_params;

#}

?

# deny access to .htaccess files, if Apache's document root

# concurs with nginx's one

#

#location ~ /\.ht {

# deny all;

#}

#}

?

?

# another virtual host using mix of IP-, name-, and port-based configuration

#

#server {

# listen 8000;

# listen somename:8080;

# server_name somename alias another.alias;

?

# location / {

# root html;

# index index.html index.htm;

# }

#}

?

?

# HTTPS server

#

#server {

# listen 443;

# server_name localhost;

?

# ssl on;

# ssl_certificate cert.pem;

# ssl_certificate_key cert.key;

?

# ssl_session_timeout 5m;

?

# ssl_protocols SSLv2 SSLv3 TLSv1;

# ssl_ciphers HIGH:!aNULL:!MD5;

# ssl_prefer_server_ciphers on;

?

# location / {

# root html;

# ind

首页 上一页 1 2 3 下一页 尾页 1/3/3
】【打印繁体】【投稿】【收藏】 【推荐】【举报】【评论】 【关闭】 【返回顶部
分享到: 
上一篇全外连接和交叉连接 下一篇PDM与Excel利用VB脚本进行互导

评论

帐  号: 密码: (新用户注册)
验 证 码:
表  情:
内  容: