环境:CentOS 7.3.1611

分三步:
第一步:安装subversion
第二步:安装httpd
第三步:安装nginx

操作步骤:
安装subversion, 命令 -> yum -y install subversion;
创建svn目录, 命令 -> mkdir /var/svn, subversion的默认目录, 没有此目录, 启动服务会失败;
创建仓库, 命令 -> svnadmin create /var/svn/repo1;
修改认证授权策略文件svnserve.conf, 命令 -> vi /var/svn/repo1/conf/svnserve.conf, 对anon-access = read、auth-access = write、password-db = passwd、authz-db = authz取消注释;
添加svn用户, 命令 -> vi /var/svn/repo1/conf/passwd, 添加svn = svn;
给用户授权, 命令 -> vi /var/svn/repo1/conf/authz, 添加[repo1:/] svn = rw;
systemctl start svnserve.service;
windows系统可以使用TortoiseSVN访问svn://ip/repo1 ,也可以在本机使用访问, 命令 -> wget http://127.0.0.1:3690/repo1, 正常访问域名配置已生效;

安装httpd, 命令 -> yum -y install httpd;
安装httpd的svn模块, 命令 -> yum -y install mod_dav_svn;
修改httpd的配置文件, 命令 -> vi /etc/httpd/conf/httpd.conf, 搜索“LoadModule”,添加以下两行:
LoadModule dav_module modules/mod_dav.so
LoadModule dav_svn_module modules/mod_dav_svn.so
在文件结束处添加以下内容:
<Location /svn>
DAV svn
SVNParentPath /var/svn
#Authentication: Basic
AuthName "Subversion repository"
AuthType Basic
AuthUserFile /etc/httpd/svn-auth.htpasswd
#Authorization: Authenticated users only
<LimitExcept GET PROPFIND OPTIONS REPORT>
Require valid-user
</LimitExcept>
</Location>
创建svn-auth.htpasswd文件, 并添加用户laohans, 命令 -> htpasswd -c -m /etc/httpd/svn-auth.htpasswd laohans;
将apache用户添加到root组, 命令 -> usermod -a -G root apache;
启动httpd, 命令 -> systemctl start httpd.service;
通过浏览器访问, http://ip:port/repo1;
修改httpd端口, 命令 -> vi /etc/httpd/conf/httpd.conf, 找到Listen 80, 将80修改为81;
重启httpd, 命令 -> systemctl restart httpd.service;

安装nginx, 下载nginx, 命令 -> wget https://nginx.org/download/nginx-1.12.1.tar.gz;
解压nginx, 命令 -> tar -zxvf nginx-1.12.1.tar.gz;
进入解压后的nginx目录, 执行命令 -> ./configure, 会依次出现以下错误提示:
./configure: error: C compiler cc is not found;
./configure: error: the HTTP rewrite module requires the PCRE library;
./configure: error: the HTTP gzip module requires the zlib library;
安装依赖库, 命令 -> yum -y install gcc pcre-devel zlib-devel;
再次执行命令 -> ./configure, 出现以下内容说明安装成功:
Configuration summary
+ using system PCRE library
+ OpenSSL library is not used
+ using system zlib library

nginx path prefix: "/usr/local/nginx"
nginx binary file: "/usr/local/nginx/sbin/nginx"
nginx modules path: "/usr/local/nginx/modules"
nginx configuration prefix: "/usr/local/nginx/conf"
nginx configuration file: "/usr/local/nginx/conf/nginx.conf"
nginx pid file: "/usr/local/nginx/logs/nginx.pid"
nginx error log file: "/usr/local/nginx/logs/error.log"
nginx http access log file: "/usr/local/nginx/logs/access.log"
nginx http client request body temporary files: "client_body_temp"
nginx http proxy temporary files: "proxy_temp"
nginx http fastcgi temporary files: "fastcgi_temp"
nginx http uwsgi temporary files: "uwsgi_temp"
nginx http scgi temporary files: "scgi_temp"
安装, 命令 -> make install
让nginx代理httpd, 命令 -> vi /usr/local/nginx/conf/nginx.conf, 添加以下内容:
location /svn {
proxy_pass http://127.0.0.1:81
}
启动nginx, 命令 -> /usr/local/nginx/sbin/nginx -c /usr/local/nginx/conf/nginx.conf;
测试, 浏览器访问:http://123.207.108.213/svn/repo1;
https://www.ibm.com/developerworks/cn/java/j-lo-apache-subversion/

CentOS 7 安装Subversion, 并用Nginx代理的更多相关文章

  1. ubuntu下发布asp.net core并用nginx代理之旅

    asp.net core 1.0.1发布已有些日子了,怀着好奇的心情体验了把ubuntu下的asp.net core 系统运行环境:ubuntu 16.0.4 for developer 首先搭建.n ...

  2. CentOS 7 安装php5.6,Nginx,Memcached环境及配置

    安装php5.6版本以后不再需要安装Zend Guard,而是用yum命令安装php-opcache及php-pecl-apcu就可以有效的提高php执行速度. 1. 配置yum源 事先确认yum源的 ...

  3. Centos下安装并设置nginx开机自启动

    一.在centos环境下安装下载并安装nginx,由于nginx需要依赖一些环境才能安装,主要依赖g++.gcc.openssl-devel.pcre-devel和zlib-devel这些环境,首先得 ...

  4. CentOS 下安装 LEMP 服务(nginx、MariaDB/MySQL 和 php)

    转载自:https://linux.cn/article-4314-1.html 编译自:http://xmodulo.com/install-lemp-stack-centos.html 作者: D ...

  5. [转载]CentOS 下安装LEMP服务(Nginx、MariaDB/MySQL和PHP)

    LEMP 组合包是一款日益流行的网站服务组合软件包,在许多生产环境中的核心网站服务上起着强有力的作用.正如其名称所暗示的, LEMP 包是由 Linux.nginx.MariaDB/MySQL 和 P ...

  6. centos yum安装redis,nginx

    先安装源 yum install epel-release 之后 分别安装redis,nginx

  7. CentOS单机安装FastDFS&整合Nginx

    单机安装 一 准备工作 准备linux服务器或虚拟机,这里是虚拟机,操作系统CentOS 6.4 Tracker 和 Storage 安装在一台机器上 FastDFS 5.08版本 1,准备软件 软件 ...

  8. linux (centOS)安装jdk+tomcat+nginx

    一..安装jdk, 下载jdk有两种方式: 1.直接去官网找相应版本下载:http://www.oracle.com/technetwork/java/javase/downloads/index.h ...

  9. 在centos中安装最新版nginx,同时更改官方文档路径错误

    nginx的可以使用各平台的默认包来安装,本文是介绍使用源码编译安装,包括具体的编译参数信息. 正式开始前,编译环境gcc g ++开发库之类的需要提前装好,这里默认你已经装好. ububtu平台编译 ...

随机推荐

  1. 手动ecache处理

    手动ecache处理: import net.sf.ehcache.Cache; import net.sf.ehcache.CacheManager; import net.sf.ehcache.E ...

  2. php追加数组

    <?php //追加数组 array_merge_recursive()函数与array_merge()相同,可以将两个或多个数组合并在一起,形成一个联合的数组.两者之间的区别在于,当某个输入数 ...

  3. Kafka 源代码分析之Message

    这里主要分析一下message的格式. 一条message的构成由以下部分组成 val CrcOffset = 0 //crc校验部分和字长 val CrcLength = 4 val MagicOf ...

  4. 【Android Developers Training】 77. 使用Wi-Fi P2P进行服务搜索

    注:本文翻译自Google官方的Android Developers Training文档,译者技术一般,由于喜爱安卓而产生了翻译的念头,纯属个人兴趣爱好. 原文链接:http://developer ...

  5. solr的基本概念

    一.solr的基本概念 大家可以把solr搜索引擎看成一个数据库,不过是基于内存的.它可以存储信息,并且根据你的查询条件返回你想要的信息. 1.collection和core的概念 collectio ...

  6. web项目直接在浏览器上访问不需要带.jsp,直接ip地址加项目名 在web.xml里配置

    web.xml最上方 <welcome-file-list> <welcome-file> /view/login.jsp </welcome-file> < ...

  7. vijos1010题解

    题目: 话说乾隆带着他的宰相刘罗锅和你出巡江南,被杭州城府邀请去听戏,至于什么戏,那就不知了.乾隆很高兴,撒酒与君臣共享.三更欲回住处,可是乾隆这人挺怪,他首先要到西湖边散散步,而且命令不准有人跟着他 ...

  8. ABP入门系列(20)——使用后台作业和工作者

    ABP入门系列目录--学习Abp框架之实操演练 源码路径:Github-LearningMpaAbp 1.引言 说到后台作业,你可能条件反射的想到BackgroundWorker,但后台作业并非是后台 ...

  9. PHP源码阅读strtr

    strtr 转换字符串中特定的字符,但是这个函数使用的方式多种. echo strtr('hello world', 'hw', 'ab'); // 第一种 aello borld echo strt ...

  10. [jbdj]SpringMVC框架(1)快速入门

    1)springmvc快速入门(传统版) 步一:创建springmvc_demo一个web应用 步二:导入springioc,springweb , springmvc相关的jar包 步三:在/WEB ...