标签:配置 mod 服务器 代理 应用 href pen makefile x64
CentOS7 下载地址 :https://mirrors.tuna.tsinghua.edu.cn/centos/7.7.1908/isos/x86_64/CentOS-7-x86_64-DVD-1908.iso
mkdir /usr/local/jdk1.8/
,并将上传额jdk复制到此处,并解压set java environment
JAVA_HOME=/usr/local/jdk1.8/jdk1.8.0_221
CLASSPATH=.:$JAVA_HOME/lib.tools.jar
PATH=$JAVA_HOME/bin:$PATH
export JAVA_HOME CLASSPATH PATH
source /etc/profile
,使更改的配置立即生效安装Tomcat
上传,解压 即可。
若浏览器中无法访问。原因:Centos7的防火墙拦截了tomcat访问的8080端口
firewall-cmd --permanent --zone=public --add-port=8080/tcp
firewall-cmd --reload
firewall-cmd --zone=public --query-port=8080/tcp
执行以上三行命令,重启tomcat即可
#需要安装 gcc 的环境
yum install gcc-c++
yum install -y pcre pcre-devel
yum install -y zlib zlib-devel
yum install -y openssl openssl-devel
#命令行直接执行
./configure --prefix=/usr/local/nginx --pid-path=/var/run/nginx/nginx.pid --lock-path=/var/lock/nginx.lock --error-log-path=/var/log/nginx/error.log --http-log-path=/var/log/nginx/access.log --with-http_gzip_static_module --http-client-body-temp-path=/var/temp/nginx/client --http-proxy-temp-path=/var/temp/nginx/proxy --http-fastcgi-temp-path=/var/temp/nginx/fastcgi --http-uwsgi-temp-path=/var/temp/nginx/uwsgi --http-scgi-temp-path=/var/temp/nginx/scgi
执行完后可以Makefile文件
make
#安装
make install
#创建临时文件夹
mkdir /var/temp/nginx/client -p
Nginx启动与访问
启动:进入 cd /usr/local/ngiux/sbin 目录 执行 ./nginx
即可启动。
关闭:./nginx -s stop
刷新配置文件:./nginx -s reload
#普通服务配置
server {
listen 8081;
server_name localhost;
location / {
root html; #default page
index index.html index.htm;
}
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root html;
}
}
Nginx反向代理
#配置反向代理
upstream tomcat-wjd{
server 192.168.244.128:8080;
}
server {
listen 80;
server_name localhost;
location / {
# root wjd;
proxy_pass http://tomcat-wjd;
index index.html index.htm;
}
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root html;
}
}
Nginx负载均衡
#weight 权重
upstream tomcat-wjd{
server 192.168.244.128:8080 weight=2;
server 192.168.244.128:8081;
server 192.168.244.128:8082;
}
server {
listen 80;
server_name localhost;
location / {
# root wjd;
proxy_pass http://tomcat-wjd;
index index.html index.htm;
}
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root html;
}
}
有序列表项 三
标签:配置 mod 服务器 代理 应用 href pen makefile x64
原文地址:https://www.cnblogs.com/xpz-python/p/11670985.html