天天看點

windows環境下 apache+mysql+svn安裝配置1                準備軟體2                建立資料庫3                配置httpd.conf4                重新開機apache5                參考文檔

先安裝apahce、mysql、svn

其中svn建立winsow服務的指令如下(可以将%SVN_HOME%換為svn的真實路徑)

sc create svn binpath= "%SVN_HOME%\bin\svnserve.exe--service -r D:\SVNRepository" displayname= "Subversion Server"depend= Tcpip start= auto

1                準備軟體

mod_auth_mysql.so       http://202.116.160.97/apache/modules/

其大小為1.4M左右,注意要找window版本的,若是linux版本的則加載不了。

可以在google中輸入mod_auth_mysql.sointitle:"index of" 進行搜尋

注意選擇與apache版本一緻的mod_auth_mysql.so,如apache 2.0.x或apache 2.2.x

2                建立資料庫

create database apache_auth;

use apache_auth;

create table mysql_auth(

username char(25),

passwd char(100),

primary key (username)

);

insert into mysql_auth(username,passwd)values('test', MD5("123"));

3                配置httpd.conf

把mod_auth_mysql.so複制到Apache SoftwareFoundation\Apache2.2\modules檔案夾下。

在httpd.conf中加載子產品,注意要寫成mysql_auth_module,否則會報出

類似   Can't locate API module structure`mod_auth_mysql'    這樣的錯誤

以下為httpd.conf添加的新内容

LoadModule mysql_auth_modulemysql_modules/mod_auth_mysql.so

<Location /svn>

DAV svn

SVNListParentPath on

SVNParentPath D:\svn

AuthType Basic

AuthName "Subversionrepositories"

AuthzSVNAccessFile "D:\ProgramFiles\Apache Software Foundation\Apache2.2\svnaccessfile"

AuthMySQLHost localhost

AuthMySQLDB apache_auth

AuthMySQLUser informix

AuthMySQLPassword 123456

AuthMySQLPort 3306

AuthMySQLUserTable mysql_auth

AuthMySQLNameField username

AuthMySQLPasswordField passwd

AuthMySQLEnable On

AuthMySQLPwEncryption md5

Require valid-user

</Location>

4                重新開機apache

插入資料

編輯svn權限控制檔案,例如

D:\Program Files\Apache SoftwareFoundation\Apache2.2\svnaccessfile檔案

5                參考文檔

svn結合apache使用http://svnbook.red-bean.com/nightly/en/svn.serverconfig.httpd.html