Part of this article is a supplement to the installation of apache2 and subversion1.6.15 in redhat5.
1. introduced throughSource codeTo install the Subversion
We need two files: HTTP and subversion. Httpd is a web server used to access subversion through the Web. I myself use httpd-2.2.6 and subversion-1.4.5, which are:
A.download httpd-2.2.6.tar.gz
Http://httpd.apache.org/
B .download subversion-1.4.6.tar.gz
Http://subversion.tigris.org/
2. Create a user: svnroot
It is best not to involve the root user in SVN permission management and daily operation and maintenance. However, some installation and configuration operations still need to be completed by the root user, some operations can only be performed by the root user. Permission issues are important. (If the permission is incorrect, it will make you feel depressed for a long time, haha .)
3. Compile and install httpd (root user operation ):
# Tar xvzf httpd-2.2.6.tar.gz
# Cd httpd-2.2.6
#./Configure -- enable-Dav -- enable-so
-- Enable-mod-shared = all
-- Prefix =/usr/local/apache2
# Make
# Make install
Edit the configuration file httpd. conf.
# Vi/usr/local/apache2/CONF/httpd. conf
Modification content:
Servername www.example.com: 80 is
Servername localhost: 80 or the IP address of the Apache server
After installation and modification, start the Apache process:/usr/local/apache2/bin/apachectl start (or under/usr/local/apache2/bin. /httpd-K start), and then open the browser
Http: // localhost/
If there is a test page "It works! "The installation is successful.
4. Install subversion below
# Tar xvzf subversion-1.4.5.tar.gz
# Cd subversion-1.4.5
#./Configure -- With-apxs =/usr/local/apache2/bin/apxs
-- Prefix =/usr/local/Subversion -- With-Apr =/usr/local/apache2
-- With-Apr-util =/usr/local/apache2 -- With-SSL -- With-zlib
-- Enable-maintainer-Mode
# Make
# Make install
// Create the directory where the library file is located (perform the following operations for the svnroot user)
# Mkdir/home/svnroot/Repository
// Enter the bin directory of subversion
# Cd/usr/local/subversion/bin
// Create a "test" Repository
#./Svnadmin create/home/svnroot/Repository/test
// Go to the Data Warehouse "test" Directory
# Cd/home/svnroot/Repository/test
// Check if there are more files. If yes, the Subversion is successfully installed.
# Ls-l
// Do not allow others to have permission for this directory
# Chmod 700/home/svnroot/Repository
// ** Note: directly using this chmod will make the svn client inaccessible. You need to modify the Apache configuration file
Httpd. conf file:
User daemon // change daemon to svnroot to run the Apache process as svnroot.
Group daemon
// Change the preceding content:
User svnroot
Group svnroot
// Modify the svn repository owner
# Chown-r svnroot: svnroot/home/svnroot/Repository
// Modify the directory permission only available to svnroot
# Chmod 700/home/svnroot/Repository
5. Modify the Apache configuration file
# Cd/usr/local/apadche2/bin
#./Apachect1 stop // stop the Apache process
VI/usr/local/apache2/CONF/httpd. conf
// Add at the bottom. If you do not have these two modules
Loadmodule dav_svn_module modules/mod_dav_svn.so
Loadmodule authz_svn_module modules/mod_authz_svn.so
Dav SVN
Svnparentpath/home/svnroot/Repository // SVN parent directory
Authzsvnaccessfile/home/svnroot/Repository/authz. conf // permission configuration file
Authtype basic // set the connection type
Authname "clo.com.cn" // connection box prompt
Authuserfile/home/svnroot/Repository/AuthFile // user configuration file
Require valid-user // which authentication is used
// AuthFile is created through "htpasswd [-C]/home/svnroot/Repository/AuthFile Username Password". Username refers to the user svnroot and the password is also his.
// "Require valid-user" tells Apache that all users in AuthFile can access Apache. Without it, only the first user can access the new database.
// Start the apache service
#/Usr/local/apache2/bin/apachectl start
// Open your browser
Http: // localhost/SVN/test/
If something is displayed, it indicates the operation is successful.
6. permission management (configuration of authz. conf)
1) Add users
# Htpasswd [-C]/home/svnroot/Repository/AuthFile user1
// Use-C to create a new user file when setting the user for the first time. Press enter and enter the user password to add the user. At this time, you must use the root permission to add the user and then view the user and the encrypted password in The AuthFile.
# Htpasswd/home/svnroot/Repository/AuthFile username (Add a new user)
// For example, "htpasswd/home/svnroot/Repository/AuthFile user2"
2) Permission assignment (which can be handled based on your own situation or viewed on the Internet)
# Vi/home/svnroot/Repository/authz. conf
[Groups] // This indicates group settings.
Tester = test, svnroot, nbj, user1, user2 // This indicates the members in a group
# Anonymous = guest
[Test:/] // indicates the access permission under the root directory of the test warehouse.
@ Tester = RW // test the user in the tseter Group of the repository has read and write permissions.
* = All users in the r // test warehouse have the read permission.
[Document:/] // indicates the access permission under the root directory of the Repository document
@ Tester = RW // test the user in the tseter Group of the repository has read and write permissions.
# @ Anonymous = r
* = All users in the r // test warehouse have the read permission.
// Note: When editing the authz. conf file, all rows must be written at the top of the header and cannot be scaled down. Otherwise, an error is returned: "Access Denied: 'user1 '".
7. Restart the Apache process
After completing step 1, restart Apache,
#/Usr/local/apache2/bin/apachectl restart
You can use
Http: // localhost/SVN/test
Or Http: // localhost/SVN/Document
This URL is used to access the repository. Of course, only valid users are allowed to access the repository.
Can access and have corresponding permissions.
8. Memo:
1). Several permissions are involved in SVN usage: file system permissions, Linux system permissions, SVN user permissions, and Apache process permissions. File System permissions, Linux
System permissions: the same meaning is that the folder and file access permissions are usually used in Linux. In
SVN uses svnroot to create a repository, folder, and configuration file, and sets the repository permission to 700. Other users are not allowed to directly use
File System Viewing can only be managed by svnroot. Apache process permission: because all the operations transmitted with the repository are performed through the Apache process, even if you use
But the Apache process does not have the permission to access the repository or related files.
In the/usr/local/Apache/CONF/httpd. conf file, find the two lines in the file:
User daemon # Change daemon to svnroot to run the Apache process as svnroot.
Group daemon
SVN User Permissions: the permissions set in the authz. conf file are used by SVN to manage repository access permissions.
2) After the system is started, the apache service is automatically started.
Edit etc/rc. d/rc. Local
# Vi/etc/rc. d/rc. Local
Add the following sentence:/usr/local/apache2/bin/apachectl start.
9. Client tortoisesvn Installation
The client I use is a TortoiseSVN-1.5.0.12222-alpha1-win32-svn-1.5.0-alpha2 and a LanguagePack_1.5.0.12222-alpha1-win32-zh_CN, and its usage can be found in the documentation:
Http://www.subversion.org.cn/tsvndoc/
Install it directly and restart the computer.