博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
SVN Server on Ubuntu with https access
阅读量:6893 次
发布时间:2019-06-27

本文共 3414 字,大约阅读时间需要 11 分钟。

To install SVN server, run this command at the command prompt:

sudo apt-get install subversion apache2 libapache2-svn

Verify the installed version of Subversion software:

svn --version

We want to configure the apache in such a way that it’ll run on HTTPs and for this we need to enable ssl Apache2 module with a2enmod:

sudo a2enmod ssl

It will suggest you to restart apache;ignore that message for now.

Create a directory inside the /etc/apache2/ directory,where we’ll save the server key and certificate:

sudo mkdir /etc/apache2/ssl

Use this command for creating the self-signed SSL certificate and the server key that protects it, and save them into the new directory (/etc/apache2/ssl/):

sudo openssl req -new -x509 -days 365 -nodes -out /etc/apache2/ssl/apache.pem -keyout /etc/apache2/ssl/apache.key

Note: Fill the information accordingly!

Edit the ports.conf file:

sudo nano /etc/apache2/ports.conf

Ensure that port 443 is defined as follows and add the NameVirtualHost for port 443:

NameVirtualHost *:443Listen 443

Open up the SSL config file:

sudo nano /etc/apache2/sites-available/default-ssl

Comment out the default certificate and key:

#SSLCertificateFile /etc/ssl/certs/ssl-cert-snakeoil.pem#SSLCertificateKeyFile /etc/ssl/private/ssl-cert-snakeoil.key

And add the newly created certificate and key:

SSLCertificateFile /etc/apache2/ssl/apache.pemSSLCertificateKeyFile /etc/apache2/ssl/apache.key

Now we need to configure the SSL site:

sudo a2ensite default-ssl

Restart the Apache service:

sudo /etc/init.d/apache2 restart

Now we should be able to connect to the server through SSL using Chrome or any other browser:

Verify the Certificate, that it’s the same that we created and configured:

Next, we need to configure the SVN Server for this, make a directory where you want to keep the svn repositories and edit the dav_svn.conf file:

sudo mkdir /svnsudo nano /etc/apache2/mods-enabled/dav_svn.conf

Delete all the data and make it simple like this:

DAV svnSVNParentPath /svnAuthType BasicAuthName "Subversion Repository"AuthUserFile /etc/apache2/dav_svn.passwdRequire valid-userSSLRequireSSL

To create a svn user , use the following command:

sudo htpasswd -cm /etc/apache2/dav_svn.passwd arbab

We only need to use the -c option for the FIRST TIME, when you create a user, after that you will only use the   -moption.

Move to the folder, where you want to keep your repositories and create your first repository:

cd /svnsudo svnadmin create myrepo

Make sure you set the permissions of the /svn directory to apache with the following command:

sudo chown -R www-data:www-data /svn

Restart the apache2 service:

sudo /etc/init.d/apache2 restart

Let’s test with the browser that our svn repository is accessible now through HTTPs at following url:

https://tendo.local/svn/myrepo

Click “Proceed anyway“, enter the username and password:

Yes, It is working ?

Note: Our SVN Server is also working with http:

But, we don’t want that users access it through http, we only want to access it through https. To fix this, we need to edit the ports.conf file:

sudo nano /etc/apache2/ports.conf

Comment these two lines:

#NameVirtualHost *:80#Listen 80

Restart the apache2 service:

sudo /etc/init.d/apache2 restart

Now, try to access it through http, it’ll give us the rejection error:

But with https, we can still access the svn repositories:

Hope this will help you!

Please Remember me in your prayers!

Enjoy 

转载地址:http://qlzdl.baihongyu.com/

你可能感兴趣的文章
归并排序就这么简单
查看>>
闭锁——CountDownLatch
查看>>
注解就这么简单
查看>>
JS函数无响应
查看>>
*(int*)&p
查看>>
LinkedList 源码分析(JDK 1.8)
查看>>
QT5.10.0安装教程图文教程以及安装成功QT5.10.0后环境配置图文教程
查看>>
spring笔记--事务管理之声明式事务
查看>>
京津冀将于2020年底初步建立大数据服务新体系
查看>>
Git教程及问题解析
查看>>
为你解析机器学习品酒步骤(附视频)
查看>>
区块链将颠覆游戏业,游戏内商品未来也可带出游戏、自由交易
查看>>
Linux/Mac安装oh-my-zsh后不执行~/.bash_profile、~/.bashrc解决办法
查看>>
安卓开发_深入理解广播机制
查看>>
技术大咖云集,GIAC 2017全球互联网架构大会圆满落幕
查看>>
推荐几款API文档集合工具
查看>>
代码照亮宝贝回家路
查看>>
OTL之Oracle开发总结《转》
查看>>
php取整函数ceil,floor,round,intval函数的区别
查看>>
安卓应用安全指南 4.2.2 创建/使用广播接收器 规则书
查看>>