Install and configure Apache + SVN + PHP + svnmanager in Windows

Source: Internet
Author: User

Install and configure Apache + SVN + PHP + svnmanager in Windows

1. Download Required Software
Apache: http://www.apache.org
Subversion: http://subversion.tigris.org
PHP: http://www.php.net
Php pear (with versioncontrol_svn): http://pear.php.net
Svnmanager http://svnmanager.sourceforge.net/

Ii. Install Configuration Software
1. Install apache2

2. Install the subversion and configure it as follows:
1). Copy bin/mod_dav_svn.so and bin/mod_authz_svn.so to the Apache modules directory.
2). Add the Subversion/bin directory to the system path and reboot so all the Subversion support DLL's are visible to the apache service.
3). Edit the Apache configuration file (httpd. conf) and make the following changes:

3A. uncomment the following two lines:

# Loadmodule dav_fs_module modules/mod_dav_fs.so
# Loadmodule dav_module modules/mod_dav.so

3B. Add the following two lines to the end of the loadmodule section:

Loadmodule dav_svn_module modules/mod_dav_svn.so
Loadmodule authz_svn_module modules/mod_authz_svn.so

3c. Add the following to end of the file. Note: This location directive is
Minimal example with no authentication directives. For other options,
Especially authentication options, see the Subversion Install file,
The Subversion book, or the tortoisesvn manual.

<Location/SVN>
Dav SVN
Svnpath your/Repository/path
</Location>

<Location/SVN>
Dav SVN

# Repository folders location (make sure this folder exists
# And keep location in mind)
Svnpath/srv/SVN/Repos

Authtype basic
Authname "restricted access"

# File will be created by svnmanager, keep location in mind!
Authuserfile/srv/SVN/htpasswd

Require valid-user
# Sslrequiressl

# File will be created by svnmanager, keep location in mind
Authzsvnaccessfile/srv/SVN/accessfile

</Location>

3. install PHP (Note: If apache2 is used as the Web server, you need to download the thread safe version for installing PHP. If SQLite is used as the database during installation, choose SQLite extension during installation) and perform the following Configuration:
1). You need to insert the following lines into your Apache httpd. conf configuration file to load the PHP module for Apache 2.x:

#
Loadmodule php5_module "C:/PHP/php5apache2. dll"
Addhandler application/X-httpd-PHP. php

# Configure the path to PhP. ini
Phpinidir "C:/PHP"

4. Install versioncontrol_svn
Before installing versioncontrol_svn, install pear: Find the go-pear.bat under the PHP installation directory, run it, enter in the installation process, and then double-click the pear_env.reg generated under the PHP Directory to write the registration information to the Registry. Run cmd to the PHP installation directory and enter the command pear install -- alldeps versioncontrol_svn for automatic installation. You can also download the VersionControl_SVN-0.3.1.tgz and XML_Parser-1.3.2.tgz directly to movie/pear.php.net/package/xml_parser/download/allindividually, and then copy the two files to the PHP installation directory, CMD to the PHP installation directory, enter the command pear install XML_Parser-1.3.2.tgz and pear install VersionControl_SVN-0.3.1.tgz for installation. I chose the latter.

5. Install svnmanager

Finally, you will have to download and install the svnmanager package and copy the contents to your web directory (defined in your Apache configuration

The 'documentroot' tag). You'll have to make changes to the config. PHP configuration file. first make a copy of config. php. Linux or config. php. Win to start

With and open the file in your favorite editor.

* Specify the locale settings. You can get a list of available options when you enter 'locale-a' in a terminal window.
$ Lang = "en_US.UTF-8 ";
* Specify the locations of the needed shell commands: 'htpasswd' or 'htpasswd2 ', 'svn' and 'svnadmin'. One can locate such files with the command

'Whereis ', e.g. (in a terminal window) 'whereis htpasswd '.
$ Htpassword_cmd = "/usr/bin/htpasswd ";
$ Svn_cmd = "/usr/bin/SVN ";
$ Svnadmin_cmd = "/usr/bin/svnadmin ";
* Specify a subversion config Dir, where the Subversion tools will store configuration data. Next, specify the locations of the Repository directory and

The config files, as previusly configured in Apache. You have to make these locations Manual: 'mkdir/srv/svnconfig/srv/SVN/repos'. If you please, you

Cocould make empty files for the htpasswd and Access File: 'touch/srv/SVN/htpasswd/srv/SVN/accessfile'. Important: You must give ownership to these files and

Directories to the user than runs Apache, e.g. 'www-data', by calling' chown-r www-data.www-data/srv/svnconfig/srv/SVN '.
$ Svn_config_dir = "/srv/svnconfig ";
$ Svn_repos_loc = "/srv/SVN/repos ";
$ Svn_passwd_file = "/srv/SVN/htpasswd ";
$ Svn_access_file = "/srv/SVN/accessfile ";
* Although dangerous, svnmanager has the option to delete repositories remotely. To reduce danger and have an extra catch for your users, you can specify

A trash folder location. Then, repositories will not be deleted but moved to the specified location. If you don't specify this, repositories will be removed

For ever! Just as the repository location, you shoshould make this directory yourself: 'mkdir/srv/SVN/trash; chown www-data.www-data/srv/SVN/trash '.
$ Svn_trash_loc = "/srv/SVN/trash ";
* Although not specified (and not recommend), svnmanager can also generate svnserve user files. This requires usernames and password to be stored in

Plain text. If you don't specify this option, this will not happen. From the moment you configure this option, svnmanager starts storing username and

Password in plain text, and will generate a svnserver password file at the specified location.
$ Svnserve_user_file = "";
* Next, you must configure a smpt server. This is necessary for the email-Invitation function of svnmanager. svnmanger will send email from

'Svnmanager @ smtp-server.net '.
$ Smtp_server = "smtp-server.net ";
* Another important configuration option is the data source name of the database that is going to be used with svnmanager. As explained, svnmanager will

Try to create tables at first startup. This has been tested with SQLite and MySQL databases. When you specify a SQLite database, it is wise to store it

Somewhere outside the document root folder, or make sure that Apache can't read the specified location (e.g. By means of A. htaccess file containing 'Deny

From all '):
$ DSN = "SQLite: // svnmanager/svnmanager. DB ";

Make sure that this location is not accessible from the outside (test this )!! This can happen when you choose the example location and Apache is

Configured to ignore. htaccess files.
An MySQL example, according to the example database, with PHP's mysqli module:
$ DSN = "mysqli: // svnmanager: Secret @ localhost/svnmanager ";
* Because the database starts empty, you'll have to specify an administrator username and password to begin with. As soon as you have created an admin

Account in svnmanager, this configured account will not work anymore.
$ Admin_name = "admin ";
$ Admin_temp_password = "admin ";
* For more advanced deployments, it is possible to define a script that will be executed after the creation of a repository. You can use such a script

To Setup hooks or additional repository functionality. This script will get the absolute location of the new repository as parameter. When this configuration

String is not specified, nothing will happen.
$ Post_create_script = "newrepo-script ";

After grouping, you can start svnmanager by opening the specified location in a Web-browser. The first time you'll start svnmanager the database tables

Will be created. The second time you can login by means of the configured credentials. Please start with creating a safe new Administrator account, and re-

Login into that new account.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.