Linux 下 Trac SVN apache SSL 配置安装以及整合

简介: trac + SVN + apache(SSL) 安装 1. 简介:    由于项目需求,所以要部署一台Trac并且和现有的SVN整合.

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 = http://www.xuan-lu.net/logo.jpg
     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

目录
相关文章
|
11月前
|
Ubuntu Linux 网络安全
Linux服务器之Ubuntu的安装与配置
Ubuntu Desktop是目前最成功、最流行的图形界面的Linux发行版;而Ubuntu Server也在服务器端市场占据了较大的份额。今天为大家详细介绍了Ubuntu Server的安装与配置,希望对你能有所帮助。关于VMware、VirtualBox等虚拟化软件的使用,朱哥还会在后续的文章中为大家详细介绍,敬请关注!
|
9月前
|
存储 Linux 开发工具
Linux环境下使用Buildroot配置软件包
使用Buildroot可以大大简化嵌入式Linux系统的开发和维护工作,但它需要对Linux系统和交叉编译有深入的理解。通过上述步骤,可以有效地配置和定制软件包,为特定的嵌入式应用构建高效、稳定的系统。
996 11
|
Kubernetes Linux 网络安全
Rocky Linux 8.9配置Kubernetes集群详解,适用于CentOS环境
初始化成功后,记录下显示的 `kubeadm join`命令。
858 0
|
关系型数据库 MySQL Java
安装和配置JDK、Tomcat、MySQL环境,以及如何在Linux下更改后端端口。
遵循这些步骤,你可以顺利完成JDK、Tomcat、MySQL环境的安装和配置,并在Linux下更改后端端口。祝你顺利!
747 11
|
Java Linux 开发工具
Linux下版本控制器(SVN) -命令行客户端
Linux下版本控制器(SVN) -命令行客户端
420 4
|
Linux
Linux下版本控制器(SVN) -服务器端环境搭建步骤
Linux下版本控制器(SVN) -服务器端环境搭建步骤
537 0
Linux下版本控制器(SVN) -服务器端环境搭建步骤
|
关系型数据库 MySQL Linux
查看Linux、Apache、MySQL、PHP版本的技巧
以上就是查看Linux、Apache、MySQL、PHP版本信息的方法。希望这些信息能帮助你更好地理解和使用你的LAMP技术栈。
660 17
|
安全 Linux 网络安全
在Linux(CentOS和AWS)上安装更新的git2的方法并配置github-ssh
经过以上这些步骤,你现在就能在GitHub上顺利往返,如同海洋中的航海者自由驰骋。欢迎你加入码农的世界,享受这编程的乐趣吧!
630 10
|
Linux 网络安全 开发工具
在Linux下配置gitee与Github的远程仓库
注意,git push后,是输入你的账号与密码。这个步骤可以通过特殊设置省去,但是一开始还是不要太省。
689 0
|
关系型数据库 MySQL Linux
MySQL 数据库linux系统下修改配置文件设置mysql是否大小写敏感实例演示
MySQL 数据库linux系统下修改配置文件设置mysql是否大小写敏感实例演示
518 0
MySQL 数据库linux系统下修改配置文件设置mysql是否大小写敏感实例演示