Ubuntu + Nginx installs subversion and configures Nginx+apache to be accessed via HTTP

Source: Internet
Author: User
Tags mkdir svn

1. Installation

$ sudo apt-get install apache2

$ sudo vi/etc/apache2/ports.conf

$ sudo/etc/init.d/apache2 Restart

$ sudo apt-get install subversion
$ sudo apt-get install LIBAPACHE2-SVN


3.1 Add the group and add the user to the group:

sudo addgroup subversion
sudo usermod-g subversion-a www-data


3.2 Now execute the following command:

$ sudo mkdir/home/svn
$ cd/home/svn
$ sudo mkdir myproject
$ sudo chown-r root:subversion myproject


3.3 The following command is used to create the SVN file repository:
$ sudo svnadmin create/home/svn/myproject


3.4 Give the group members the appropriate permissions for all newly added files to the file repository:
$ sudo chmod-r g+rws myproject

4. Integration of Apache and subversion

View/etc/apache2/mods-enabled/dav_svn.load file with mod_dav_svn.so This dynamic library illustrates that Apache has already loaded the Subversion access control module. If not, add it manually.

To access the SVN file repository through the WebDAV protocol, you must configure your Apache 2 Web server. You must add the following code snippet to your/etc/apache2/mods-available/dav_svn.conf:

<Location/svn>

DAV SVN

Svnpath/www/impkd.com/svn

AuthType Basic

AuthName "Subversion Repository"

authuserfile/www/impkd.com/svn/conf/passwd

<limitexcept GET PROPFIND OPTIONS report>

Require Valid-user

</LimitExcept>

</Location>



Sudo/etc/init.d/apache2 restart

sudo htpasswd-c/home/svn/passwd user_name
It will prompt you for a password, and when you enter the password, the user is established. The "-C" option means that a new/home/svn/passwd file is created, so the user referred to by USER_NAME will be the only user in the file. If you want to add another user, you can remove the "-C" option:
sudo htpasswd/home/svn/passwd other_user_name


5. Configure Nginx

sudo vi/alidata/server/nginx/conf/nginx.conf

Add the following configuration: server {
Listen 80;
server_name www.domain.com;
LOCATION/SVN {
Proxy_set_header Host $host;
Proxy_set_header X-real-ip $remote _addr;
Proxy_set_header X-forwarded-proto HTTPS;
Proxy_set_header x-forwarded-for $proxy _add_x_forwarded_for;
Proxy_pass http://127.0.0.1:8099;
}
}

Save exit.

6. Restart Nginx

Nginx-s Reload

7. Open the browser, enter HTTP://WWW.DOMAIN.COM/SVN, you will be prompted to enter the user name, Password dialog box, the user named 4th step htpasswd-c/home/svn/passwd user_name user_name, Password for the user_name password, if no error pops up, the installation is successful.

8. If you want to access by svn://domain.com/: You can add to/etc/rc.local

Svnserve-d-R/WWW/IMPKD.COM/SVN

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.