你好,游客 登录 注册 搜索
背景:
阅读新闻

Ubuntu下ViewVC安装配置

[日期:2014-01-15] 来源:Linux社区  作者:Linux [字体:大 中 小]

4. http访问

a) 整合apache(需要mod_cgi)

假设你已经建立了一个虚拟机配置文件
vi /etc/apache2/sites-enabled/svn.sends.cc.conf

</VirtualHost>前加入
##############
    ScriptAlias /viewvc /usr/local/viewvc-1.1.2/bin/cgi/viewvc.cgi
    ScriptAlias /query /usr/local/viewvc-1.1.2/bin/cgi/query.cgi
        <Directory "/usr/local/viewvc-1.1.2/bin/cgi">
                AllowOverride None
                Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
                Order allow,deny
                Allow from all
        </Directory>
##############

/etc/init.d/apache2 restart

或拷贝viewvc.cgi到apache的cgi-bin目录下通过http://10.3.37.110/cgi-bin/viewvc.cgi访问

假设我的cgi-bin目录指向/usr/lib/cgi-bin/
cp /usr/local/viewvc-1.1.2/bin/cgi/* /usr/lib/cgi-bin/
/etc/init.d/apache2 restart

或用apache的mod_python。把/usr/local/viewvc-1.1.2/bin/mod_python/*拷贝到你需要的地方访问viewvc.py。因为有个.htaccess文件,请注意“AllowOverride All”设置。

有access control的apache配置(推荐)

假设你已经建立了一个虚拟机配置文件
vi /etc/apache2/sites-enabled/svn.sends.cc.conf

</VirtualHost>前加入
##############
    ScriptAlias /viewvc /usr/local/viewvc-1.1.2/bin/cgi/viewvc.cgi
    ScriptAlias /query /usr/local/viewvc-1.1.2/bin/cgi/query.cgi
        <Directory "/usr/local/viewvc-1.1.2/bin/cgi">
                AllowOverride None
                Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
                Order allow,deny
                Allow from all
        </Directory>
      <Location /viewvc>
#        AllowOverride None
        AuthUserFile /etc/apache2/dav_svn.passwd
        AuthName "Viewvc Of Sendslab"
        AuthType Basic
        require valid-user
      </Location>
##############

创建访问用户
htpasswd -m /etc/apache2/dav_svn.passwd test

b) 用viewvc自带standalone.py提供http访问

/usr/local/viewvc-1.1.2/bin/standalone.py -h 10.3.37.110 -d -c /usr/local/viewvc-1.1.2/viewvc.conf

standalone.py帮助
root@soft:~# /usr/local/viewvc-1.1.2/bin/standalone.py --help
ERROR: option --help not recognized

Usage: standalone.py [OPTIONS]

Run a simple, standalone HTTP server configured to serve up ViewVC
requests.

Options:

  --config-file=PATH (-c)    Use the file at PATH as the ViewVC configuration
                            file.  If not specified, ViewVC will try to use
                            the configuration file in its installation tree;
                            otherwise, built-in default values are used.
                            (Not valid in GUI mode.)
                           
  --daemon (-d)              Background the server process.
 
  --host=HOST (-h)          Start the server listening on HOST.  You need
                            to provide the hostname if you want to
                            access the standalone server from a remote
                            machine.  [default: localhost]

  --port=PORT (-p)          Start the server on the given PORT.
                            [default: 49152]

  --repository=PATH (-r)    Serve up the Subversion or CVS repository located
                            at PATH.  This option may be used more than once.

  --script-alias=PATH (-s)  Specify the ScriptAlias, the artificial path
                            location that at which ViewVC appears to be
                            located.  For example, if your ScriptAlias is
                            "cgi-bin/viewvc", then ViewVC will be accessible
                            at "http://localhost:49152/cgi-bin/viewvc".
                            [default: viewvc]
 
  --gui (-g)                Pop up a graphical interface for serving and
                            testing ViewVC.  NOTE: this requires a valid
                            X11 display connection.

更多Ubuntu相关信息见Ubuntu 专题页面 http://www.linuxidc.com/topicnews.aspx?tid=2

linux
相关资讯       ViewVC 
本文评论   查看全部评论 (0)
表情: 表情 姓名: 字数

       

评论声明
  • 尊重网上道德,遵守中华人民共和国的各项有关法律法规
  • 承担一切因您的行为而直接或间接导致的民事或刑事法律责任
  • 本站管理人员有权保留或删除其管辖留言中的任意内容
  • 本站有权在网站内转载或引用您的评论
  • 参与本评论即表明您已经阅读并接受上述条款