简体   繁体   English

这个apache2 site-config-file有什么问题?

[英]What's wrong with this apache2 site-config-file?

I researched a lot on the Internet how to fix this file, unfortunately I'm not able to find the solution. 我在互联网上研究了很多如何修复此文件的方法,但不幸的是我找不到解决方案。 My apache2-server is still not accessible via public ip so I'm asking here now. 我的apache2-server仍然无法通过公共ip访问,所以我现在在这里问。 If I try to access the apache2-server over http it basically connects to my router-web-interface which shouldn't be the case. 如果我尝试通过http访问apache2-server,则基本上不会连接到我的router-web-interface。 Connecting via https results in a timeout. 通过https连接会导致超时。 If I delete the *:80 thingy and change the *:443 to *:80, it works for http. 如果我将*:80删除,并将*:443更改为*:80,则适用于http。 Actually I don't know the real reason so.. here's the file. 其实我不知道真正的原因,这是文件。 I'd be glad if someone could fix this for me since I've running several services on it which I need every day. 我很高兴有人能为我解决此问题,因为我每天都在上面运行一些服务。

Port-forwarding is configured correctly (it worked for over 1 year, but I changed something in this file and now it doesn't work anymore) 端口转发已正确配置(它已经工作了一年多,但是我更改了此文件中的某些内容,现在它不再起作用了)

https://dl.dropboxusercontent.com/u/34140308/tmp_apache2.txt https://dl.dropboxusercontent.com/u/34140308/tmp_apache2.txt

You didn't state it but I guess your server is behind NAT and you access this *:80 HTTP vhost using a different port number and your router's public IP. 您没有说明,但我想您的服务器位于NAT之后,并且您使用其他端口号和路由器的公共IP访问此*:80 HTTP虚拟主机。 Say your router's public IP is 1.2.3.4, your server private address is 192.168.0.1 and you have port forwarding configured so that TCP traffic going to 1.2.3.4:8080 gets redirected to 192.168.0.1:80. 假设路由器的公用IP为1.2.3.4,服务器专用地址为192.168.0.1,并且已配置端口转发,以便将去往1.2.3.4:8080的TCP通信重定向到192.168.0.1:80。

This is plain HTTP which your Apache receives on port 80 and applies the config for *:80 vhost. 这是您的Apache在端口80上接收的纯HTTP,并将配置应用于*:80 vhost。 Your *:80 vhost contains a redirect rule that tells it to redirect all non HTTPS traffic to https://%{HTTP_HOST}/$1 . 您的*:80虚拟主机包含一个重定向规则,该规则告诉它将所有非HTTPS流量重定向到https://%{HTTP_HOST}/$1 %{HTTP_HOST} in this case holds the name you used to in your web browser to access the page, for example, if you used the public IP of the server it holds '1.2.3.4'. 在这种情况下, %{HTTP_HOST}保留您在Web浏览器中用于访问页面的名称,例如,如果您使用服务器的公共IP,则该名称为'1.2.3.4'。 So the redirect rule redirects you to https://1.2.3.4/... which is your router web interface. 因此,重定向规则会将您重定向到路由器Web界面https://1.2.3.4/...

If you haven't change port forwarding settings on your router than most likely you have recently added the redirect to the HTTP Vhost ro you removed a port number from the rewrite rule. 如果您没有更改路由器上的端口转发设置,最有可能是您最近将重定向添加到了HTTP Vhost ro,则从重写规则中删除了端口号。 In other words: the redirect should not be there, or the it should point you to something like https://1.2.3.4:HTTPS_PORT/... where the HTTPS_PORT is the port number on the public side that will take you to the TCP 443 on the local server. 换句话说:重定向不应该存在,否则它会将您指向https://1.2.3.4:HTTPS_PORT/...地方,其中HTTPS_PORT是公共端的端口号,它将带您进入本地服务器上的TCP 443。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM