Nginx 反向代理
Tomcat
发布java项目
Jdk java环境
安装注意事项centos6需要单独安装jdk
查看jdk版本
java -version

修改安装位置
![]()
创建网站根目录

![]()
Tomcat主配置文件
![]()
<Context docBase="/var/www/" path="" reloadable="fales" >
</Context>
![]()
启动服务

监听8080
![]()
关闭tomcat服务

访问日志
tail -f /usr/local/tomcat/logs/localhost_access_log


Tomcat默认web根目录
![]()
配置第二台
![]()
创建根目木修改配置文件

启动测试


Nginx
安装依赖
yum -y install pcre-devel zlib-devel openssl-devel
![]()
创建nginx管理账户

添加一块网卡

![]()

![]()

配置
./configure --prefix=/usr/local/nginx --user=nginx --group=nginx -
-with-file-aio--with-http_stub_status_module--with-http_gzip_static_module --with-http_flv_module --with-http_ssl_module

优化nginx命令
![]()
修改配置文件
![]()


upstream tomcat_server {
server 192.168.100.10:8080 weight=1;
server 192.168.100.20:8080 weight=1;
}
server {
listen 192.168.200.10:80;
server_name www.benet.com;
charset utf-8;
access_log logs/host.access.log;
location / {
root html;
proxy_pass http://tomcat_server;
index index.html index.htm;
}

开启nginx的路由功能
![]()

配置网关
GATEWAY=192.168.100.30

安装dns
![]()
修改配置vim /etc/named.conf

options {
listen-on port 53 { any; };
directory "/var/named";
};
zone "benet.com" {
type master;
file "benet.com.zone";
};
zone "accp.com" {
type master;
file "accp.com.zone";
};
![]()
$TTL 86400
@ SOA benet.com. root.benet.com. (
2010051101
1H
15M
1W
1D
)
@ NS centos03.benet.com.
centos03 A 192.168.200.10
www A 192.168.200.10
客户机测试


查看日志




1922

被折叠的 条评论
为什么被折叠?



