我如何通过svn提供html服务?(可以svn充当Web服务器吗?)

sma*_*007 13 html svn

我已经将javadocs(html文件)签入svn.但是,当我通过浏览器访问html文件时,它被解释为文本.我该如何解决 ?

spl*_*ash 12

SVN不是网络服务器.我猜你在谈论Subversion的Apache模块!?如果要将.html文件视为HTML,则应设置svn:mime-type=text/html:

svn propset svn:mime-type text/html *.html
Run Code Online (Sandbox Code Playgroud)

请参阅SVN Book中的" 属性 ".

此外,如果svn:mime-type设置了属性,则Subversion Apache模块将Content-type:在响应GET请求时使用其值来填充 HTTP标头.这为在使用Web浏览器浏览存储库时如何显示文件提供了至关重要的线索.

也许您可以在配置文件中使用以下行配置您的subversion客户端或服务器:

[miscellany]
### Automatic properties are defined in the section 'auto-props'.
enable-auto-props = yes

### Section for configuring automatic properties.
[auto-props]
*.html = svn:mime-type=text/html
Run Code Online (Sandbox Code Playgroud)

这将自动设置新文件的属性.