首页 \ 问答 \ 如何通过mod_proxy连接器(ajp)为apache重定向到tomcat配置https(How to configure https for an apache redirecting to tomcat via mod_proxy connector (ajp))

如何通过mod_proxy连接器(ajp)为apache重定向到tomcat配置https(How to configure https for an apache redirecting to tomcat via mod_proxy connector (ajp))

我在linux系统上有一个apache服务器(在amazon aws上),用https运行。 我也有一个tomcat。 我想用apache作为tomcat的前门。 我为apache启用了mod_proxy模块,并且重定向到tomcat工作正常,看起来像这样:

<VirtualHost *:80>
   ServerName my.domain.com

   #Log
   ErrorLog /var/log/ajp.error.log
   CustomLog /var/log/ajp.log combined

   #AJP configuration
   <Proxy *>
       Order deny,allow
       Deny from all
       Allow from all
   </Proxy>

   ProxyRequests Off

   ProxyPass / ajp://localhost:8009/
   ProxyPassReverse / ajp://localhost:8009/

 </VirtualHost>

我在/etc/httpd/conf.d文件夹中的httpd.conf文件底部添加了这行代码。

但是如果我在httpd.conf文件中添加另一个VirtualHost以重定向到https,则重定向到https会起作用,但会显示apache Test页面,而不是tomcat页面。 如果我删除此重定向VirtualHost,将显示apache tomcat页面。 我还启用了mod_rewrite模块。 我在ssl.conf中配置的https内容(/etc/httpd/conf.d/ssl.conf),它运行正常。 在那里我设置了ssl证书,如果客户端使用已知的https证书发出请求,服务器将回答该请求。 否则不是。

我添加到httpd.conf的https重定向的VirtualHost如下所示:

    <VirtualHost *:80>
         ServerName my.domain.com
         RewriteEngine on
         ReWriteCond %{SERVER_PORT} !^443$
         RewriteRule ^/(.*) https://%{HTTP_HOST}/$1 [NC,R,L]
    </VirtualHost>

你能帮我么? 我在这做错了什么? 我应该在/etc/httpd/conf.d/ssl.conf文件中进行更改吗? 我很


I have an apache server on an linux system (on amazon aws), running with https. I also have an tomcat on it. I want to use the apache as a front door to the tomcat. I enabled the mod_proxy module for the apache and the redirection to the tomcat works fine and looks like this:

<VirtualHost *:80>
   ServerName my.domain.com

   #Log
   ErrorLog /var/log/ajp.error.log
   CustomLog /var/log/ajp.log combined

   #AJP configuration
   <Proxy *>
       Order deny,allow
       Deny from all
       Allow from all
   </Proxy>

   ProxyRequests Off

   ProxyPass / ajp://localhost:8009/
   ProxyPassReverse / ajp://localhost:8009/

 </VirtualHost>

I added this lines at the bottom of my file httpd.conf in /etc/httpd/conf.d folder.

But if I add another VirtualHost in the httpd.conf file to redirect to https, the redirection to https works but the apache Test page will be shown, not the tomcat page. If I remove this redirection VirtualHost the apache tomcat page will be shown. I also enabled the mod_rewrite module. The https stuff I configured in ssl.conf (/etc/httpd/conf.d/ssl.conf) and it works fine. There I setup the ssl certificates and if the client make an request with an known https certificate the server will answer the request. Else not.

The VirtualHost for the https redirection I added to the httpd.conf looks like this:

    <VirtualHost *:80>
         ServerName my.domain.com
         RewriteEngine on
         ReWriteCond %{SERVER_PORT} !^443$
         RewriteRule ^/(.*) https://%{HTTP_HOST}/$1 [NC,R,L]
    </VirtualHost>

Can you please help me? What I am doing wrong here? Should I make changes in the /etc/httpd/conf.d/ssl.conf file? I am very


原文:https://stackoverflow.com/questions/41085765
更新时间:2023-10-26 12:10

最满意答案

我相信你要做的就是加入两个数据集。 您正在执行的linq查询返回正确的结果,因为您对它的要求是:对于abcdata的每个元素,以及xyzdata的每个元素,返回您正在构造的对象。 因此,如果abcdata有3个元素而xyzdata有5个元素,那么结果将有15个元素。

如果你想:对于abcdata的每个元素,选择具有相同名称的xyzdata元素并连接组,你需要的是一个Join。

就像是

var result = from i1 in abcdata
                join i2 in xyzdata on i1.Name equals i2.Name
                select new
                {
                    Name  = i1.Name,
                    Group = i1.Group.ToString() + i2.Group.ToString()
                };

I believe that what you are trying to do is join both data collections. The linq query that you are doing is returning the correct results as what you are asking with it is: for every element of abcdata, and for every element of xyzdata, return the object you are constructing. So, if abcdata has 3 elements and xyzdata has 5 elements, the result will have 15 elements.

If you want: for each element of abcdata, select the elements of xyzdata that have the same name and concatenate the Groups, what you need is a Join.

Something like

var result = from i1 in abcdata
                join i2 in xyzdata on i1.Name equals i2.Name
                select new
                {
                    Name  = i1.Name,
                    Group = i1.Group.ToString() + i2.Group.ToString()
                };

相关问答

更多
  • 在WPF行中表示列表中的对象,而列是对象的属性。 这取决于DataGrid.ItemsSource是什么。如果您的ItemSource是BindedClass的数组,您可以通过以下方式获取选定的对象: BindedClass bc = (BindedClass)dataGridControl.SelectedItem; var prop1 = bc.Prop1; var prop2 = bc.Prop2; In WPF rows represent objects in a list and column ...
  • 这对我有用。 您的XML示例也是错误的,缺少关闭 var result = from c in document.Elements("client") group c by c.Element("ClientId").Value into grouped select new { ClientId = grouped.Key, TotalSum = grouped.Sum(g => Decimal.Parse(g.Eleme ...
  • 实际上,这里的问题不在于LINQtoEntities而不是Grid,而在于EF。 EF支持对集合中对象的更改,甚至在向表中添加行(即,向ObjectSet添加项)时更改通知,但不通过CollectionViewSource自动添加行。 如果需要,可以返回DataSet,或者只创建一个“Add New”命令,该命令将新项添加到ObjectSet并使其成为CollectionViewSource的当前项。 您可以通过调用CollectionViewSource.View.Refresh来刷新Collection ...
  • 为什么不明确设置您的DataGrid? http://www.wpftutorial.net/DataGrid.html - 这将帮助您手动设置DataGrid,而不是让它使用AutoGenerated列。 Why not explicitly setup your DataGrid? http://www.wpftutorial.net/DataGrid.html -- This will help you be able to setup your DataGrid manually instead o ...
  • var icerikler1 = (from icerik in data.Tbl_Iceriklers where icerik.ust_kategori_id == 96 select icerik).OrderByDescending(a=>a.ID).Take(2); var icerikler2 = (from icerik in data.Tbl_Iceriklers where icerik.ust_kategori ...
  • 我会改变你的反馈构造函数 public Feedback(string school, List feedbackLines) { School = school; FeedbackLines = new ObservableColleytion(feedbackLines); } 如果您的数据视图模型没有连接到数据库,那么这是一个更好的体系结构。 你可以把你的选择放在一个单独的课堂上。 如果您需要LINQ声明帮助,我可以帮助您。 在 ...
  • 我相信你要做的就是加入两个数据集。 您正在执行的linq查询返回正确的结果,因为您对它的要求是:对于abcdata的每个元素,以及xyzdata的每个元素,返回您正在构造的对象。 因此,如果abcdata有3个元素而xyzdata有5个元素,那么结果将有15个元素。 如果你想:对于abcdata的每个元素,选择具有相同名称的xyzdata元素并连接组,你需要的是一个Join。 就像是 var result = from i1 in abcdata join i2 in xyz ...
  • 我认为您应该在开始时从数据库加载所有记录,然后在ItemsSource上使用ICollectionView.Filter。 那么你就不必进行数据库交易了 你应该这样做 private void txtSearchBox_TextChanged(object sender, TextChangedEventArgs e) { TextBox textbox = sender as TextBox; if (textbox != null) { ...
  • 我不确定你真正想要实现的目标。 单击是否仅更改标题,而双击是否使用DataGrid-Entry执行某些操作? 如果是这种情况,您可以轻松区分这两者,这样您就不会处理错误的情况(取决于您选择的处理程序): 的MouseDown: OnMouseDownDown(object sender, MouseButtonEventArgs e) { UIElement uiElement = (UIElement) sender; Point hitPoint = e.GetPosition(uiEl ...
  • 尝试:- DataGrid.ItemsSource = query.ToList(); DataGrid不期望它正在访问的IEnumerable导致在获取枚举器来查找项时会发生非常昂贵的事情。 但是,通过将查询本身传递给DataGrid,每次数据网格调用GetEnumerator时都会执行查询。 由于您希望稍后过滤,因此您可以在更改过滤器设置时重新分配ItemsSource。 Try:- DataGrid.ItemsSource = query.ToList(); The DataGrid is not ...

相关文章

更多

最新问答

更多
  • 获取MVC 4使用的DisplayMode后缀(Get the DisplayMode Suffix being used by MVC 4)
  • 如何通过引用返回对象?(How is returning an object by reference possible?)
  • 矩阵如何存储在内存中?(How are matrices stored in memory?)
  • 每个请求的Java新会话?(Java New Session For Each Request?)
  • css:浮动div中重叠的标题h1(css: overlapping headlines h1 in floated divs)
  • 无论图像如何,Caffe预测同一类(Caffe predicts same class regardless of image)
  • xcode语法颜色编码解释?(xcode syntax color coding explained?)
  • 在Access 2010 Runtime中使用Office 2000校对工具(Use Office 2000 proofing tools in Access 2010 Runtime)
  • 从单独的Web主机将图像传输到服务器上(Getting images onto server from separate web host)
  • 从旧版本复制文件并保留它们(旧/新版本)(Copy a file from old revision and keep both of them (old / new revision))
  • 西安哪有PLC可控制编程的培训
  • 在Entity Framework中选择基类(Select base class in Entity Framework)
  • 在Android中出现错误“数据集和渲染器应该不为null,并且应该具有相同数量的系列”(Error “Dataset and renderer should be not null and should have the same number of series” in Android)
  • 电脑二级VF有什么用
  • Datamapper Ruby如何添加Hook方法(Datamapper Ruby How to add Hook Method)
  • 金华英语角.
  • 手机软件如何制作
  • 用于Android webview中图像保存的上下文菜单(Context Menu for Image Saving in an Android webview)
  • 注意:未定义的偏移量:PHP(Notice: Undefined offset: PHP)
  • 如何读R中的大数据集[复制](How to read large dataset in R [duplicate])
  • Unity 5 Heighmap与地形宽度/地形长度的分辨率关系?(Unity 5 Heighmap Resolution relationship to terrain width / terrain length?)
  • 如何通知PipedOutputStream线程写入最后一个字节的PipedInputStream线程?(How to notify PipedInputStream thread that PipedOutputStream thread has written last byte?)
  • python的访问器方法有哪些
  • DeviceNetworkInformation:哪个是哪个?(DeviceNetworkInformation: Which is which?)
  • 在Ruby中对组合进行排序(Sorting a combination in Ruby)
  • 网站开发的流程?
  • 使用Zend Framework 2中的JOIN sql检索数据(Retrieve data using JOIN sql in Zend Framework 2)
  • 条带格式类型格式模式编号无法正常工作(Stripes format type format pattern number not working properly)
  • 透明度错误IE11(Transparency bug IE11)
  • linux的基本操作命令。。。