您的位置:首页 > 运维架构 > Apache

Trac,SVN,apache2安装配置

2013-04-15 20:12 971 查看
Subversion

1. install subversion
#apt-get install subversion


2. create subversion repository folder
#mkdir -p /var/svn/repository


3. create a subversion repository
#svnadmin create /var/svn/repository/myrepos


4. changes the configuration files
#vi /var/svn/repository/myrepos/conf/svnserve.conf
#vi /var/svn/repository/myrepos/conf/authz
#vi /var/svn/repository/myrepos/conf/passwd


5. changes the permissions of myrepos folder
#chmod 777 /var/svn/repository/myrepos -R


Apache2

1. install apache2
#apt-get install apache2


2. install apache2-svn
#apt-get install libapache2-svn


3. create apache2 access folder , create an authorization file for svnserve and create a password for svnserve
#mkdir /etc/apache2/access
#cp /var/svn/repository/myrepos/conf/authz  /etc/apache2/access/svnaccess
#htpasswd -c /etc/apache2/access/userpwd  username


4. changes apache2 dav_svn.conf
# vi /etc/apache2/mods-available/dav_svn.conf

#=======================dav_svn.conf=================================
# dav_svn.conf - Example Subversion/Apache configuration
#
# For details and further options see the Apache user manual and
# the Subversion book.
#
# NOTE: for a setup with multiple vhosts, you will want to do this
# configuration in /etc/apache2/sites-available/*, not here.

# <Location URL> ... </Location>
# URL controls how the repository appears to the outside world.
# In this example clients access the repository as http://hostname/svn/ # Note, a literal /svn should NOT exist in your document root.
<Location /svn>

# Uncomment this to enable the repository
DAV svn

# Set this to the path to your repository
#SVNPath /var/lib/svn
# Alternatively, use SVNParentPath if you have multiple repositories under
# under a single directory (/var/lib/svn/repo1, /var/lib/svn/repo2, ...).
# You need either SVNPath and SVNParentPath, but not both.
SVNParentPath /var/svn/repository

# Access control is done at 3 levels: (1) Apache authentication, via
# any of several methods.  A "Basic Auth" section is commented out
# below.  (2) Apache <Limit> and <LimitExcept>, also commented out
# below.  (3) mod_authz_svn is a svn-specific authorization module
# which offers fine-grained read/write access control for paths
# within a repository.  (The first two layers are coarse-grained; you
# can only enable/disable access to an entire repository.)  Note that
# mod_authz_svn is noticeably slower than the other two layers, so if
# you don't need the fine-grained control, don't configure it.

# Basic Authentication is repository-wide.  It is not secure unless
# you are using https.  See the 'htpasswd' command to create and
# manage the password file - and the documentation for the
# 'auth_basic' and 'authn_file' modules, which you will need for this
# (enable them with 'a2enmod').
AuthType Basic
AuthName "Subversion Repository"
AuthUserFile /etc/apache2/access/userpwd

# To enable authorization via mod_authz_svn
AuthzSVNAccessFile /etc/apache2/access/svnaccess

# The following three lines allow anonymous read, but make
# committers authenticate themselves.  It requires the 'authz_user'
# module (enable it with 'a2enmod').
#<LimitExcept GET PROPFIND OPTIONS REPORT>
Require valid-user
#</LimitExcept>

</Location>
#=======================/dav_svn.conf=================================


5. restart apache2
#/etc/init.d/apache2 restart


6. congratulation, successful, you can browse myrepos by web browser

http://localhost/svn/myrepos/

Trac

1. install trac
#apt-get install trac


2. create myrepos folder for trac
#mkdir /var/trac


3. initialize myrepos for trac
#trac-admin /var/trac/myrepos initenv


4. changes the permissions of myrepos folder for trac
#chmod 777 /var/trac  -R


5. add a site for trac
#vi /etc/apache2/sites-available/trac

#================trac============================
#SSLEngine On
#SSLCertificateFile /etc/apache2/ssl/apache.pem

ScriptAlias /trac /usr/share/trac/cgi-bin/trac.cgi
<Location "/trac">
SetEnv TRAC_ENV_PARENT_DIR "/var/trac"
</Location>
<Directory "/usr/share/trac/htdocs">
Options Indexes MultiViews
AllowOverride None
Order allow,deny
Allow from all
</Directory>
# You need something like this to authenticate users
<LocationMatch "/trac/[^/]+/login">
AuthType Basic
AuthName "trac login"
AuthUserFile /etc/apache2/access/userpwd
Require valid-user
</LocationMatch>
#================/trac===========================

#ln -s /etc/apache2/sites-available/trac  /etc/apache2/sites-enabled/trac


6. restart apache2
# /etc/init.d/apache2 restart


7. congratulation, successful, you can browse trac by web browser

http://localhost/trac


Setup/Configure Subversion,Apache2, Trac under Ubuntu

内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: