GNU/Linux >> Linux Esercitazione >  >> Debian

Installa Apache SVN (Subversion) su Debian 9 / Ubuntu 16.04

Sovversione , noto anche come SVN, un sistema di controllo della versione open source. Viene utilizzato per tenere traccia del file sorgente e dei documenti.

Ogni volta che modifichi, aggiungi o elimini un file o una cartella che controlli con Subversion, esegui il commit di queste modifiche nel repository Subversion, che crea una nuova revisione nel repository che riflette queste modifiche.

Ogni volta che lo desideri, puoi sempre tornare indietro, guardare e ottenere i contenuti delle revisioni precedenti.

Questo post ti aiuta a configurare SVN su Debian 9 / Ubuntu 16.04 .

Passa all'utente root.

su -

O

sudo su -

Installa server web

aggiorniamo prima l'indice del repository.

apt-get update

Qui installeremo server Apache per l'accesso al server SVN tramite URL HTTP.

apt-get install -y apache2 apache2-utils

Consenti Apache attraverso il firewall (se applicabile).

ufw allow 80/tcp
ufw reload

Verifica il servizio Apache visitando l'URL sottostante.

http://tuo.ip.add.dress

Dovresti ottenere la pagina predefinita di Apache2.

Installa Subversion

Una volta installato Apache, puoi emettere il seguente comando per installare la sovversione di Apache.

### debian ###

apt-get install -y subversion subversion-tools libapache2-mod-svn

### ubuntu ###

apt-get install -y subversion subversion-tools libapache2-mod-svn libapache2-svn

Configura Subversion

Una volta completata l'installazione, crea un repository secondo le tue esigenze. Qui sto creando /var/lib/svn come base e creerò un repository "testrepo".

mkdir /var/lib/svn

Crea il repository chiamato “testrepo”

svnadmin create /var/lib/svn/testrepo

Modifica l'autorizzazione del repository per consentire ad Apache di leggere e scrivere dati su di esso.

chown -R www-data:www-data /var/lib/svn/testrepo/

Configura host virtuale in Apache.

nano /etc/apache2/mods-enabled/dav_svn.conf

Inserisci il seguente contenuto.

<Location /svn>
 DAV svn
 SVNParentPath /var/lib/svn
 AuthType Basic
 AuthName "Subversion Repository"
 AuthUserFile /etc/apache2/dav_svn.passwd
 Require valid-user
</Location>

Creare un file di password per l'utente. Sostituisci raj con il tuo nome utente .

htpasswd -cm /etc/apache2/dav_svn.passwd raj

Riavvia il server Apache.

systemctl restart apache2

Verifica sovversione

Accedi all'SVN utilizzando un browser , l'URL sarà

http://your-ip-add.ress/svn/testrepo

Ti verrà chiesto di inserire nome utente e password.

Dopo l'accesso, il contenuto sarà elencato come di seguito.

Crea una directory chiamata "checkout"

mkdir checkout

Controlla i file contenuti all'interno del repository nella directory di test. Sostituisci raj con il tuo nome utente .

svn checkout http://192.168.1.10/svn/testrepo --username raj checkout/

L'output sarà come di seguito.

Authentication realm: <http://192.168.1.10:80> Subversion Repository
Password for 'raj': **** <-- Enter Password


-----------------------------------------------------------------------
ATTENTION!  Your password for authentication realm:

   <http://192.168.1.10:80> Subversion Repository

can only be stored to disk unencrypted!  You are advised to configure
your system so that Subversion can store passwords encrypted, if
possible.  See the documentation for details.

You can avoid future appearances of this warning by setting the value
of the 'store-plaintext-passwords' option to either 'yes' or 'no' in
'/root/.subversion/servers'.
-----------------------------------------------------------------------
Store password unencrypted (yes/no)? yes <-- Store Password
Checked out revision 0.

Crea file di test per il commit nel repository testrepo.

cd checkout/
touch checkout1.txt
touch checkout2.txt

Aggiungi i file creati per il commit.

svn add checkout1.txt checkout2.txt

Risultato:

A checkout1.txt
A checkout2.txt

Conferma i file aggiunti. Puoi menzionare il messaggio di commit con un flag -m.

svn commit -m 'First Revision'

Risultato:

Adding checkout1.txt
Adding checkout2.txt
Transmitting file data ..
Committed revision 1.

Puoi visualizzare i file salvati in un browser.

È tutto. Puoi utilizzare client SVN come TortoiseSVN per Windows e Rapidsvn per Linux.


Debian
  1. Come installare Apache Maven su Debian 10

  2. Come installare Apache Hadoop su CentOS 7, Ubuntu 18.04 e Debian 9

  3. Come installare Apache Cassandra su Ubuntu 18.04 / Ubuntu 16.04 e Debian 9

  4. Come installare Subversion 1.9 su Ubuntu e Debian

  5. Come installare Subversion (SVN) 1.8.15 su Ubuntu e Debian

Come installare Apache Subversion su Debian 9

Come installare Apache Subversion su Debian 11

Come installare Apache SVN su Ubuntu 14.04

Come installare Subversion su Ubuntu 16.04

Come installare Apache Subversion su Ubuntu 20.04 LTS

Come installare Apache Subversion su Ubuntu 18.04