CentOS 7 安装Subversion, 并用Nginx代理
环境: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代理的更多相关文章
- ubuntu下发布asp.net core并用nginx代理之旅
asp.net core 1.0.1发布已有些日子了,怀着好奇的心情体验了把ubuntu下的asp.net core 系统运行环境:ubuntu 16.0.4 for developer 首先搭建.n ...
- CentOS 7 安装php5.6,Nginx,Memcached环境及配置
安装php5.6版本以后不再需要安装Zend Guard,而是用yum命令安装php-opcache及php-pecl-apcu就可以有效的提高php执行速度. 1. 配置yum源 事先确认yum源的 ...
- Centos下安装并设置nginx开机自启动
一.在centos环境下安装下载并安装nginx,由于nginx需要依赖一些环境才能安装,主要依赖g++.gcc.openssl-devel.pcre-devel和zlib-devel这些环境,首先得 ...
- CentOS 下安装 LEMP 服务(nginx、MariaDB/MySQL 和 php)
转载自:https://linux.cn/article-4314-1.html 编译自:http://xmodulo.com/install-lemp-stack-centos.html 作者: D ...
- [转载]CentOS 下安装LEMP服务(Nginx、MariaDB/MySQL和PHP)
LEMP 组合包是一款日益流行的网站服务组合软件包,在许多生产环境中的核心网站服务上起着强有力的作用.正如其名称所暗示的, LEMP 包是由 Linux.nginx.MariaDB/MySQL 和 P ...
- centos yum安装redis,nginx
先安装源 yum install epel-release 之后 分别安装redis,nginx
- CentOS单机安装FastDFS&整合Nginx
单机安装 一 准备工作 准备linux服务器或虚拟机,这里是虚拟机,操作系统CentOS 6.4 Tracker 和 Storage 安装在一台机器上 FastDFS 5.08版本 1,准备软件 软件 ...
- linux (centOS)安装jdk+tomcat+nginx
一..安装jdk, 下载jdk有两种方式: 1.直接去官网找相应版本下载:http://www.oracle.com/technetwork/java/javase/downloads/index.h ...
- 在centos中安装最新版nginx,同时更改官方文档路径错误
nginx的可以使用各平台的默认包来安装,本文是介绍使用源码编译安装,包括具体的编译参数信息. 正式开始前,编译环境gcc g ++开发库之类的需要提前装好,这里默认你已经装好. ububtu平台编译 ...
随机推荐
- 【VC6.0】getline需要输入2次回车才会结束的BUG修复方法
原始日期:2013-09-30 23:22 今天看C++Primer的时候发现一个问题,getline需要输入2次回车才会显示结果,上网找了一下,发现是VC6.0的原因,修复原因如下: (1)建立一个 ...
- js调试模式控制台输出信息
js调试模式控制台输出信息.console.log
- js禁止选中(网页复制)
document.onselectstart=new Function("event.returnValue=false");//禁止选中(无法复制) document.oncon ...
- 带你重拾JavaScript(2)之console的你所不知道的功能
JavaScript最常用的调试工具就是console.info()了.console是浏览器中window对象的属性之一,由浏览器对象模型(BOM)提供,作用是访问浏览器控制台,你可以通过conso ...
- USACO Ordered Fractions
首先看一下题目 Consider the set of all reduced fractions between 0 and 1 inclusive with denominators less t ...
- work1-英语辅导班在线报名系统
作品简述: 这是一个英语辅导班在线报名系统,目的是提供一个供学生报名辅导班的平台,也同时为老师收集报名信息提供便利. 使用的语言: php+html+js 服务器: 新浪sae服务器,apache 数 ...
- etcd raft library设计原理和使用
早在2013年11月份,在raft论文还只能在网上下载到草稿版时,我曾经写过一篇blog对其进行简要分析.4年过去了,各种raft协议的讲解铺天盖地,raft也确实得到了广泛的应用.其中最知名的应用莫 ...
- View学习(一)-DecorView,measureSpec与LayoutParams
这段时间在学习android中view的工作原理与自定义View的相关内容,所以未来这这几篇博客都总结一下相关的知识吧. 首先我们要了解和熟悉两个概念,DecorView 与 MeasureSpec. ...
- Oracle批量查询、删除、更新使用BULK COLLECT提高效率
BULK COLLECT(成批聚合类型)和数组集合type类型is table of 表%rowtype index by binary_integer用法笔记 例1: 批量查询项目资金账户号为 &q ...
- JavaScript跨域请求和jsonp请求实例
<script type="text/javascript" src="./whenReady.js"></script> <sc ...