安装
rpm (离线)
直接进nginx下载包页面
选择你要的版本连接
wget https://nginx.org/packages/centos/7/x86_64/RPMS/nginx-1.20.2-1.el7.ngx.x86_64.rpm
rpm -ivh nginx-1.20.2-1.el7.ngx.x86_64.rpm
systemctl start nginx
systemctl status nginx
nginx -V
yum (rhel/centos)
yum -y install nginx
apt (debian/ubuntu)
apt update
apt install nginx
反向代理
先安装Tomcat测试tomcat下载页面
JDKjdk下载页面
wget https://dlcdn.apache.org/tomcat/tomcat-9/v9.0.74/bin/apache-tomcat-9.0.74.tar.gz
tar -zxvf apache-tomcat-9.0.74.tar.gz
mkdir /usr/tomcat
mv apache-tomcat-9.0.74 /usr/tomcat
cd /usr/tomcat/apache-tomcat-9.0.74/bin
./startup.sh
ss -ntl #查看tomcat端口,默认8080
修改配置文件
添加反向代理server块
#vim /etc/nginx/nginx.conf
server{
listen 81;
location / {
proxy_pass http://127.0.0.1:8080;
}
}
输入你的nginx主页面地址加上:81 就能出现tomcat页面
标签:tomcat,备忘录,nginx,74,apache,rpm,页面 From: https://www.cnblogs.com/mugetsukun/p/17367662.html