Linux 下 Trac SVN apache SSL 配置安装以及整合[网络技术]
本文“Linux 下 Trac SVN apache SSL 配置安装以及整合[网络技术]”是由七道奇为您精心收集,来源于网络转载,文章版权归文章作者所有,本站不对其观点以及内容做任何评价,请读者自行判断,以下是其具体内容:
trac + SVN + apache(SSL) 安装
1. 简介:
由于项目需求,所以要布置一台Trac并且和现有的SVN整合. 至于什么是Trac和SVN,就不多介绍了.
2. 安装步骤:
(1) 安装apache(此步骤略)
(2) 安装SVN
shell > wget http://subversion.tigris.org/downloads/subversion-1.5.6.tar.gz
shell > tar zxvf subversion-1.5.6.tar.gz
shell > cd subversion
shell > ./configure –with-apxs=/usr/local/apache/bin/apxs –prefix=/usr/local/svn –with-apr=/usr/local/apache –with-apr-util=/usr/local/apache –with-
ssl –enable-maintainer-mode –without-berkeley-db PYTHON=/usr/bin/python –with-swig=/usr/bin/swig –enable-shared –enable-static –enable-swig-
binding=python
shell > make && make install
(3) 配置apache:
成立证书:
shell > maker /usr/local/apache/conf/key
shell > cd /usr/local/apache/conf/key
shell > openssl genrsa -out xuan-lu.key 1024
shell > chmod 600 /usr/local/apache/key/xuan-lu.key
shell > openssl req -new -key xuan-lu.key -out xuan-lu.csr
You are about to be asked to enter information that will be incorporated
into your certificate request.
What you are about to enter is what is called a Distinguished Name or a DN.
There are quite a few fields but you can leave some blank
For some fields there will be a default value,
If you enter ‘.’, the field will be left blank.
—–
Country Name (2 letter code) [GB]:CN
State or Province Name (full name) [Berkshire]:China
Locality Name (eg, city) [Newbury]:Shang Hai
Organization Name (eg, company) [My Company Ltd]:99 Roses
Organizational Unit Name (eg, section) []:99 Roses
Common Name (eg, your name or your server’s hostname) []:xuan-lu
Email Address []:martin@xuan-lu.net
Please enter the following ‘extra’ attributes
to be sent with your certificate request
A challenge password []:xuan-lu
An optional company name []:xuan-lu
shell > openssl x509 -req -days 365 -in xuan-lu.csr -signkey xuan-lu.key -out xuan-lu.crt
shell > ls
xuan-lu.crt xuan-lu.csr xuan-lu.key
配置apache:
shell > /usr/local/apache/bin/htpasswd -c /home/svn/user/svn_user.conf martin
New password:
Re-type new password:
Adding password for user martin
shell > vi /usr/local/apache/conf/httpd.conf
撤消对下的ssl的注释:
# Secure (SSL/TLS) connections
Include conf/extra/httpd-ssl.conf
shell > vi /usr/local/apache/conf/extra/httpd-ssl.conf
增添以下:
<VirtualHost *:443>
ServerName svn.xuan-lu.net
SSLEngine on
SSLCertificateFile "/usr/local/apache/key/xuan-lu.crt"
SSLCertificateKeyFile "/usr/local/apache/key/xuan-lu.key"
<Location />
DAV svn
SVNPath /home/svn/xuan-lu/
AuthType Basic
AuthName "xuan-lu!!! SVN"
AuthUserFile /home/svn/user/svn_user.conf
AuthzSVNAccessFile /home/svn/xuan-lu/conf/authz
Require valid-user
</Location>
</VirtualHost>
shell > service httpd restart
注: 注释下SVN 的权限配置文件的利用
[groups]
admin = martin
user_r = user_1
user_rw = user_2
[/]
* =
@admin = rw
[/xuan-lu]
@user_r = r
@user_rw = rw
用户辨别分为admin,user_r和user_rw三个组,此中只有admin组用户对/(根)目录有读写权限,组user_r对/99rose目录仅唯一读的权限,而组user_rw对/xuan-lu目录具有读写
的权限.按照差别的需求可以定制差别的权限,这里不多做介绍.
(2) 安装trac
shell > cd /home/tools/subversion (个人习惯在/home/目录下成立一个tools目录用来安排源码包)
shell > make swig-py
shell > make install-swig-py
shell > echo /usr/local/svn/lib/svn-python > /usr/lib/python2.4/site-packages/subversion.pth
考证svn-python (没报错便可)
shell > python
>>>import svn.repos
>>>
shell > cd /home/tools/
shell > wget http://ftp.edgewall.com/pub/trac/Trac-0.11.5.tar.gz
shell > tar zxvf Trac-0.11.5.tar.gz
shell > cd Trac-0.11.5
shell > wget http://pypi.python.org/packages/2.4/s/setuptools/setuptools-0.6c9-py2.4.egg#md5=260a2be2e5388d66bdaee06abec6342a
shell > sh setuptools-0.6c9-py2.4.egg
shell > python ./setup.py install
生成 trac
shell > trac-admin /home/svn/trac_xuan-lu initenv
Creating a new Trac environment at /home/svn/trac_xuan-lu
Trac will first ask a few questions about your environment
in order to initialize and prepare the project database.
Please enter the name of your project.
This name will be used in page titles and descriptions.
Project Name [My Project]> 99 Roses !!!
Please specify the connection string for the database to use.
By default, a local SQLite database is created in the environment
directory. It is also possible to use an already existing
PostgreSQL database (check the Trac documentation for the exact
connection string syntax).
Database connection string [sqlite:db/trac.db]>
Please specify the type of version control system,
By default, it will be svn.
If you don’t want to use Trac with version control integration,
choose the default here and don’t specify a repository directory.
in the next question.
Repository type [svn]>
Please specify the absolute path to the version control
repository, or leave it blank to use Trac without a repository.
You can also set the repository location later.
Path to repository [/path/to/repos]> /home/svn/xuan-lu
… …
配置Apache( 安装mod_python 以及配置 trac)
shell > cd /home/tools/
shell > wget http://apache.freelamp.com/httpd/modpython/mod_python-3.3.1.tgz
shell > ./configure –with-apxs=/usr/local/apache/bin/apxs
shell > vi vi src/connobject.c
… …
141 while ((bytes_read < len || len == 0) &&
142 !(b == APR_BRIGADE_SENTINEL(bb) ||
143 APR_BUCKET_IS_EOS(b) || APR_BUCKET_IS_FLUSH(b))) {
… …
改正142行为上所示(原为 !(b == APR_BRIGADE_SENTINEL(b) || )
不然会报以下错误:
… …
connobject.c:142: error: request for member ……in something not a structure or union
apxs:Error: Command failed with rc=65536
.
make[1]: *** [mod_python.so] Error 1
make[1]: Leaving directory `/home/tools/mod_python-3.3.1/src’
make: *** [do_dso] Error 2
shell > make && make install
shell > vi /usr/local/apache/conf/httpd.conf
… …
LoadModule python_module modules/mod_python.so
… …
配置虚拟主机:
shell > vi /usr/local/apache/conf/extra/httpd-vhosts.conf
<VirtualHost *:80>
DocumentRoot /home/svn/trac_xuan-lu
ServerName trac.xuan-lu.net
<Location "/">
SetHandler mod_python
PythonInterpreter main_interpreter
PythonHandler trac.web.modpython_frontend
PythonOption TracEnv /home/svn/trac_xuan-lu
PythonOption TracUriRoot /
AuthType Basic
AuthName "xuan-luTrac Server"
AuthUserFile /home/svn/user/svn_user.conf
Require valid-user
</Location>
<Directory "/home/svn/trac_xuan-lu">
AllowOverride All
Order Deny,Allow
</Directory>
</VirtualHost>
翻开IE 输入:http://trac.xuan-lu.net 考证能否存在问题
到此为止 trac 和 apache 以及 SVN 的整合 已经完毕 下面将介绍一些简单的改正.
1. 开启trac 的webadmin功效:
shell > vi /home/svn/trac_xuan-lu/conf/trac.ini
在配置文件末尾加上
[components]
webadmin.* = enabled
赐与martin 用户 webadmin 权限:
shell > trac-admin /home/svn/trac_xuan-lu/
Welcome to trac-admin 0.11.5
Interactive Trac administration console.
Copyright (c) 2003-2009 Edgewall Software
Type: ‘?’ or ‘help’ for help on commands.
Trac [/home/svn/trac_xuan-lu]> permission add martin TRAC_ADMIN
Trac [/home/svn/trac_xuan-lu]>
革新页面用martin用户登录,就会发现,多了admin选项
2. 更改trac左上方的logo
shell > vi /home/svn/trac_xuan-lu/conf/trac.ini
… …
[header_logo]
alt = (please configure the [header_logo] section in trac.ini)
height = -1
link = /
src =
width = -1
… …
3. Trac整合SVN用户权限:
shell > vi /home/svn/trac_xuan-lu/conf/trac.ini
… …
[trac]
authz_file = /home/svn/xuan-lu/conf/authz
authz_module_name = xuan-lu
… …
4. 办理trac中SVN源文件乱码问题:
shell >
… …
[trac]
default_charset = utf-8 (本来为:iso-8859-15)
… …
6. 用户权限配置:
(1) 利用martin登录
(2) 挑选admin
(3) 挑选左侧:Permissions选项
(4) 可以看到配置用户的权限选项了(界面的右侧)
权限按照自己实际需求去举行操作:
BROWSER_VIEW # 查看版本库
CHANGESET_VIEW # 查看改正记录
FILE_VIEW # 查看文件内容
LOG_VIEW # 查看日记
MILESTONE_VIEW # 查看里程杯
REPORT_SQL_VIEW # 查看报告查询语句
REPORT_VIEW # 查看报告
ROADMAP_VIEW # 查看路标
SEARCH_VIEW # 显示查找
TICKET_CREATE # 成立任务单
TICKET_MODIFY # 改正任务单
TICKET_VIEW # 显示任务单
TIMELINE_VIEW # 查看时间
WIKI_CREATE # 成立wiki
WIKI_MODIFY # 改正wiki
WIKI_VIEW # 查看wiki
以上是“Linux 下 Trac SVN apache SSL 配置安装以及整合[网络技术]”的内容,如果你对以上该文章内容感兴趣,你可以看看七道奇为您推荐以下文章:
本文地址: | 与您的QQ/BBS好友分享! |