OpenVPN端口共享与Apache 443/10443不起作用

我configuration了openvpn(OpenVPN 2.1.0)和apache 2(分别在443和10443(使用modssl)监听),这两个应用程序听好了:

tcp 0 0 xxxx:10443 0.0.0.0:* LISTEN 1130/apache2 tcp 0 0 0.0.0.0:443 0.0.0.0:* LISTEN 7860/openvpn 

但是,由于我想确定的一个原因,端口共享选项configuration如下(公共IP)不起作用:

 port 443 port-share xxxx 10443 

openvpn日志中的错误是:

 TCP connection established with [AF_INET]yyyy:3123 Socket Buffers: R=[131072->131072] S=[131072->131072] TCPv4_SERVER link local: [undef] TCPv4_SERVER link remote: [AF_INET]yyyy:3123 yyyy:3123 Non-OpenVPN client protocol detected PORT SHARE PROXY: connect to port-share server failed yyyy:3123 SIGTERM[soft,port-share-redirect] received, client-instance exiting TCP/UDP: Closing socket 

我想openvpn没有连接的权利,但它是作为根启动

根7862 0.0 0.0 99552 924? S Sep22 0:00 / usr / sbin / openvpn –writepid /var/run/openvpn.server.pid –daemon ovpn-server –cd / etc / openvpn –config /etc/openvpn/server.conf – 脚本安全2

443和10443端口在防火墙上打开。

感谢您的任何意见和build议!

我已经咨询过:

  • OpenVPN端口与Apache / SSL共享

编辑iptables规则:

 Chain ufw-user-input (1 references) target prot opt source destination ACCEPT tcp -- anywhere anywhere tcp dpt:ssh ACCEPT udp -- anywhere anywhere udp dpt:ssh ACCEPT tcp -- anywhere anywhere tcp dpt:www ACCEPT udp -- anywhere anywhere udp dpt:www ACCEPT tcp -- anywhere anywhere tcp dpt:smtp ACCEPT udp -- anywhere anywhere udp dpt:25 ACCEPT tcp -- anywhere anywhere tcp dpt:domain ACCEPT udp -- anywhere anywhere udp dpt:domain ACCEPT udp -- anywhere anywhere udp dpt:openvpn ACCEPT tcp -- 10.0.0.0/8 anywhere tcp dpt:mysql ACCEPT udp -- 10.0.0.0/8 anywhere udp dpt:mysql ACCEPT tcp -- anywhere anywhere tcp dpt:https ACCEPT udp -- anywhere anywhere udp dpt:https ACCEPT tcp -- anywhere anywhere tcp dpt:10443 ACCEPT udp -- anywhere anywhere udp dpt:10443 

编辑以更好地解释错误日志:openvpn远程连接正在工作(我通过端口443成功连接到VPN)。 端口转发不起作用。 10443上的HTTPS连接正在工作,但端口443上的HTTPS连接不能与端口共享选项一起使用。

我终于find了这个问题的答案。

尽pipe防火墙规则看起来是正确的,openvpn在不同的主机(公共ip)上监听的事实却是apache。 使用相同的主机(和公共IP)openvpn和Apache解决了它。