标题: 谁能帮忙翻译一下有关svn安装方面的文章.(8) [打印本页] 作者: szhu 时间: 2006-11-3 11:01 标题: 谁能帮忙翻译一下有关svn安装方面的文章.(8) B. Making and Installing the Subversion Server
-------------------------------------------
Go back into your subversion working copy and run ./autogen.sh if
you need to. Then, assuming Apache httpd 2.0 is installed in the
standard location, run:
$ ./configure
Note: do *not* configure subversion with "--disable-shared"!
mod_dav_svn *must* be built as a shared library, and it will
look for other libsvn_*.so libraries on your system.
If you see a warning message that the build of mod_dav_svn is being
skipped, this may be because you have Apache httpd 2.0 installed
in a non-standard location. You can use the "--with-apxs=" option
to locate the apxs script:
Note: it *is* possible to build mod_dav_svn as a static library
and link it directly into Apache. Possible, but painful. Stick
with the shared library for now; if you can't, then ask.
$ rm /usr/local/lib/libsvn*
If you have old subversion libraries sitting on your system,
libtool will link them instead of the `fresh' ones in your tree.
Remove them before building subversion.
$ make clean && make && make install
After the make install, the Subversion shared libraries are in
/usr/local/lib/. mod_dav_svn.so should be installed in
/usr/local/apache2/modules/.
Section II.E explains how to build the server on Windows.
C. Configuring Apache for Subversion
---------------------------------
The following section is an abbreviated version of the
information in the Subversion Book
(http://svnbook.red-bean.com). Please read chapter 6 for more
details.
The following assumes you have already created a repository.
For documentation on how to do that, see README.
The following also assumes that you have modified
/usr/local/apache2/conf/httpd.conf to reflect your setup.
At a minimum you should look at the User, Group and ServerName
directives. Full details on setting up apache can be found at: http://httpd.apache.org/docs-2.0/
First, your httpd.conf needs to load the mod_dav_svn module.
Subversion's 'make install' target should automatically add this
line for you. But if apache gives you an error like "Unknown
DAV provider: svn", then you may want to verify that this line
exists in your httpd.conf:
LoadModule dav_svn_module modules/mod_dav_svn.so
NOTE: if you built mod_dav as a dynamic module as well, make sure
the above line appears after the one that loads mod_dav.so.
Next, add this to the *bottom* of your httpd.conf:
<LimitExcept GET PROPFIND OPTIONS REPORT>
Require valid-user
</LimitExcept>
c) For separate restricted read and write access:
AuthGroupFile /my/svn/group/file
<LimitExcept GET PROPFIND OPTIONS REPORT>
Require group svn_committers
</LimitExcept>
<Limit GET PROPFIND OPTIONS REPORT>
Require group svn_committers
Require group svn_readers
</Limit>
These are only a few simple examples. For a complete tutorial
on Apache access control, please consider taking a look at the
tutorials found under "Security" on the following page: http://httpd.apache.org/docs-2.0/misc/tutorials.html
In order for 'svn cp' to work (which is actually implemented as a
DAV COPY command), mod_dav needs to be able to determine the
hostname of the server. A standard way of doing this is to use
Apache's ServerName directive to set the server's hostname. Edit
your /usr/local/apache2/conf/httpd.conf to include:
ServerName svn.myserver.org
If you are using virtual hosting through Apache's NameVirtualHost
directive, you may need to use the ServerAlias directive to specify
additional names that your server is known by.
If you have configured mod_deflate to be in the server, you can enable
compression support for your repository by adding the following line
to your Location block:
NOTE: Make sure that the user 'nobody' (or whatever UID the
httpd process runs as) has permission to read and write the
Berkeley DB files! This is a very common problem.
The most common reason this might fail is permission problems
reading the repository db files. If the checkout fails, make
sure that the httpd process has permission to read and write to
the repository. You can see all of mod_dav_svn's complaints in
the Apache error logfile, /usr/local/apache2/logs/error_log.
To run the regression test suite for networked Subversion, see
the instructions in subversion/tests/cmdline/README.
For advice about tracing problems, see "Debugging the server" in
www/hacking.html.