无法远程连接到svnserver

can't connect to svnserver remotely

因此,我正在尝试在 centOS linux 服务器计算机上设置源代码存储库,以便我可以通过 Internet 远程访问文件。我已经安装了 subversion,创建了存储库,正确设置了存储库的 svnserve.conf 和 passwd 文件,afaik。然后我用命令“svnserve -d -r [/path/to/repositories]”启动了 svnserver。我还在服务器连接的路由器上转发端口 3690。

问题来了。
我似乎无法远程连接到服务器,但我可以使用:
svn checkout svn://127.0.0.1/[repo] 在本地连接。

一切似乎都在本地、在机器上运行良好,但在远程,我得到:

svn: E170013: Unable to connect to a repository at URL 'svn://[server.ip.addr.ess]/[repo]'
svn: E000060: Can't connect to host '[server.ip.addr.ess]': Operation timed out

当我关闭svnserver时,我也可以通过svn+ssh成功远程连接,但我不想使用svn+ssh。 我在这里没有做什么?

因此,在这种特定情况下的问题是我需要允许使用 iptables 通过防火墙连接到 svnserve。

我运行的命令是iptables -A INPUT -p tcp -m tcp --dport 3690 -j ACCEPT

该命令将允许使用 tcp 连接协议从任何 IP 地址到端口 3690 的所有连接,这是 svnserve 的默认端口。另请注意,您需要确保 OUTPUT 在 iptables 中也已打开。

Here 是一篇关于 iptables 的好文章。