将特定IP绑定到apache2中的端口

将特定IP绑定到apache2中的端口

如何在我的笔记本电脑上设置在线 SVN 服务器我要求将我的笔记本电脑上安装的 SVN 服务器的访问权限授予位于该国其他地区的一些朋友。我设置了一个 SVN 服务器。我能够在本地访问它,但我的朋友却不能。

所以我在Google上搜索并得出结论,我必须将端口80绑定到我的公共IP,这样当任何请求到达我的公共IP时,它就会被重定向到端口80,而该端口又被进程apache2使用。(这是搜索后了解到的,如有错误请指正。)

但是当我进行以下端口绑定时一条链接当我重新启动 apache2 服务器时出现以下错误。

service apache2 restart 
 * Restarting web server apache2                                                                          [Mon May 20 13:44:25 2013] [warn] NameVirtualHost *:80 has no VirtualHosts
[Mon May 20 13:44:25 2013] [warn] NameVirtualHost *:80 has no VirtualHosts
(99)Cannot assign requested address: make_sock: could not bind to address xyz.pqr.ad.ef:8010
no listening sockets available, shutting down
Unable to open logs
Action 'start' failed.
The Apache error log may have more information.

其中 xyz.pqr.ad.ef 是我的公共 IP,我又添加了一个端口 8010。

需要解决此错误并为某些特定用户获取在线 SVN 存储库。

答案1

您的上述问题是因为您已在 httpd.conf 文件中指定了这一点:

NameVirtualHost *:80

但是,您不指定任何 VirtualHost 部分,如下所示:

<VirtualHost *:80>
   UseCanonicalName off

    ServerName localhost

    # subversion lines go in here
</VirtualHost>

相关内容