Windows Server2012R2 VisualSVN3.9.7-Server online password modification

Keywords: Windows PHP svn Apache

After verification, upgrade from 3.0.0 to 3.9.7 in the following way. At the same time, support users to change passwords through the web interface. Every user forgets his password and needs the administrator to change it. The workload is not large, but it's really time-consuming and laborious. It's not flattering!
1. Installation software preparation
1.1. Software preparation
1) . Windows Server 2008 R2 operating system
2). VisualSVN-Server-3.9.7-x64.msi
https://www.visualsvn.com/server/changes/ SVN server (server installation package)
3). TortoiseSVN-1.13.1.28686-x64-svn-1.13.0.msi
https://tortoisesvn.net/downloads.html svn client (PC installation package)
4). LanguagePack_1.13.1.28686-x64-zh_CN.msi
https://tortoisesvn.net/downloads.html Chinese package of TortoiseSVN (PC installation)
5). httpd-2.4.43-o111g-x64-vc15.zip
https://www.apachehaus.com/cgi-bin/download.plx
Apache server installation package
6). php-7.3.18-Win32-VC15-x64.zip
https://windows.php.net/download/ Server installation package
1.2. Precautions
The path and password of the installation process shall not appear Chinese, special characters or less than 8-digit passwords as far as possible;
The disk space of the installation path meets the software business requirements.
1.3. Installation description
1 > visualsvn-server-3.9.7-x64.msi (svn server)
2 > tortoisesvn-1.13.1.28686-x64-svn-1.13.0.msi (SVN client)
 3> LanguagePack_ 1.13.1.28686-x64-zh_ CN.msi (Chinese package of TortoiseSVN)
4 > httpd-2.4.43-o111g-x64-vc15.zip (extract htpasswd.exe File)
5 > php-7.3.18-win32-vc15-x64.zip (integration of SVN and PHP)
2. Visual SVN version upgrade (old 3.0.0 -- new 3.9.7)
Step 1: stop VisualSVN Server service
Step 2: backup the old versions of Repositories folder and VisualSVN Server folder to the path C:\bak \
Path: C:\Repositories
Path: C:\Program Files\VisualSVN Server
Step 3: Download and install the new version of VisualSVN-Server-3.9.7-x64.msi
The installation process is described as follows:
Double click the VisualSVN-Server-3.9.7-x64.msi installation package and click "Next";
Check the authorization permission and click "Next";
The software will automatically identify that the current system has been installed with version 3.0.0, prompt to click the upgrade operation to upgrade the software to VisualSVN-Server 3.9.7, and click "upgrade";


Step 4: configure online self-service password modification and construction according to the content of Chapter 3
Step 5: start VisualSVN Background Job Service and VisualSVN Server service
Step 6: log in to test whether the user password is correct, whether the user authority is normal, and whether the user modifies the password is normal
3. Apache and PHP configuration
3.1. Extract Apache password management tool
1) Unzip the package httpd-2.4.43-o111g-x64-vc15.zip
2) Extract htpasswd.exe The file is placed in the path of VisualSVN Server\bin (the path is operated according to the actual deployment). This article will operate as follows
C: software \ httpd-2.4.43-o111g-x64-vc15 \ apache24 \ bin\ htpasswd.exe
Copy to C:\Program Files\VisualSVN Server\bin\
3.2. Configure PHP
1) Download php7.3 (Note: Download Thread Safe version)
2) Unzip php-7.3.18-Win32-VC15-x64.zip to the installation path of VisualSVN Server (the path should be operated according to the actual deployment). This article will operate as follows
Unzip and rename it to php. The final php path is C:\Program Files\VisualSVN Server\php
3.3. Configure httpd-custom.conf file
Modify httpd-custom.conf The configuration file (the path is based on the actual deployment). This article follows the instructions below
Modify the empty file C:\Program Files\VisualSVN Server\conf\httpd-custom.conf
Configure the following

#php7 support
PHPIniDir "C:/Program Files/VisualSVN Server/php"
LoadModule php7_module "C:/Program Files/VisualSVN Server/php/php7apache2_4.dll"
AddType application/x-httpd-php .php .html .htm
#configure the path to php.ini

3.4. NEW index.php
Create a new pw folder in the path of \ VisualSVN Server\htdocs, and create a new one in the pw folder index.php File (the path is operated according to the actual deployment). In this paper, the path is as follows
Create a new C:\Program Files\VisualSVN Server\htdocs\pw\index.php file

Configure the following
<?php
$username = $_SERVER["PHP_AUTH_USER"]; //AuthType Basic authenticated user name
$authed_pass = $_SERVER["PHP_AUTH_PW"]; //AuthType Basic authenticated password
$input_oldpass = (isset($_REQUEST["oldpass"]) ? $_REQUEST["oldpass"] : ""); //The original password entered from the interface
$newpass = (isset($_REQUEST["newpass"]) ? $_REQUEST["newpass"] : ""); //New password entered on the interface
$repeatpass = (isset($_REQUEST["repeatpass"]) ? $_REQUEST["repeatpass"] : ""); //Duplicate password entered on the interface
$action = (isset($_REQUEST["action"]) ? $_REQUEST["action"] : ""); //Actions submitted to the server in hide mode

if ($action!="modify") {
    $action = "view";
} else if ($authed_pass!=$input_oldpass) {
    $action = "oldpasswrong";
} else if (empty($newpass)) {
    $action = "passempty";
} else if ($newpass!=$repeatpass) {
    $action = "passnotsame";
} else{
    $action = "modify";
}
?>

<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=GBK">
    <title>Subversion Online self service password modification</title>
</head>
<body>

<?php
//action=view display general input information
if ($action == "view") {
?>
<script language = "javaScript">
<!--
function loginIn(myform) {
    var newpass=myform.newpass.value;
    var repeatpass=myform.repeatpass.value;

    if (newpass=="") {
        alert("Please input a password!");
        return false;
    }

    if (repeatpass=="") {
        alert("Please input the password again!");
        return false;
    }

    if (newpass!=repeatpass) {
        alert("The two passwords are inconsistent, please re-enter!");
        return false;
    }
return true;
}
//-->
</script>

<style type="text/css">
<!--
    table {
        border: 1px solid #CCCCCC;
        background-color: #f9f9f9;
        text-align: center;
        vertical-align: middle;
        font-size: 9pt;
        line-height: 15px;
    }
    th {
        font-weight: bold;
        line-height: 20px;
        border-top-width: 1px;
        border-right-width: 1px;
        border-bottom-width: 1px;
        border-left-width: 1px;
        border-bottom-style: solid;
        color: #333333;
        background-color: f6f6f6;
    }
    input{
        height: 18px;
    }
    .button {
        height: 20px;
    }
-->
</style>

<br><br><br>
<form method="post">
<input type="hidden" name="action" value="modify"/>
<table width="220" cellpadding="3" cellspacing="8" align="center">
<tr>
<th colspan=2>Subversion Password modification</th>
</tr>
<tr>
<td>user name:</td>
<td align="left"> <?php echo $username?></td>
</tr>
<tr>
<td>Original password:</td>
<td><input type=password size=12 name=oldpass></td>
</tr>
<tr>
<td>User password:</td>
<td><input type=password size=12 name=newpass></td>
</tr>
<tr>
<td>Confirm password:</td>
<td><input type=password size=12 name=repeatpass></td>
</tr>
<tr>
<td colspan=2>
<input onclick="return loginIn(this.form)" class="button" type=submit value="Modification">
<input name="reset" type=reset class="button" value="Cancel">
<input onclick="window.location.href='/'" class="button" type="button" value="return">
</td>
</tr>
</table>
</form>
<?php
} else if ($action == "oldpasswrong") {
    $msg="Original password error";
} else if ($action == "passempty") {
    $msg="Please enter a new password";
} else if ($action == "passnotsame") {
    $msg="The two passwords are inconsistent, please re-enter";
} else {
    $passwdfile="C:\Repositories\htpasswd";
    $command='"C:\Program Files\VisualSVN Server\bin\htpasswd.exe" -b '.$passwdfile." ".$username.' "'.$newpass.'"';
    system($command, $result);
    if ($result==0) {
        $msg_succ="user[".$username."]The password has been modified successfully. Please log in with the new password";
    } else {
        $msg="user[".$username."]Password modification failed, return value is".$result.",Please contact the administrator";
    }
}

if (isset($msg_succ)) {
?>
<script language="javaScript">
<!--
alert("<?php echo $msg_succ?>");
window.location.href="/"
//-->
</script>
<?php
} else if (isset($msg)) {
?>
<script language="javaScript">
<!--
alert("<?php echo $msg?>");
window.location.href="<?php echo $_SERVER["PHP_SELF"]?>"
//-->
</script>
<?php
}
?>
</body>
</html>
index.php

3.5. Add the link to change password
Modify the file C:\Program Files\VisualSVN Server\WebUI\index.html

#The original configuration is as follows
    <footer>
  Powered by <a href="https://www.visualsvn.com/server/">VisualSVN Server</a>. © 2019 VisualSVN Software Ltd.
  </footer>

#Change to the new configuration as follows
  <footer id="footer">Powered by <a href='https://www.visualsvn.com/server/'>VisualSVN Server</a> | <a href='https://www.visualsvn.com/go/2197/'>Report a problem
    <br /><br /><a href="/pw/index.php">Online self service password change</a>
  </footer>

Restart VisualSVN Background Job Service and VisualSVN Server service

3.6. Change password
Visit svn's web page http://IP:2443/svn, log in to svn server according to the assigned account
Click "online self-service password modification" at the bottom of the web page to jump to the password modification interface

User name is automatically filled in. Please fill in the old password corresponding to the user name, fill in the new password, and click Modify to complete the password modification

Complete password modification and click OK to return to login interface

4. Error reporting during installation
The following error occurs when starting the VisualSVN HTTP Service

The solution is as follows:
Httpd needs to be checked in accordance with section 5- custom.conf Documents and index.php Path to configuration in file
When installing VC + +, you will be prompted that the installation fails:

The solution is as follows:
Note: the system requirement of windows server 2008 R2 is to update the system to SP1 (if the following KB2999226 patch is not installed for SP1, an error will occur)
Method 1: open the system update program and update to the latest version;
Method 2: update the system version to windows server 2008 R2 SP1 by downloading the installation patch
Here's how to update the system to SP1:
(1) The patch code for downloading Windows server 2008 R2 SP1 is KB976932
Link: https://www.microsoft.com/zh-cn/download/details.aspx?id=5842
(2) Install the KB976932 patch. If you are prompted to restart the operating system, please restart it
(3) Try installing vc_redist.x64.exe and vc_redist.x86.exe
Link: https://www.microsoft.com/zh-cn/download/details.aspx?id=48145
(4) If the installation fails, continue to download the patch code: KB2999226
Link: https://www.microsoft.com/zh-CN/download/details.aspx?id=49062
If the patch is successfully installed, repeat step 3.
(5) Add: if you need to install the. net framework environment, you can do the following
In the server manager, select "add function role", then check "application server", check. net framework, and press the next step to complete the installation of. net environment.
5. Attachments and remarks
Corresponding storage path of accessories and accessories:
\VisualSVN Server\conf

\VisualSVN Server\htdocs\pw

\VisualSVN Server\WebUI
Notes
When the path of the newly deployed environment is different from that of this article, httpd-custom.conf And index.php Attachment, please check and modify the path consistent with the actual environment to avoid the environment cannot be used.
 httpd-custom.conf Files need to check the path where php calls apache library files
C:/Program Files/VisualSVN Server/php/php7apache2_4.dll
 index.php File please check the path of warehouse password authentication and the path of changing password file calling apache
C:\Repositories\htpasswd
C:\Program Files\VisualSVN Server\bin\htpasswd.exe

Posted by many_pets on Wed, 27 May 2020 02:22:54 -0700