Centos6.5 Nginx +Tomcat 集群搭建
来源:互联网 发布:免费笑话api数据接口 编辑:程序博客网 时间:2024/05/21 14:48
系统资源:
nginx 一台
Tomcat +JDK 两台
第一步:CentOs 6.5 安装Nginx 详细步骤:请参考centos 6.5 搭建nginx
第二步:CentOs6.5 安装Tomcat +JDK 详细步骤:请参考CentOs 6.5 搭建Tomcat + CentOs6.5 搭建JDK
第三步:修改Nginx的配置文件,我的nginx 配置文件位置(cd /usr/local/webserver/nginx/nginx.conf)
#user nobody;worker_processes 1;#error_log logs/error.log;#error_log logs/error.log notice;#error_log logs/error.log info;#pid logs/nginx.pid;events { use epoll; worker_connections 1024;}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 65; upstream servers{server 120.25.56.93:8080;server 120.25.58.50:8080; } #gzip on; server { listen 8084; server_name 120.76.112.207; #charset koi8-r; #access_log logs/host.access.log main; location / { proxy_pass http://servers; proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; } #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 ssl; # server_name localhost; # ssl_certificate cert.pem; # ssl_certificate_key cert.key; # ssl_session_cache shared:SSL:1m; # ssl_session_timeout 5m; # ssl_ciphers HIGH:!aNULL:!MD5; # ssl_prefer_server_ciphers on; # location / { # root html; # index index.html index.htm; # } #}}第四步:重新启动ngixn
[root@iZ94phz01rnZ sbin]# ./nginx -s reload[root@iZ94phz01rnZ sbin]# ./nginx -s reopen
第五步:相关效果截图:
0 0
- Centos6.5 Nginx +Tomcat 集群搭建
- Nginx+Tomcat集群搭建
- nginx搭建tomcat集群
- Nginx+Tomcat搭建集群
- Nginx+Tomcat集群搭建
- CentOS6.5下Tomcat搭建Solr5.4.0集群
- Nginx+tomcat集群环境搭建
- Nginx+tomcat集群环境搭建
- Nginx + Tomcat + Memcached 集群搭建
- tomcat+redis+nginx集群搭建
- nginx搭建tomcat分布式集群
- nginx搭建tomcat分布式集群
- Nginx搭建Tomcat集群【入门】
- centos6.5搭建Nginx(Web Server)+Tomcat+MySql
- CentOS6.5搭建Hadoop集群
- centos6.5 nginx+tomcat部署
- nginx+tomcat+memcached 集群环境搭建
- tomcat6+nginx+redis搭建tomcat集群环境
- android 爬坑之路
- GOLD SDK兼容第三方采集器补丁
- iOS学习- 12 绑定数组数据到Table View - Todo App
- java jdk 基础类
- C语言学习篇-8地址与指针
- Centos6.5 Nginx +Tomcat 集群搭建
- JavaScript--DOM编程核心
- 1034. 有理数四则运算(20)
- 借机系统项目记录
- 购物车项目(二)——编写购物车类
- 网络笔记
- android开发笔记之网络编程—简易新闻客户端
- 【Linux】中断机制和异常机制
- 听说Swift很NB,那么来勉强学点(3.1)--集合类型数组