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平台编译 ...
随机推荐
- 通过java反射得到javabean的属性名称和值参考
通过java反射得到javabean的属性名称和值 Field fields[]=cHis.getClass().getDeclaredFields();//cHis 是实体类名称 String[] ...
- 基于spring多数据源动态调用及其事务处理
需求: 有些时候,我们需要连接多个数据库,但是,在方法调用前并不知道到底是调用哪个.即同时保持多个数据库的连接,在方法中根据传入的参数来确定. 下图的单数据源的调用和多数据源动态调用的流程,可以看出在 ...
- Kotlin入门第四课:简单工厂模式
Kotlin基础知识的学习,请参考之前的文章: Kotlin入门第一课:从对比Java开始 Kotlin入门第二课:集合操作 Kotlin入门第三课:数据类型 初次尝试用Kotlin实现Android ...
- CSS 从入门到忘记
CSS是Cascading Style Sheets的简称,中文称为层叠样式表,用来控制网页数据的表现,可以使网页的表现与数据内容分离. 一. css的三种引入方式 二. css的选择器(Select ...
- JavaScript中的坑--全局变量惹得祸
js中变量的作用域及闭包的概念 概述 身为一名程序员,因为bug周末加班是必不可少的事情,当解决bug的时候,总有些bug是因为规范导致的,但是这些bug往往不好找,也就是"前人挖坑,后 ...
- 基于Bootstrap+angular的一个豆瓣电影app
1.搭建项目框架 npm初始化项目 npm init -y //按默认配置初始化项目 安装需要的第三方库 npm install bootstrap angular angular-route --s ...
- VPN断开后断网脚本
有时在实际中需要,不能暴露自己的真实IP,不得不使用VPN,但是VPN的稳定性及易受网络环境影响,在VPN的暂时掉线之后,会暴露自己的真实IP,此时通过脚本操作路由表让VPN断线之后,电脑失去网络访问 ...
- 部分转载[C#性能优化实践]
全文出处:http://www.infoq.com/cn/articles/C-sharp-performance-optimization 1.性能 主要指两个方面:内存消耗和执行速度.性能优化简而 ...
- SpringMvc支持跨域访问,Spring跨域访问,SpringMvc @CrossOrigin 跨域
SpringMvc支持跨域访问,Spring跨域访问,SpringMvc @CrossOrigin 跨域 >>>>>>>>>>>> ...
- C/C++中const关键字的用法及其与宏定义的比较
1.const关键字的性质 简单来说:const关键字修饰的变量具有常属性. 即它所修饰的变量不能被修改. 2.修饰局部变量 ; ; 这两种写法是等价的,都是表示变量的值不能被改变,需要注意的是,用c ...