1: download Websvn
2: unpackage websvn and move it to the apache Web root folder, rename it to svn (e.g., /var/www/svn). Here, please remove the version number (after you unpackage it, you will get something like websvn3.2.6).
3: copy the configuration file
$cd /var/www/websvn/include
$sudo cp distconfig.php config.php
4: open and edit the config.php.
find the following lines:
$config->addTemplatePath($locwebsvnreal.'/templates/calm/'); $config->addTemplatePath($locwebsvnreal.'/templates/BlueGrey/'); $config->addTemplatePath($locwebsvnreal.'/templates/Elegant/');
and add the following line to indicate the default template to use:
$config->setTemplatePath($locwebsvnreal.'/templates/calm/');
5: add the following lines just before the last lines: (the objective is to tell websvn where to get the data of svn)
$config->parentPath("/media/datadrive/svn"); //you can have a parent path, //or add another entry by using the following line: //$config->addRepository("Empty Nest", "file:///media/datadrive/svn/emptynest"); $config->setEnscriptPath("/usr/bin"); $config->setSedPath("/bin"); $config->useEnscript();
6: now, when you open your browser, and go to:
localhost/svn
you will be able to view svn directory.
7: However, everyone in the LAN can access to the content of svn by entering the above-mentioned URL address. The next step is to add authorization. First, create a pass word file.
$touch /etc/apache2/dav_svn.passwd
Then, use the following command to create a user:
$sudo htpasswd /etc/apache2/dav_svn.passwd user1 New password: Re-type new password: Adding password for user user1
8: Then, open the file etc/apache2/dav_svn.passwd, you can see some like this:
user1:$apr1$PYPG.CQv$4AkadaxTsdfwBmrx6uVOK0
9: Of course, you can add more users by using the same command.
10: Then, open the apache configuration file:
$sudo vim /etc/apache2/sites-enabled/000-default
then, add the following lines:
<Location /svn>
AuthType Basic
AuthName "Subversion repository"
AuthUserFile /etc/apache2/dav_svn.passwd
Require valid-user
</Location>
Save the file.
11: restart apache:
$sudo service apache2 restart
[sudo] password for wcg1sgh:
* Restarting web server apache2 apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.1.1 for ServerName
... waiting apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.1.1 for ServerName
[ OK ]
12: Open the browser, and enter localhost/svn, and a username and password is demanded.
Done!
2: unpackage websvn and move it to the apache Web root folder, rename it to svn (e.g., /var/www/svn). Here, please remove the version number (after you unpackage it, you will get something like websvn3.2.6).
3: copy the configuration file
$cd /var/www/websvn/include
$sudo cp distconfig.php config.php
4: open and edit the config.php.
find the following lines:
$config->addTemplatePath($locwebsvnreal.'/templates/calm/'); $config->addTemplatePath($locwebsvnreal.'/templates/BlueGrey/'); $config->addTemplatePath($locwebsvnreal.'/templates/Elegant/');
and add the following line to indicate the default template to use:
$config->setTemplatePath($locwebsvnreal.'/templates/calm/');
5: add the following lines just before the last lines: (the objective is to tell websvn where to get the data of svn)
$config->parentPath("/media/datadrive/svn"); //you can have a parent path, //or add another entry by using the following line: //$config->addRepository("Empty Nest", "file:///media/datadrive/svn/emptynest"); $config->setEnscriptPath("/usr/bin"); $config->setSedPath("/bin"); $config->useEnscript();
6: now, when you open your browser, and go to:
localhost/svn
you will be able to view svn directory.
7: However, everyone in the LAN can access to the content of svn by entering the above-mentioned URL address. The next step is to add authorization. First, create a pass word file.
$touch /etc/apache2/dav_svn.passwd
Then, use the following command to create a user:
$sudo htpasswd /etc/apache2/dav_svn.passwd user1 New password: Re-type new password: Adding password for user user1
8: Then, open the file etc/apache2/dav_svn.passwd, you can see some like this:
user1:$apr1$PYPG.CQv$4AkadaxTsdfwBmrx6uVOK0
9: Of course, you can add more users by using the same command.
10: Then, open the apache configuration file:
$sudo vim /etc/apache2/sites-enabled/000-default
then, add the following lines:
<Location /svn>
AuthType Basic
AuthName "Subversion repository"
AuthUserFile /etc/apache2/dav_svn.passwd
Require valid-user
</Location>
Save the file.
11: restart apache:
$sudo service apache2 restart
[sudo] password for wcg1sgh:
* Restarting web server apache2 apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.1.1 for ServerName
... waiting apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.1.1 for ServerName
[ OK ]
12: Open the browser, and enter localhost/svn, and a username and password is demanded.
Done!
Aucun commentaire:
Enregistrer un commentaire