How to install SVN server with USVN, Apache, mod_dav_svn on CentOS 6
2015-03-04 17:29
1166 查看
How
to install SVN server with USVN, Apache, mod_dav_svn on CentOS 6
July31, 2014
Eugene
Vlasov
Introduction
Apache Subversion (SVN) is an open source version control system. It is used by developers to maintain versions of files such as source code, documents, web pages etc.USVN stands for User-Friendly SVN. It is a web interface written in PHP used to configure subversion repositories. Its goal is to eliminate using command line interface for creation of new SVN projects and users.
In this guide we will install SVN server with Apache, mod_dav_svn and USVN web interface for user and repository management.
We can install SVN on your VPS or dedicated server just for $40. Click
here too order SVN server installation service.
Step 1: Install Basic Packages
We will install LAMP, additional module for Apache (mod_dav_svn), Subversion and several useful utilities like (wget and unzip).We use the following software versions:
- Apache/2.2.15
- PHP 5.3.3
- mysql,version 5.1.73
- svn, version 1.6.11
- USVN, version: 1.0.7
1 | [root@]# yum install httpd php mysql-server mod_dav_svn subversion wget unzip |
1 2 | [root@]# chkconfig httpd on [root@]# chkconfig mysqld on |
Step 2: Create System User for USVN
1 2 3 4 5 6 | [root@]# useradd -m -d /home/usvnuser -s /sbin/nologin usvnuser [root@]# passwd usvnuser Changing password for user usvnuser. New password: ****** Retype new password: ****** passwd: all authentication tokens updated successfully. |
Step 3: Download and Install USVN Code
1 2 3 4 5 6 7 | [root@]# cd /home/usvnuser/ [root@]# mkdir public_html [root@]# wget https://github.com/usvn/usvn/archive/master.zip [root@]# unzip master.zip [root@]# cp -rp /home/usvnuser/usvn-master/src/* /home/usvnuser/public_html/ [root@]# rm -rf /home/usvnuser/usvn-master [root@]# chown -R usvnuser:usvnuser /home/usvnuser/ |
1 | [root@]# gpasswd -a apache usvnuser |
Step 4: Disable SELinux
1 2 | [root@]# vi /etc/selinux/config SELINUX=disabled |
Step 5: Configure Apache Virtual Host for USVN
Edit apache configuration file and put VirtualHost config for USVN there. Replace usvn.example.com with your domain.1 | [root@]# vi /etc/httpd/conf/httpd.conf |
1 2 3 4 5 6 7 8 9 10 11 12 13 | <Virtualhost *:80> ServerAdmin some@host.example.com DocumentRoot /home/usvnuser/public_html/public ServerName usvn.myexample.com ServerAlias www.usvn.myexample.com ErrorLog /var/log/httpd/usvn.myexample.com.error_log CustomLog /var/log/httpd/usvn.myexample.com.access_log common <Directory /home/usvnuser/public_html/public> AllowOverride All Order allow,deny Allow from all </Directory> </VirtualHost> |
1 | [root@]# /etc/init.d/httpd restart |
1 | [root@]# vi /home/usvnuser/public_html/app/bootstrap.php +72 |
1 | //exit(0); |
1 | exit(0); |
everything is configured correctly you will see the setup wizard:
Step 6: Follow USVN Installation Wizard
Select your language and time zone:
Accept the CeCILL FREE SOFTWARE LICENSE:
Create directory named “files” in /home/usvnuser/public_html/, change owner to “usvnuser” and set 777 permissions to allow Apache write access to that directory.
1 2 3 | [root@]# mkdir /home/usvnuser/public_html/files/ [root@]# chown usvnuser:usvnuser /home/usvnuser/public_html/files/ [root@]# chmod 777 /home/usvnuser/public_html/files/ |
Step 7: Database Configuration
Login to mysql console as root, create new user, database and grant user privileges to access database:1 2 3 4 5 | [root@]# mysql -uroot –p****** mysql> CREATE DATABASE usvn_db; mysql> CREATE USER 'usvn_us'@'localhost' IDENTIFIED BY '******'; GRANT ALL PRIVILEGES ON usvn_db.* to usvn_us@localhost; quit |
Create administrator account and setup password for it:
Choose whether you want USVN to checks for updates:
Copy and paste following lines at the end of your httpd.conf:
Add code below to the end of httpd.conf:
1 | [root@]#vi /etc/httpd/conf/httpd.conf |
1 2 3 4 5 6 7 8 9 10 11 | <location /svn/> ErrorDocument 404 default DAV svn Require valid-user SVNParentPath /home/usvnuser/public_html/files/svn SVNListParentPath off AuthType Basic AuthName "USVN" AuthUserFile /home/usvnuser/public_html/files/htpasswd AuthzSVNAccessFile /home/usvnuser/public_html/files/authz </Location> |
1 | [root@]#/etc/init.d/httpd restart |
Step 8: Creating Your First Repository
Login as admin at http://usvn.myexample.com/login/ Go to “Admin” >>> “Users” and create new user account (for example “test_user”):
Create new Project (for example “test_proj”):
Grant “test_user”access to the “test_proj” project. Go to “Admin” >>> “Groups”:
and click the selection:
In drop-down menu choose ”test_user” account and add it:
After those steps, you can try to access SVN repository using SVN client. I will be using SyncroSVN client.
Step 9: Accessing Repository via SVN client
Open Syncro SVN Client, go to the “Repository” >>> “New Repository Location…”Repository URL is: http://usvn.myexample.com/svn/test_proj/trunk
Click OK and enter SVN username and password created above:
If all goes well, you will be connected to the repository:
Now you can try to upload some files into the repository. Go to the “Repository” >>> “Import” >>> “Import Folder Content …”:
You can monitor upload progress at “Console” tab. If everything is OK you will see “Operation successful” message:
相关文章推荐
- How to install Apache Server on CentOS RedHat Linux, How to configure Apacahe Server on CentOS RedHat Linux | Antoine Solutions Development
- How to Install PHP 7 with Apache and MariaDB on CentOS 7/Debian 8
- How to Install LAMP (Apache 2.4, MySQL 5.6, and PHP 5.4) on CentOS/RHEL 7
- How To Install Drupal on a Virtual Server Running CentOS 6
- How to Install HTTP Git Server With Nginx on Ubuntu 16.04
- How to Install Linux, Apache, MySQL, PHP (LAMP) stack on CentOS 6
- How To Install Apache Tomcat 7 on CentOS 7 via Yum
- How to Install Linux, Apache, MySQL, PHP (LAMP) stack on CentOS 6 【Reliable】
- How to Install Apache Tomcat 8 (on Windows, Mac OS X, Ubuntu) and Get Started with Java Servlet Prog
- How to Install Apache CouchDB on CentOS 6 (from Source and EPEL)
- How to Install Apache Kafka on CentOS 7
- How to set up a Subversion (SVN) server on CentOS or Fedora
- How to Install RSyslog+MySQL with LogAnalyzer on CentOS
- How to Install Subversion (SVN) 1.8.15 on CentOS/RHEL 7/6/5
- How to Install Tomcat 7.0.68 Server on CentOS/RHEL 7/6/5
- How To Setup a Rails 4 App With Apache and Passenger on CentOS 6
- How to install VNC server on CentOS 6
- How to install Apache Server on Windows
- How To Install the BIND DNS Server on CentOS 6
- How to install Apache, PHP 7.1 and MySQL on CentOS 7.3 (LAMP)