installation
sudo apt-get install subversion apache2 LIBAPACHE2-SVN
Add a group and www-data this Apache member into the group
sudo addgroup subversion sudo usermod-g subversion-a www-data
Create SVN warehouse
Cd/home sudo mkdir svn sudo chown-r www-data:subversion svn sudo chmod-r g+rws svn sudo svnadmin create/home/svn sudo Chmod-r 777/HOME/SVN
Configuring the Apache server
sudo vim/etc/apache2/mods-available/dav_svn.conf
Add the following:
<LOCATION/SVN > DAV svn svnpath/home/svn authtype Basic authname "Welcome to Subversion repository" authuserfile/ ETC/SUBVERSION/PASSWD #<limitexcept get PROPFIND OPTIONS report> Require valid-user #</limitexcept> </ Location>
If you need user password authentication every time a user logs on, please comment out <limitexcept get PROPFIND OPTIONS report> and </LimitExcept> two lines.
When you add the above content, you must restart the Apache 2 Web server, enter the following command:
Sudo/etc/init.d/apache2 restart
to add a new user:
First user
sudo htpasswd-c/etc/subversion/passwd rjying
The second user does not use the-C option, or it will overwrite the password file
sudo htpasswd-c/etc/subversion/passwd rjying1
user Self-modifying password:
Install the PHP server and modify the/etc/apache2/httpd.conf file
<location/> AuthName "Please input username and password" authtype Basic authuserfile/etc/subversion/passwd Requir E Valid-user </Location>
The PHP script is as follows:
? $username = $_server["Php_auth_user"]; After the AuthType Basic authentication user name $authed _pass = $_server["PHP_AUTH_PW"]; AuthType Basic Certified password $input _oldpass = (isset ($_request["Oldpass"])? $_request["Oldpass"]: ""); The original password entered from the interface $newpass = (isset ($_request["Newpass"])? $_request["Newpass"]: ""); The new password entered on the interface $repeatpass = (isset ($_request["Repeatpass"])? $_request["Repeatpass"]: ""); The duplicate password entered on the interface $action = (Isset ($_request["action")? $_request["Action"]: ""); The action if ($action!= "Modify") that is submitted to the server in hide {$action = "view";} else if ($authed _pass!= $input _oldpass) {$action = " Oldpasswrong "; else if (empty ($newpass)) {$action = "passempty";} else if ($newpass!= $repeatpass) {$action = "passnotsame";} else{$act Ion = "Modify"; }?>