使用nginx+tomcate做二级域名

Nginx 配置二级域名(腾讯云) 根域名已被个人主站占用,想把做过的项目部署到二级域名,特此记录。 一、环境说明 系统: CentOS7.6 应用服务器:Nginx 1.16.1、Tomcat 9.0 安全组已开放端口: 22、80、443、3389 二、解析二级域名并申请 SSL 证书(腾讯云) 1、登录腾讯云,点击控制台下方的个人中心头像。 2、点击云产品,搜索域名注册,点击进入。 3、解析域名 4、申请二级域名 SSL 证书 5、待证书审核通过并颁发后,下载 SSL 证书并解压 三、Nginx 配置二级域名项目映. 阅读详情

使用场景:现在有一个个人主页 和一个产品,只有一个台阿里云服务器和一个域名,所以想把产品的地址挂在二级域名上,但是域名解析必须要用80端口,

 环境:centos7 tomcat8 nginx1.6.2

tomcate 配置8080端口

webapps 下有两个项目:ROOT blog4u



安装nginx

参考:菜鸟教程http://www.runoob.com/linux/nginx-install-setup.html



一、安装编译工具及库文件

yum -y install make zlib zlib-devel gcc-c++ libtool  openssl openssl-devel

二、首先要安装 PCRE

PCRE 作用是让 Nginx 支持 Rewrite 功能。

1、下载 PCRE 安装包,下载地址: http://downloads.sourceforge.net/project/pcre/pcre/8.35/pcre-8.35.tar.gz

[root@bogon src]# wget http://downloads.sourceforge.net/project/pcre/pcre/8.35/pcre-8.35.tar.gz

2、解压安装包:

[root@bogon src]# tar zxvf pcre-8.35.tar.gz

3、进入安装包目录

[root@bogon src]# cd pcre-8.35

4、编译安装 

[root@bogon pcre-8.35]# ./configure
[root@bogon pcre-8.35]# make && make install

5、查看pcre版本

[root@bogon pcre-8.35]# pcre-config --version

安装 Nginx

1、下载 Nginx,下载地址:http://nginx.org/download/nginx-1.6.2.tar.gz

[root@bogon src]# wget http://nginx.org/download/nginx-1.6.2.tar.gz

2、解压安装包

[root@bogon src]# tar zxvf nginx-1.6.2.tar.gz

3、进入安装包目录

[root@bogon src]# cd nginx-1.6.2

4、编译安装

[root@bogon nginx-1.6.2]# ./configure --prefix=/usr/local/webserver/nginx --with-http_stub_status_module --with-http_ssl_module --with-pcre=/usr/local/src/pcre-8.35
[root@bogon nginx-1.6.2]# make
[root@bogon nginx-1.6.2]# make install

5、查看nginx版本

[root@bogon nginx-1.6.2]# /usr/local/webserver/nginx/sbin/nginx -v

到此,nginx安装完成。


Nginx 配置

创建 Nginx 运行使用的用户 www:

[root@bogon conf]# /usr/sbin/groupadd yuwb
[root@bogon conf]# /usr/sbin/useradd -g yuwb yuwb

配置nginx.conf 


user yuwb yuwb;

server上面添加两组映射






其他不作改变

检查配置文件ngnix.conf的正确性命令:

[root@bogon conf]# /usr/local/webserver/nginx/sbin/nginx -t

启动 Nginx

Nginx 启动命令如下:

[root@bogon conf]# /usr/local/webserver/nginx/sbin/nginx

Nginx 其他命令

以下包含了 Nginx 常用的几个命令:

/usr/local/webserver/nginx/sbin/nginx -s reload            # 重新载入配置文件
/usr/local/webserver/nginx/sbin/nginx -s reopen            # 重启 Nginx
/usr/local/webserver/nginx/sbin/nginx -s stop              # 停止 Nginx
另注:使用二级域名需要在阿里云域名解析中添加解析记录
Nginx设置二级域名映射到不同的Tomcat 一、前言 在之前的博客中,已经安装好了多个tomcat和nginx,本篇博客将介绍如何设置不同的二级域名转发到不同的tomcat上 二、配置服务器端 我使用的是腾讯云服务器,只需要在云解析中配置相关域名信息即可 三、配置nginx 进入nginx的配置文件中 cd /usr/local/nginx/conf vim nginx.conf server { listen ... 阅读详情

相关推荐

Windows nginx +多个 tomcat 配置

下载nginx;下载tomcat ;配置nginx ;多个tomcat负载

Nginx | nginx添加二级访问目录

一、需求说明   现有域名www.test.com,采用前后端分离方式,将前端VUE项目放在 Nginx 中,后端的项目放在 Tomcat 中。如果是一个前端项目,可将 Nginx 自带的文件夹 $[NginxHome]/html内的项目文件,替换为先项目文件即可,但涉及到多二级目录该如何配置呢? 域名 访问项目 www.test.com 登录页面 www.test.com/login_web 登录页面 www.test.com/apps_web 应用管理页面 www.test.

@范恒宾的博客 2万+

nginx+tomcat多域名配置

nginx+tomcat多域名配置 尝试过多次是比较ok!写的比较的简单有需要的朋友可以自己搭建试试做了session共享

nginx+tomcat绑定二级域名,部署多个应用

本文介绍在阿里云上开通二级域名,并使用单个tomcat部署多个应用和ngnix+tomcat(多个)两种方式实现多个应用的部署,以下为操作步骤。

jrn1012的专栏 7022

告别手动拍照!用Python+JAKA机械臂+D455相机实现全自动手眼标定(附完整代码)

本文详细介绍了如何利用Python脚本实现JAKA机械臂与Intel RealSense D455相机的全自动手眼标定流程,提供从硬件配置到代码实现的完整解决方案。通过自动化标定,显著提升工业自动化中的精度和效率,适用于机器人视觉领域的二次开发需求。

weixin_30555125的博客 521

搭建适用于lammps中opls-aa力场的文件流程

现在我已经解决了以上问题,并且通过我的方法可以实现从空白文档到搭建完成以上全部内容,后期只要细心检查即可。需要的data文件最关键是获得相应阴阳离子的mmol文件,因此问题转化为构建一份mmol文件。主要用到的软件及程序:gaussian09,makemol程序(tranal),opls-aa的参数文件。二面角个数:成角原子序号及对应的参数(这里PF6的结构没有二面角,所以为0)参考文献个数:文献名(空够行数即可,这些是给自己的备忘))和自身体系对应的参考文献,修改或填入对应的参数即可。

baguette的博客 2888

Nginx+Tomcat配置多个二级域名

http://nassir.iteye.com/blog/1870660 把tomcat下几个项目分别配置成二级域名(主域名配置一样): a 项目 配置成 http://a.domain.com  b 项目 配置成 http://b.domain.com   第一步:配置tomcat虚拟目录   Java代码   "a.domain.com"  ap

Baple的专栏 8829

java modbus通讯协议_Modbus通 讯 协 议

电磁流量计Modbus通 讯 协 议(版本号:9000-K V9.1.1)2020年01月01日通讯协议针对KFD电磁流量计工业应用设计,版本:9000-K V9.1.1,该版本主要用于实时数据采集、流量测量、流量累计控制及部分参数的修改。一、主机系统通讯部件要求1.国际标准RS-485通讯接口部件,不小于11Bytes 的通信缓冲区(FIFO),支持1200、2400、4800、96...

weixin_39956612的博客 1012

nginx+tomcat 配置不同二级域名访问tomcat中的对应项目

先修改tomcat的配置 1、找到tomcat的安装目录,进入config目录。打开server.xml 2、编辑里面的内容 找到host节点。复制host节点并且编辑里面的内容: <Host name="项目访问的网址" appBase="webapps" unpackWARs="true" autoDeploy="true"> ...

Jioho的博客 3861

终于找到两个稳定好用的Docker镜像加速源,拉取速度提升几十倍!

国内使用Docker经常遇到镜像拉取慢、超时失败的问题🐳 本文分享两个亲测好用的免费镜像加速源⚡ 实测拉取速度从十几分钟缩短到几十秒,稳定性接近100%📊 支持一键配置脚本,支持多平台使用✨

XiaoqiangClub的博客 952

LVGL core disp显示设计(lv_disp.c)

lv_disp.c当前显示页面的配置scr_act在原始的LVGL是以screen的概念存在,但我们还是习惯叫它为一个页面提供获取top_layer、sys_layer、prev_scr图层接口配置主题管理默认的主题管理是递归查找的,实际项目中因此页面的复杂性,虽然也兼容了此主题管理的方案,但还是推荐使用单页面自行管理主题的方案壁纸设置多页面切换的动画支持计算无用户操作时间清理显示缓存。

Bigan(安)的博客 2331

nginx配置二级目录访问tomcat

之前没有接触过nginx,但公司运维出现问题,于是由我来修改nginx配置文件,添加二级目录来访问tomcat下的项目。推荐博客:https://blog.youkuaiyun.com/daybreak1209/article/details/51549031来了解nginx一、nginx下载与启动在官网http://nginx.org/en/download.html下载nginx下载完成后解压即可。进去根...

林海静的博客 6797

unity6000.0.3版本URP下ScriptableRendererFeature如何实现一张自定义贴图效果?

🏆本文收录于 《全栈 Bug 调优(实战版)》 专栏。专栏聚焦真实项目中的各类疑难 Bug,从成因剖析 → 排查路径 → 解决方案 → 预防优化全链路拆解,形成一套可复用、可沉淀的实战知识体系。无论你是初入职场的开发者,还是负责复杂项目的资深工程师,都可以在这里构建一套属于自己的「问题诊断与性能调优」方法论,助你稳步进阶、放大技术价值。

**My Coding Family** 585

nginx tomcat 配置 多个 二级域名 多个项目

我想要的是 访问 news.test.com , 实际访问的是 tomcat 下面的news 项目 ,访问 forum.test.com ,实际访问的是 tomcat 下面的 luntan 项目,但是浏览器地址 栏url news.test.com 、forum.test.com 不变 ,不要变成 news.test.com/news 或者 forum.test.com/luntan 这样的,如何

chinajobs的专栏 3933

基于YOLOv11的手术器械计数系统:从数据集构建到Web应用部署

m2cai16-tool数据集:包含15种腹腔镜手术器械的标注图像Cholec80数据集:包含80个胆囊切除手术视频,标注了7种器械SurgicalTools数据集:包含超过10,000张手术器械图像,涵盖21类常见器械手术剪(Scissors)止血钳(Hemostat)持针器(Needle Holder)手术刀(Scalpel)镊子(Forceps)拉钩(Retractor)吸引器(Suction)

YOLO 396

C# WinForm 基于DirectShow.dll编写的程序,可边预览边保存视频,音频和图片

基于微软的DirectShow.dll的二次开发1.自动识别连接的摄像头跟麦克风且可以对其进行选择(默认选中第一个)2.可录制wmv和avi两种格式的视频并且都带有音频,avi可以录制的分辨率和帧数进行选择,wmv默认进行了淸晰度优化如不喜欢可去除代码中有相关提示3.可在预览点开之后进行拍照,也可边录制视频边拍照4.添加了视频和音频的压缩功能(酌情使用)这次二次开发发现C#对DirectShow的相关信息太少,这次做完也不敢藏私共享出来,还望大家指正

利用nginx使域名解析到tomcat相应的目录下

首先的有个域名解析到你的服务器ip例如 dnjcs.jlncjf.com 域名,现在我打算将 dnjcs.jlncjf.com指向到dnjcsVue这个文件夹 首先确保服务器安装了ngix,具体怎么安装百度,找到ngix目录 拷贝个conf文件修改里面内容 #user nobody; worker_processes 1;#error_log logs/error.log; #er

u012040869的博客 1989

TMS_WebGMaps_1.9.8.0_Full_Source

TMS_WebGMaps_1.9.8.0_Full_Source 全源码 delphi cbuilder

如何设置域名泛解析及解决恶意泛域名解析的方法

最近看到很多的博主和站长都发帖讨论关于泛域名解析的问题,也看到过有不少的网站被人做了恶意泛域名解析,本来没打算再研究这个问题,可今天发现公司的一个企业网站也被恶意泛域名解析了,搞了半天,总算把问题给解决了。鉴于许多朋友也遇到了这样的问题,我就把自己处理这个被恶意泛解析难题时的过程在马海祥博客上发出来,仅供大家参考。 一、什么是泛域名解析? 所谓“泛域名解析”是指:利用通配符

slqgenius的博客 2万+

android 蓝牙通讯demo

android 下蓝牙通讯demo,实现了发现蓝牙,使能蓝牙,通过蓝牙发送消息。

深度学习工具包 DeepLearningToolbox

深度学习工具包Deprecation notice.-----This toolbox is outdated and no longer maintained.There are much better tools available for deep learning than this toolbox, e.g. [Theano](http://deeplearning.net/software/theano/), [torch](http://torch.ch/) or [tensorflow](http://www.tensorflow.org/)I would suggest you use one of the tools mentioned above rather than use this toolbox.Best, Rasmus.DeepLearnToolbox================A Matlab toolbox for Deep Learning.Deep Learning is a new subfield of machine learning that focuses on learning deep hierarchical models of data.It is inspired by the human brain's apparent deep (layered, hierarchical) architecture.A good overview of the theory of Deep Learning theory is[Learning Deep Architectures for AI](http://www.iro.umontreal.ca/~bengioy/papers/ftml_book.pdf)For a more informal introduction, see the following videos by Geoffrey Hinton and Andrew Ng.* [The Next Generation of Neural Networks](http://www.youtube.com/watch?v=AyzOUbkUf3M) (Hinton, 2007)* [Recent Developments in Deep Learning](http://www.youtube.com/watch?v=VdIURAu1-aU) (Hinton, 2010)* [Unsupervised Feature Learning and Deep Learning](http://www.youtube.com/watch?v=ZmNOAtZIgIk) (Ng, 2011)If you use this toolbox in your research please cite [Prediction as a candidate for learning deep hierarchical models of data](http://www2.imm.dtu.dk/pubdb/views/publication_details.php?id=6284)```@MASTERSTHESIS\{IMM2012-06284, author = "R. B. Palm", title = "Prediction as a candidate for learning deep hierarchical models of data", year = "2012",}```Contact: rasmusbergpalm at gmail dot comDirectories included in the toolbox-----------------------------------`NN/` - A library for Feedforward Backpropagation Neural Networks`CNN/` - A library for Convolutional Neural Networks`DBN/` - A library for Deep Belief Networks`SAE/` - A library for Stacked Auto-Encoders`CAE/` - A library for Convolutional Auto-Encoders`util/` - Utility functions used by the libraries`data/` - Data used by the examples`tests/` - unit tests to verify toolbox is workingFor references on each library check REFS.mdSetup-----1. Download.2. addpath(genpath('DeepLearnToolbox'));Example: Deep Belief Network---------------------```matlabfunction test_example_DBNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit RBM and visualize its weightsrand('state',0)dbn.sizes = [100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);figure; visualize(dbn.rbm{1}.W'); % Visualize the RBM weights%% ex2 train a 100-100 hidden unit DBN and use its weights to initialize a NNrand('state',0)%train dbndbn.sizes = [100 100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);%unfold dbn to nnnn = dbnunfoldtonn(dbn, 10);nn.activation_function = 'sigm';%train nnopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.10, 'Too big error');```Example: Stacked Auto-Encoders---------------------```matlabfunction test_example_SAEload mnist_uint8;train_x = double(train_x)/255;test_x = double(test_x)/255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit SDAE and use it to initialize a FFNN% Setup and train a stacked denoising autoencoder (SDAE)rand('state',0)sae = saesetup([784 100]);sae.ae{1}.activation_function = 'sigm';sae.ae{1}.learningRate = 1;sae.ae{1}.inputZeroMaskedFraction = 0.5;opts.numepochs = 1;opts.batchsize = 100;sae = saetrain(sae, train_x, opts);visualize(sae.ae{1}.W{1}(:,2:end)')% Use the SDAE to initialize a FFNNnn = nnsetup([784 100 10]);nn.activation_function = 'sigm';nn.learningRate = 1;nn.W{1} = sae.ae{1}.W{1};% Train the FFNNopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.16, 'Too big error');```Example: Convolutional Neural Nets---------------------```matlabfunction test_example_CNNload mnist_uint8;train_x = double(reshape(train_x',28,28,60000))/255;test_x = double(reshape(test_x',28,28,10000))/255;train_y = double(train_y');test_y = double(test_y');%% ex1 Train a 6c-2s-12c-2s Convolutional neural network %will run 1 epoch in about 200 second and get around 11% error. %With 100 epochs you'll get around 1.2% errorrand('state',0)cnn.layers = { struct('type', 'i') %input layer struct('type', 'c', 'outputmaps', 6, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %sub sampling layer struct('type', 'c', 'outputmaps', 12, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %subsampling layer};cnn = cnnsetup(cnn, train_x, train_y);opts.alpha = 1;opts.batchsize = 50;opts.numepochs = 1;cnn = cnntrain(cnn, train_x, train_y, opts);[er, bad] = cnntest(cnn, test_x, test_y);%plot mean squared errorfigure; plot(cnn.rL);assert(er<0.12, 'Too big error');```Example: Neural Networks---------------------```matlabfunction test_example_NNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);% normalize[train_x, mu, sigma] = zscore(train_x);test_x = normalize(test_x, mu, sigma);%% ex1 vanilla neural netrand('state',0)nn = nnsetup([784 100 10]);opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samples[nn, L] = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.08, 'Too big error');%% ex2 neural net with L2 weight decayrand('state',0)nn = nnsetup([784 100 10]);nn.weightPenaltyL2 = 1e-4; % L2 weight decayopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex3 neural net with dropoutrand('state',0)nn = nnsetup([784 100 10]);nn.dropoutFraction = 0.5; % Dropout fraction opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex4 neural net with sigmoid activation functionrand('state',0)nn = nnsetup([784 100 10]);nn.activation_function = 'sigm'; % Sigmoid activation functionnn.learningRate = 1; % Sigm require a lower learning rateopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex5 plotting functionalityrand('state',0)nn = nnsetup([784 20 10]);opts.numepochs = 5; % Number of full sweeps through datann.output = 'softmax'; % use softmax outputopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex6 neural net with sigmoid activation and plotting of validation and training error% split training data into training and validation datavx = train_x(1:10000,:);tx = train_x(10001:end,:);vy = train_y(1:10000,:);ty = train_y(10001:end,:);rand('state',0)nn = nnsetup([784 20 10]); nn.output = 'softmax'; % use softmax outputopts.numepochs = 5; % Number of full sweeps through dataopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, tx, ty, opts, vx, vy); % nntrain takes validation set as last two arguments (optionally)[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');```[![Bitdeli Badge](https://d2weczhvl823v0.cloudfront.net/rasmusbergpalm/deeplearntoolbox/trend.png)](https://bitdeli.com/free "Bitdeli Badge")

nginx配置二级域名、http转https并映射到tomcat下不同项目

1.安装 我使用的是nginx-1.14.2的安装包, nginx-1.14.2.tar.gz # 下载安装包到 src 目录 cd /usr/local/src wget http://nginx.org/download/nginx-1.14.1.tar.gz #解压 nginx-1.14.2.tar.gz tar -zxvf java.tar.gz 想要使用nginx的https,就需要配置的时候安装http_ssl_module模块。 ./configure --prefix=/usr/l

weixin_43876557的博客 928

apache 域名 指向相应的目录_nginx+tomcat绑定二级域名,部署多个应用

本文介绍在阿里云上开通二级域名,并使用单个tomcat部署多个应用和ngnix+tomcat(多个)两种方式实现多个应用的部署,以下为操作步骤。通过CNAME开通二级域名解析开通二级域名解析,如下图所示,通过CNAME解析后会生成blog.admineap.com的二级域名。在本实验中,顶级域名和二级域名同时指向同一IP,如果单个tomcat绑定顶级域名和二级域名的应用可通过Tomcat...

weixin_39809168的博客 198

tomcat 配置二级域名 实现域名访问webapp下项目

https://segmentfault.com/a/1190000013122831 子目录配置二级域名(备用): &lt;?xml version="1.0" encoding="UTF-8"?&gt; &lt;!-- Licensed to the Apache Software Foundation (ASF) under one or more contributor ...

amoxu 1112

Nginx+Tomcat的服务器端环境配置详解

Nginx+Tomcat的服务器端环境配置详解

ahua的博客 1万+
上一篇: 搭建完全分布式redis集群
下一篇: 服务器磁盘满了,mysql写入数据报错table xx is full
programmeryu
博客等级 码龄11年 23粉丝 67原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

当前余额3.43元 前往充值 >
需支付:10.00元
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付元
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值