集群环境
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