主要安装步骤参考:

Mac上安装svn+http访问(编译subversion,serf,apr,apr-util,httpd)_ellende的博客-CSDN博客_mac serf

但是在安装中遇到一些问题,这里做个记录

------------------------------------------------------------------------------------------------------------------------------------

前提工具安装

Mac 不同版本自带的环境有些差异,下面的三个是都会用到的,所以开始之前不管有没有,先执行一下

brew install libtool
brew install openssl
brew install scons

autoconf   zlib

curl -O http://mirrors.kernel.org/gnu/m4/m4-1.4.13.tar.gz
tar -xzvf m4-1.4.13.tar.gz
cd m4-1.4.13
./configure --prefix=/usr/local
make
sudo make install
cd ..
curl -O http://mirrors.kernel.org/gnu/autoconf/autoconf-2.65.tar.gz
tar -xzvf autoconf-2.65.tar.gz
cd autoconf-2.65
./configure --prefix=/usr/local
make
sudo make install
cd ..
# here you might want to restart your terminal session, to ensure the new autoconf is picked up and used in the rest of the script
curl -O http://mirrors.kernel.org/gnu/automake/automake-1.11.tar.gz
tar xzvf automake-1.11.tar.gz
cd automake-1.11
./configure --prefix=/usr/local
make
sudo make install
cd ..
curl -O http://mirrors.kernel.org/gnu/libtool/libtool-2.2.6b.tar.gz
tar xzvf libtool-2.2.6b.tar.gz
cd libtool-2.2.6b
./configure --prefix=/usr/local
make
sudo make installcurl -O http://www.zlib.net/zlib-1.2.11.tar.gz
tar -zxf  zlib-1.2.11.tar.gz
cd zlib-1.2.11
./configure
make && make install

Mac OS 10.14.1 还需要单独安装pcre (注意是pcre.  不要安装成了pcre2)
tar -zxf pcre-8.42.tar.gz
cd pcre-8.42
 ./configure
make && make install

Mac OS 中安装 autoconf 和 automake - 灰色飘零 - 博客园

Mac 编译安装zlib_sunStd的博客-CSDN博客_mac zlib

-------------------------------------------------------------------------------------------------------------------------------

安装 apr apr-tools

安装apr 遇到的第一个问题  cannot remove `libtoolT': No such file or directory  ( Mac OS 10.15.7会遇到,10.14.4 貌似没有遇到 )

解决方案:在configure里面 RM='$RM'  
把RM='$RM'改为RM='$RM  -f'

注意,此文件下载到本地修改在上传会报错。建议用VI修改

Linux安装apache时 apr报错解决 rm: cannot remove `libtoolT': No such file or directory_天才少年程序员-李荣盛专栏-CSDN博客

安装 apr 遇到的第二个问题 Can not determine the proper size for pid_t ( Mac OS 10.15.7会遇到,10.14.4 貌似没有遇到 )

解决方案 修改文件arp_want头文件

步骤一:路径:/apr-1.7.0/include/apr_want.h
改法:用/* */注释掉结构体iovec的定义

步骤二:修改apr.h文件
路径:httpd-2.4.46/srclib/apr/include/apr.h
改法:
找到"#error Can not determine the proper size for pid_t"
将其替换成:#define APR_PID_T_FMT "d"

参考文档:在macOS(Big Sur- 11.2.2)上通过源码安装apache httpd(2.4.46)_vickqi的专栏-CSDN博客

若没有自动下载apr和apr-util包,可以用下面链接:

http://archive.apache.org/dist/apr/ 选择apr和apr-util包下载

接下来配置安装apr包:

cd apr

./configure --prefix=/usr/local/opt/apr-svn

make clean

make && make install

cd ..

再配置安装apr-util包:

cd apr-util

./configure --prefix=/usr/local/opt/apr-util-svn --with-apr=/usr/local/opt/apr-svn

make clean

make && make install

cd ..

----------------------------------------------

安装 serf

curl -O http://archive.apache.org/dist/serf/serf-1.3.9.tar.bz2
tar -jxvf serf-1.3.9.tar.bz2
cd serf-1.3.9

遇到两个问题

若要svn支持http访问,需要安装serf。

http://archive.apache.org/dist/serf/ 选择serf-1.3.9.tar

openssl用brew install openssl安装即可,scons用brew install scons安装即可。

配置编译serf:

cd serf-1.3.9

下面两个命令,注意OpenSsl的位置

scons APR=/usr/local/opt/apr-svn PREFIX=/usr/local/opt/serf-1.3.9 APU=/usr/local/opt/apr-util-svn OPENSSL=/usr/local/Cellar/openssl/1.0.2l/

scons APR=/usr/local/opt/apr-svn PREFIX=/usr/local/opt/serf-1.3.9 APU=/usr/local/opt/apr-util-svn OPENSSL=/usr/local/opt/openssl@1.1

安装serf:

sudo scons install
 问题一:print 'Warning: Used unknown variables:', ', '.join(unknown.keys())

解决方案: 修改 serf-1.3.9/SConstruct ,186行,注释掉 打印语句(185行,186行)

问题二:cannot use a string pattern on a bytes-like object

解决方案:修改 serf-1.3.9/SConstruct ,169行,

env.File('serf.h').get_contents(),  // 将这个改成下面这个,加上 decode('utf-8')

env.File('serf.h').get_contents().decode('utf-8'),

参考资料:

1. 安装serf-1.3.9出现的问题_嗼淰_新浪博客

2. CentOS7.2源码安装Subversion1.9.7【填坑记】_China_Style的专栏-CSDN博客_scons serf

在编译 Httpd 时遇到错误,错误描述

mod_ext_filter.c:372:10: error: implicit declaration of function 'apr_procattr_limit_set' is invalid in C99 [-Werror,-Wimplicit-function-declaration]

rv = apr_procattr_limit_set(procattr, APR_LIMIT_CPU, conf->limit_cpu);

         ^

1 error generated.

解决方案:在/httpd-2.4.33/modules/filters/mod_ext_filter.c 的36 行后面添加下面代码

APR_DECLARE(apr_status_t) apr_procattr_limit_set(apr_procattr_t *attr,apr_int32_t what,struct rlimit *limit);

在编译 Httpd 时,还遇到了权限问题

解决方案:  sudo make && sudo make install

Httpd 编译好之后,编译subversion需要额外加参数。(--with-lz4=internal --with-utf8proc=internal)

配置subversion:

cd subversion

./configure --prefix=/usr/local/opt/svn --with-apr=/usr/local/opt/apr-svn --with-apr-util=/usr/local/opt/apr-util-svn --with-apxs=/usr/local/apache2/bin/apxs --with-serf=/usr/local/opt/serf-1.3.9 --with-lz4=internal --with-utf8proc=internal

------------------------------------------------------------------------------------------------------

安装好后,可能还应为 logs 目录的权限导致服务启动失败

httpd not running, trying to start

(13)Permission denied: AH00091: httpd: could not open error log file /usr/local/apache2/logs/error_log.

AH00015: Unable to open logs

解决方法:设置目录权限

sudo chmod -R 777 /usr/local/apache2/

// 下面这个是 SVN 仓库地址的权限

sudo chown -R root:admin Users/rain/svnServer/xxRepository

安装好环境之后,可参考创建SVN仓库和账号等配置

配置SVN的HTTP访问的方式_胡振伟博客-CSDN博客_svn网页访问

另外附上 htpasswd 命令常用

# 密码文件创建(注意,-c 命令如果文件不存在则会创建文件,如果文件已经存在了,会覆盖,原有的内容会消失)

htpasswd -c /Users/rain/svnServer/xxRepository/conf/passwd userName

# 添加账户密码

htpasswd -b /Users/rain/svnServer/xxRepository/conf/passwd userName userPwd123456

# 更新密码(只能先删除,后添加)

htpasswd -D /Users/rain/svnServer/xxRepository/conf/passwd userName

htpasswd -b /Users/rain/svnServer/xxRepository/conf/passwd userName userPwd123456

##  最后附上开机启动陪着

自动启动配置文件(需要自己创建)

/Library/LaunchDaemons/org.apache.httpdSvn.plist

// 创建文件

sudo touch /Library/LaunchDaemons/org.apache.httpdSvn.plist

sudo vim /Library/LaunchDaemons/org.apache.httpdSvn.plist

自动启动配置文件内容

<?xml version="1.0" encoding="UTF-8"?>

<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">

<plist version="1.0">

<dict>

<key>KeepAlive</key>

<true/>

<key>Label</key>

<string>org.apache.httpdSvn</string>

<key>ProgramArguments</key>

<array>

<string>/usr/local/apache2/bin/apachectl</string>

</array>

<key>StandardErrorPath</key>

<string>/Users/XXXXX/Desktop/APP/Logs/SvnService/error</string>

</dict>

</plist>

Mac 搭建http协议的SVN服务相关推荐

  1. 在Linux上搭建VisualSVN Server(svn服务端)

    一.检查是否安装了低版本的SVN #  rpm -qa | grep subversion 如果已安装SVN,则会返回版本信息.这时需要卸载旧版本的SVN. 卸载旧版本SVN # yum remove ...

  2. Mac搭建本地svn服务器,并用Cornerstone连接服务器

    Mac搭建本地svn服务器,并用Cornerstone连接服务器 Mac默认已经安装了svn,我们只需要进行配置并开启就可以了 首先我们可以验证一下是否安装了svn,打开终端,输入命令: svnser ...

  3. SVN服务端的搭建和简单使用

    SVN简单说明 SVN是Subversion的简称,是一个开放源代码的版本控制系统,相较于RCS.CVS,它采用了分支管理系统,它的设计目标就是取代CVS.互联网上很多版本控制服务已从CVS迁移到Su ...

  4. 怎么在Win7服务器搭建SVN服务端

    怎么在Win7服务器搭建SVN服务端 今天码大夫给大家分享在Windows服务器上如何搭建SVN环境的详细步骤: 工具/原料 1.VisualSVN server 这是服务器端的安装应用程序,根据自己 ...

  5. Ubuntu搭建SVN服务 - 内网穿透实现公网远程访问

    写在前面:博主是一只经过实战开发历练后投身培训事业的"小山猪",昵称取自动画片<狮子王>中的"彭彭",总是以乐观.积极的心态对待周边的事物.本人的技 ...

  6. SVN服务端的搭建及客户端连接(云上搭建服务端)

    SVN服务端: 环境:linux下搭建 1,安装软件(系统自带) SVN 的一些概念 repository(源代码库):源代码统一存放的地方 Checkout(提取):当您手上没有源代码时,您需要从r ...

  7. windows关闭svnserver_Windows停SVN服务的搭建和使用(二)-Win32Svn

    Windows下SVN服务的搭建和使用(二)-Win32Svn Windows下SVN服务的搭建和使用(二) VisualSVN-Server+TortoiseSVN是Windows下最方便易用的SV ...

  8. 如何在 MacOS 环境下搭建 SVN 服务端环境

    文章目录 在服务端创建资源仓库 资源仓库访问权限配置 给资源仓库添加用户 配置用户组及用户的权限 启动 SVN 服务器 停止 SVN 服务器 SVN 是一个使用十分广泛的开放源代码的版本控制系统.在 ...

  9. linux6.0 SVN 服务搭建

    Linux6.0下安装svn服务器<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office&qu ...

最新文章

  1. 360浏览器卸载_如何卸载360浏览器,如何卸载360安全浏览器
  2. oracle多表查询
  3. 简单实现迷你Vue框架
  4. PCA目标函数的推导
  5. java进制代码_Java将字节转换为十六进制代码分享
  6. L3-002 堆栈 树状数组+二分答案
  7. (转)SpringMVC学习(十一)——SpringMVC实现Resultful服务
  8. android常见的面试题,Android常见笔试面试题
  9. 牛客 2021年度训练联盟热身训练赛第二场 D题Soccer Standings
  10. html5代码_深入解读HTML5移动应用程序开发!
  11. HTML知识积累及实践(二) - 标签样式
  12. Android技术专家 高焕堂 推荐这本书
  13. 3dmax2020渲染器下载3dmax2020渲染器VRay4.2下载安装教程
  14. itunes备份包括哪些内容_软件开发项目技术方案包括哪些内容
  15. 原生js的dom操作
  16. Word 2019 更改默认模板的字体设置
  17. 计算机电源性能怎么调,笔记本电脑如何将电源模式更改为高性能模式? -
  18. 消息中间件:简述消息队列(MessageQueue)
  19. ACP.敏捷概念梳理1
  20. Avira Free Antivirus 小红伞免费杀毒软件广告去除工具

热门文章

  1. 330页PDF,10万字的知识点总结,吊打面试官系列!
  2. 人和人的相遇,是必然还是偶然
  3. 哈希头像生成器Identicon
  4. setMonth()
  5. NILM(非侵入式电力负荷监测)学习笔记 —— 使用NILMTK Toolkit,REDD数据集,CO和FHMM两种算法
  6. python 美化ppt_用python做ppt服务用于导入图片
  7. 微信开发者工具调试器是空白的
  8. 音视频技术开发周刊 | 209
  9. 如何在爱课程网站下载视频与课件
  10. Hive Metastore Server实现逻辑