如何通过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
最满意答案
我相信你要做的就是加入两个数据集。 您正在执行的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 ...
-
LINQ查询中的问题(Problem in LINQ Query)[2021-10-21]
这对我有用。 您的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 ... -
WPF DataGrid / LINQ查询(DataGrid新行不可见)(WPF DataGrid / LINQ Query (DataGrid new row not visible))[2023-10-03]
实际上,这里的问题不在于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 ...
-
Linq查询问题为Take(Linq query problem for Take)[2023-06-03]
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 ...