The basic installation packages include: httpd of subversion/httpd/SVNMod_dav_svnMod_authz_svn two modules. (YUM install mod_dav_svn subversion httpd)
There should be two SVN service forms: 1. The default port through SVN: // ip: port established through svnserve is 3690; 2. SVN management through Apache httpd or other extension modules of web servers
For svnserve, daemon background processes are created in the form of svnserve-d-r/var/www/SVN, but kill the daemon in the form of 'pgrep svnserver, I don't know if there is a direct stop method.
SVN management through the HTTP server is also very good and can be easily viewed. The configuration process is as follows (first of all, install several software, which is not required .):
1. There are two mod statements about SVN under/etc/httpd/module.
2. There is a subversion. conf under/etc/httpd/config. d/(create one if there is no one). Its content is:
Loadmodule dav_module modules/mod_dav.so
Loadmodule dav_svn_module modules/mod_dav_svn.so
<Location/SVN>
Dav SVN
Svnpath/var/www/SVN/
Authtype basic
Authname "Subversion repos"
Authuserfile/var/www/SVN/repos1/CONF/passwd
Require valid-user
</Location>
# To create a new repository "http: // localhost/repos/stuff" using
# This configuration, run as root:
#
# Cd/var/www/SVN
# Svnadmin create stuff
# Chown-r Apache. Apache stuff
# Chcon-r-t httpd_sys_content_t stuff
# <Location/repos>
# Dav SVN
# Svnparentpath/var/www/SVN
#
# Limit write permission to list of valid users.
# <Limitaskt get PROPFIND Options Report>
# Require SSL connection for password protection.
# Sslrequiressl
#
# Authtype basic
# Authname "Authorization realm"
# Authuserfile/path/to/passwdfile
# Require valid-user
# </Limit10000t>
# </Location>
/Var/www/SVN is the directory to be stored in the repository, which can contain multipleCodeRepository. authuserfile is the user and password file, which can be moved to another place for separate management.
Under/var/www/SVN, an empty repository can be created through svnadmin createa/var/www/SVN/repos1. you can also create multiple repositories. This directory seems best to grant all permissions to Apche users: chown-r Apache. apache/var/www/SVN; you can configure some account and password in the repos1/conf directory. other repositories created can copy these conf files.
In this example, how does authuserfile be created?
Create "authuserfile" and set the Required User Password and stored files using Apache bin./Htpasswd command to create. Command Format: htpasswd [-Cmdpsd] passwordfile username if you create a user for the first time, you must use the "-c" parameter to create the User Password File htpasswd at the same time.-C passwd: the file "passwd" created by the preceding command, and a user named "Robert" is added to the file. When executing this command, a password is required. Note: The "C" parameter must not be used when the second or second user is created. Otherwise, the previous user will be deleted. To delete a user, run the following command: htpasswd-D passwd Robert, then robert is deleted from passwd.
The following is an example: create two users a B, password AAA, BBB, and then delete. View the password file content:
[Root @ SRC -Server websvn] # Htpasswd accesspwd Htpasswd: cannot modify file accesspwd; Use ' -C ' To create it [root @ SRC -Server websvn] # Htpasswd-C accesspwd New password: Re -Type new password: Adding Password For User [Root @ SRC -Server websvn] # Ll accesspwd -RW-r -- 1 Root 16 Jun 23 02 : 03 Accesspwd [root @ SRC -Server websvn] # Htpasswd accesspwd B New password: Re -Type new password: Adding Password For User B [root @ SRC -Server websvn] # Cat accesspwd A: Wpeqdkjinqsvmb : Jephubhzzp3fc [root @ SRC -Server websvn] # Htpasswd-D accesspwd B Deleting Password For User B [root @ SRC -Server websvn] # Cat accesspwd A:Wpeqdkjinqsvm [root @ SRC -Server websvn] #
3. sudo service httpd restart httpd apache service. It seems very simple. Come back and sort out SVN commands.
Then, you can access this repository through http: // ip/SVN/repos1 and create multiple repositories for simultaneous access. however, the repository list cannot be listed by directly accessing IP/SVN. Apache displays "forbidden \ n you don't have permission to access/SVN on this server"
Some SVN Web ManagementProgramAlso, for example, viewvc has some other web programs that manage SVN. It is best to create a repository and manage permissions on the Web end. We are currently looking for such SVN web management programs.
Install websvn in centos directly using yum. You only need PHP support without configuring MySQL.
View websvn package files
[Root @ SRC -Server ~] # Yum install websvn Loaded plugins: fastestmirror, presto, refresh- Packagekitloading mirror speeds from cached hostfile * Base: mirrors. btte. Net * Epel: ftp. kddilabs. JP * Extras: ftp.stu.edu. TW * Kernel-xen: us1.mirror. CRC. Id. Au * Updates: mirrors.tuna.tsinghua.edu. Cnsetting up install process Package Websvn- 2.3 . 3 -2 . El6. Noarch already installed and latest versionnothing Do [Root @ SRC -Server ~] # Rpm-QL websvn /Etc/httpd/CONF. d/websvn. Conf /Etc/websvn/config. PHP /Usr/share/doc/websvn- 2.3 . 3 /Usr/share/doc/websvn- 2.3 . 3 /Changes. Txt /Usr/share/doc/websvn- 2.3 . 3 / Doc /Usr/share/doc/websvn- 2.3 . 3 /Doc/install. Html /Usr/share/doc/websvn- 2.3 . 3 /Doc/style. CSS /Usr/share/doc/websvn- 2.3 . 3 /Doc/templates.Html /Usr/share/doc/websvn- 2.3 . 3 /License. Txt /Usr/share/ Websvn /Usr/share/websvn/blame. PHP /Usr/share/websvn/ Cache /Usr/share/websvn/comp. PHP /Usr/share/websvn/diff. PHP /Usr/share/websvn/dl. PHP /Usr/share/websvn/filedetails. PHP /Usr/share/websvn/Include /Usr/share/websvn/include/accessfile. PHP /Usr/share/websvn/include/auth. PHP /Usr/share/websvn/include/BugTraq. PHP /Usr/share/websvn/include/command. PHP /Usr/share/websvn/include/config. PHP /Usr/share/websvn/include/configclass. PHP /Usr/share/websvn/include/diff_inc. PHP /Usr/share/websvn/include/diff_util. PHP /Usr/share/websvn/include/ Header /Usr/share/websvn/include/setup. PHP /Usr/share/websvn/include/svnlook. PHP /Usr/share/websvn/include/template. PHP /Usr/share/websvn/include/utils. PHP /Usr/share/websvn/include/version. PHP /Usr/share/websvn/ Index . PHP /Usr/share/websvn/ Ages /Usr/share/websvn/ages/Chinese-simplified. PHP /Usr/share/websvn/ages. PHP /Usr/share/websvn/ages/ Omitted or omitted /Usr/share/websvn/listing. PHP /Usr/share/websvn/ Log . PHP /Usr/share/websvn/revision. PHP /Usr/share/websvn/RSS. PHP /Usr/share/websvn/ Temp /Usr/share/websvn/ Templates /Usr/share/websvn/templates/ Bluegrey /Usr/share/websvn/templates/bluegrey/ Omitted or omitted /Usr/share/websvn/templates/Elegant /Usr/share/websvn/templates/elegant/ Omitted or omitted /Usr/share/websvn/templates/ Calm /Usr/share/websvn/templates/calm/ Omitted or omitted /Usr/share/websvn/wsvn. PHP /Var/Cache/websvn
Below is Vim/etc/websvn/config. PHP. In fact, this file is/usr/share/websvn/include/config. PHP is just a link to the etc directory. This method is really convenient for such web programs that need to be configured.
[Root @ SRC -Server ~] # Ll/etc/websvn/config. php -RW-r -- 1 Root21210 Jun 24 18 : 48 /Etc/websvn/config. PHP [root @ SRC -Server ~] # Ll/usr/share/websvn/include/config. php Lrwxrwxrwx 1 Root 33 Jun 23 01 : 01 /Usr/share/websvn/include/config. php->.../etc/websvn/config. PHP [root @ SRC -Server ~] #
The following configuration options need to be modified:
$ Config-> parentpath ('/srv/SVN /');
$ Config-> usemultiviews ();
########### $ Config-> useauthenticationfile ('/srv/SVN/passwd '); # This is because I don't know how to log on to my account on websvn.
$ Config-> setblockrobots (); # prevent search programs from being indexed
$ Config-> expandtabsby (4); # The default 8 does not seem to fit my habits.
$ Config-> useenscript (); # syntax highlightingWe recommend that you install the GNU enscript highlighted package. Download it officially:Http://www.iki.fi /~ MTR/genscript/
# About encoding I don't know how to set up, setinputencoding does not work for my websvn-2.3.3, but websvn has a 500 error.
Modify/etc/httpd/CONF. d/websvn. conf to add basic permission authentication.
Alias/websvn/usr/share/websvn/<Directory/Usr/share/websvn/>Options Multiviews indexes directoryindex wsvn. php order allow, deny allow from all authtype basic authname "Authorization realm" authuserfile/srv/SVN/passwd require valid-user</Directory>
Websvn can be viewed online.
Section 3: modifying the htpasswd password online
Previously, Apache's htpasswd was used for account management through Base authentication. You can use this applet to add or delete the verification account and password online. It is also a small pity that the permissions for adding, deleting, and deleting are not managed. This option is available only after verification.
Http://www.cnblogs.com/mutuan/archive/2012/07/27/2611537.html
Reference: http://www.scmbbs.com/cn/svntp/2007/11/svntp1.php