Home Database Mysql Tutorial svn1.6+apache2.2配置之Apache集成

svn1.6+apache2.2配置之Apache集成

Jun 07, 2016 pm 03:44 PM
apache integrated

软件准备 : svn-win32-1.6.1.zip (http://subversion.tigris.org/files/documents/15/45600/svn-win32-1.6.1.zip) 和 apache_2.2.11-win32-x86-no_ssl.msi 注意版本要匹配,否则可能会报错误1和2(见 下面) 软 件安装: 1. 安装svn 1.1 直接解压下载的svn

软件准备 

svn-win32-1.6.1.zip (http://subversion.tigris.org/files/documents/15/45600/svn-win32-1.6.1.zip ) 和apache_2.2.11-win32-x86-no_ssl.msi 注意版本要匹配,否则可能会报错误1 和2 (见 下面)

软 件安装: 
1. 安装svn 
1.1 直接解压下载的svn 压缩包 即可 
1.2 (%svn% 为svn 的 主目录)使用%svn%/bin 下的svnadmin 命令创建工程: 
      svnadmin create d:/svn/myproject 

     注释:d:/svn 为svn 的 根目录,myproject 是我们的工程

2. 安装apache : 
2.1 按照提示安装即可 
   2.2 关于80 端口是否被占用 
2.2.1 使 用命令 netstat -ano|findstr ".*:80.*:.*" 即可查看80 端口是否被使用,一般安装iis 以及迅雷等 软件有可能把端口占用,如果80 被占用的话,最后一列的数字即为占用80 端口软件的pid ; 当然您可以把该软件关闭,也可以修改apache 的端口 
   2.2.2 (%apache% 为apache 的 主目录)修改apache 的端口可以修改%apache%/conf/httpd.conf 
把里面的Listen 80 修改为: 
    Listen 81 
    这样您的apache 的端口就变成81 了,不会与80 冲 突啦,修改后端口再按照2.1 重新安装一次即可 

2.3 在浏览器里输入http ://localhost:81 正 常显示说明安装成功。(81 是端口号)

3. 把svn 与apache 结 合 
3.1 拷贝%svn% 下的文件到%apache% 下 
3.1.1 把%svn%\bin\ 下 的 mod_dav_svn.so 和mod_authz_svn.so 到%apache%\ modules 目录下 
3.1.2 把%svn%\bin\ 下的 九个dll 文件intl3_svn.dll,libapr-1.dll,libapriconv-1.dll,libaprutil-1.dll,libdb44.dll,libsvn_delta-1.dll,libsvn_fs-1.dll,libsvn_repos-1.dll,libsvn_subr-1.dll 拷 贝到%apache%\bin 目录下( 建议全部copy 过去,否则容易 报错误2 ,见下面) 
3.2 修改%apache%/conf/httpd.conf 文 件 
3.2.1 把在httpd 中找到以下2 行, 并把前面的注释符# 删除: 
    #LoadModule dav_fs_module modules/mod_dav_fs.so 
    #LoadModule dav_module modules/mod_dav.so 

     如果不删除容易报错误3 ,见下面 
3.2.2 在LoadModule 结尾 处添加以下2 行: 
    LoadModule dav_svn_module modules/mod_dav_svn.so 
    LoadModule authz_svn_module modules/mod_authz_svn.so 

3.2.3 在http.conf 文件的结尾处添加以下配置行: 
 
    DAV svn 
    SVNParentPath D:\svn 
    AuthType Basic 
    AuthName "Subversion repositories" 
    AuthUserFile D:\svn\passwd 
    #AuthzSVNAccessFile D:\svnaccessfile 
    Require valid-user 
 
注释:1. SVNParentPath D:\svn 为svn 的主目录,参加1.2 中设置 
        2 .AuthUserFile D:\svn\passwd 密 码存储文件,(下面要使用)
说明:
 
   意 味着可以通过像这样的URL(http://MyServer/svn) 来访问Subversion版本库
DAV svn 
   告 诉Apache哪个模块 负责服务像那样的URL--在这里就是Subversion模块
SVNListParentPath on 
   在Subversion 1.3及更高版本中,这个指示器使得Subversion列出由SVNParentPath指定的目录下所有的版本库
SVNParentPath F:\svnROOT 
   告 诉Subversion在目录F:\svnROOT下寻找版本库
AuthType Basic 
   启 用基本的验证,比如用户名/密码对
AuthName "Subversion repositories" 
   当 一个验证对话框弹出时,告诉用户这个验证是用来做什么的
AuthUserFile F:\svnROOT\htpasswd 
   指 定F:\svnROOT\htpasswd用为密码文件用来验证用户的用户名及密码
AuthzSVNAccessFile F:\svnROOT\authz 
   指 定F:\svnROOT\authz来限定各个用户或组在版本库中目录的访问权限
Require valid-user 
   限 定用户只有输入正确的用户名及密码后才能访问这个路径(此项表示,无论是IE还是Tortoise,只有通 过密码验证才能访问)。
下面表示允许匿名访问,对于读操作,不需要用户验证。
#
#Require valid-user
#

    AuthUserFile和AuthzSVNAccessFile 的 工作原理是,先使用Apache用户机制进行验证,通过之后将请求提交给mod_authz _svn.so 进行认证,最后使用mod_dav _svn.so提供的功能。     
 
3.3 创建passwd 文件 来管理svn 的访问权限 
3.3.1 使用%apache%\bin\ htpasswd .exe 来创建密码 
    第一个用户的命令: htpasswd -c D:\svn\passwd %username% 
    第二个用户的命令: htpasswd D:\svn\passwd %username% 
    注释:1.-c 是创建新文,%username% 是 用户名,输入命令后还会提示输入密码二次。 
          2.D:\svn\passwd 为3.1.3 中设置的路径 文件
上面的配置仅仅是一个简单的示例。你还可以对Apache进行许许多多的配置。
1.如果你想让所有用户对版本库都有读的权限而只有特定的用户才有写的权限,你可以将这行
CODE:
Require valid-user
改为
CODE:

Require valid-user

2.上面的配置使用了passwd文件将你所有的版本库作为一个单元来限定访问权限。如果你想获得更多的控制,如限定某个用户可以访问版本库中的哪个目 录,可以把下面这行的#去掉:
CODE:
#AuthzSVNAccessFile D:\svnaccessfile
然后用文本编辑器创建一个Subversion授权文件。Apache将确保只有有效的用户可以访问你的/svn位置,然后将用户名传到 AuthzSVNAccessFile模块,这样可以依据Subversion授权文件得到更精细的权限控制。注意,路径将被指定为[库:路径]或者简单 的[路径]。如果你不明确指定一个库,访问规则将应用到由SVNParentPath指定的目录下所有的版本库中。一个授权文件例子可能像这样:
CODE:
[groups]
admin = john, kate
devteam1 = john, rachel, sally
devteam2 = kate, peter, mark
docs = bob, jane, mike
training = zak
# 为所有库指定默认访问规则
# 所有人可以读,管理员可以写,危险分子没有任何权限
[/]
* = r
@admin = rw
dangerman =
# 允许开发人员可以完全访问他们的项目版本库
[proj1:/]
@devteam1 = rw
[proj2:/]
@devteam2 = rw
[bigproj:/]
@devteam1 = rw
@devteam2 = rw
trevor = rw
# 文档编写人员对所有的docs目录有写权限
[/trunk/doc]
@docs = rw
# 培训人员可以完全访问培训版本库
[TrainingRepos:/]
@training = rw

Svn 与apache 结合容易产生的错误  
    1. httpd.exe: Syntax error on line 86 of D:/Program Files/Apache Software Fou 
n/Apache2.2/conf/httpd.conf: API module structure 'dav_svn_module' in file 
ogram Files/Apache Software Foundation/Apache2.2/modules/mod_dav_svn.so is 
ed - expected signature 41503232 but saw 41503230 - perhaps this is not an 
e module DSO, or was compiled for a different Apache version? 
Note the errors or messages above, and press the key to exit. 3.... 
解决办法就是使用2.0 版本的apache

 

 

    2. httpd.exe: Syntax error on line 86 of D:/Program Files/Apache Software Foundatio 
n/Apache2.2/conf/httpd.conf: Cannot load D:/Program Files/Apache Software Founda 
tion/Apache2.2/modules/mod_dav_svn.so into server: \xd5\xd2\xb2\xbb\xb5\xbd\xd6\ 
xb8\xb6\xa8\xb5\xc4\xb3\xcc\xd0\xf2\xa1\xa3 
Note the errors or messages above, and press the key to exit. 16... 
可以看到已经说明了是2.2.9 以上的apache

3. Syntax error on line 487 of D:/Program Files/Apache Software Foundation/Apache2. 
2/conf/httpd.conf: 
Invalid command 'DAV', perhaps misspelled or defined by a module not included in 
the server configuration 
Note the errors or messages above, and press the key to exit. 25...

把LoadModule dav_module modules/mod_dav.so 前 的注释去掉

 

转帖:http://hi.baidu.com/lubezhang/blog/item/bf7aa72ea2c7fa5b4ec226d2.html

Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

How to set the cgi directory in apache How to set the cgi directory in apache Apr 13, 2025 pm 01:18 PM

To set up a CGI directory in Apache, you need to perform the following steps: Create a CGI directory such as "cgi-bin", and grant Apache write permissions. Add the "ScriptAlias" directive block in the Apache configuration file to map the CGI directory to the "/cgi-bin" URL. Restart Apache.

How to start apache How to start apache Apr 13, 2025 pm 01:06 PM

The steps to start Apache are as follows: Install Apache (command: sudo apt-get install apache2 or download it from the official website) Start Apache (Linux: sudo systemctl start apache2; Windows: Right-click the "Apache2.4" service and select "Start") Check whether it has been started (Linux: sudo systemctl status apache2; Windows: Check the status of the "Apache2.4" service in the service manager) Enable boot automatically (optional, Linux: sudo systemctl

What to do if the apache80 port is occupied What to do if the apache80 port is occupied Apr 13, 2025 pm 01:24 PM

When the Apache 80 port is occupied, the solution is as follows: find out the process that occupies the port and close it. Check the firewall settings to make sure Apache is not blocked. If the above method does not work, please reconfigure Apache to use a different port. Restart the Apache service.

How Debian improves Hadoop data processing speed How Debian improves Hadoop data processing speed Apr 13, 2025 am 11:54 AM

This article discusses how to improve Hadoop data processing efficiency on Debian systems. Optimization strategies cover hardware upgrades, operating system parameter adjustments, Hadoop configuration modifications, and the use of efficient algorithms and tools. 1. Hardware resource strengthening ensures that all nodes have consistent hardware configurations, especially paying attention to CPU, memory and network equipment performance. Choosing high-performance hardware components is essential to improve overall processing speed. 2. Operating system tunes file descriptors and network connections: Modify the /etc/security/limits.conf file to increase the upper limit of file descriptors and network connections allowed to be opened at the same time by the system. JVM parameter adjustment: Adjust in hadoop-env.sh file

How to delete more than server names of apache How to delete more than server names of apache Apr 13, 2025 pm 01:09 PM

To delete an extra ServerName directive from Apache, you can take the following steps: Identify and delete the extra ServerName directive. Restart Apache to make the changes take effect. Check the configuration file to verify changes. Test the server to make sure the problem is resolved.

How to use Debian Apache logs to improve website performance How to use Debian Apache logs to improve website performance Apr 12, 2025 pm 11:36 PM

This article will explain how to improve website performance by analyzing Apache logs under the Debian system. 1. Log Analysis Basics Apache log records the detailed information of all HTTP requests, including IP address, timestamp, request URL, HTTP method and response code. In Debian systems, these logs are usually located in the /var/log/apache2/access.log and /var/log/apache2/error.log directories. Understanding the log structure is the first step in effective analysis. 2. Log analysis tool You can use a variety of tools to analyze Apache logs: Command line tools: grep, awk, sed and other command line tools.

How to connect to the database of apache How to connect to the database of apache Apr 13, 2025 pm 01:03 PM

Apache connects to a database requires the following steps: Install the database driver. Configure the web.xml file to create a connection pool. Create a JDBC data source and specify the connection settings. Use the JDBC API to access the database from Java code, including getting connections, creating statements, binding parameters, executing queries or updates, and processing results.

How to view your apache version How to view your apache version Apr 13, 2025 pm 01:15 PM

There are 3 ways to view the version on the Apache server: via the command line (apachectl -v or apache2ctl -v), check the server status page (http://<server IP or domain name>/server-status), or view the Apache configuration file (ServerVersion: Apache/<version number>).

See all articles