感谢支持
我们一直在努力

Ubuntu 12.10下安装 Submin2和svn

submin是一款通过web的方式管理代码仓库的服务端软件,通过submin可以在web的方式下创建代码仓库,用户和指定权限。使管理者脱离繁琐的仓库管理步骤,不需要花费时间就可以搭建仓库服务器,可视化管理仓库。

Ubuntu 12.10下安装步骤:

1. 使用apt-get安装apache2
sudo apt-get update
sudo apt-get install apache2
开启apache2模块
a2enmod rewrite
a2enmod authn_dbd

2. 安装subversion
sudo apt-get install git-core
sudo apt-get install subversion libapache2-svn

3. 安装submin2
使用apt方式安装submin2,先添加源,修改 /etc/apt/sources.list 在文件最后增加:
deb http://debian.supermind.nl/ current main
运行
wget -q -O – http://supermind.nl/debian.key | apt-key add –
sudo apt-get update
开始安装submin2
sudo apt-get install submin2
4. 配置 submin2
submin2的初始化,输入命令
sudo submin2-admin /home/www initenv myname@mymail.com
然后根据提示一路默认回车,这样就完成新仓库的初始化
路径/home/www将存放submin的配置,/home/www下会生成svn子目录做为仓库根,存放将来创建的项目。
创建后的目录如下:
root@ubuntu:/home/www# ll
总用量 36
drwx—— 9 www-data www-data 4096  3月 22 16:02 ./
drwxr-xr-x 7 root    root    4096  3月 22 16:02 ../
drwx—— 2 www-data www-data 4096  3月 22 16:02 auth/
drwxr-x— 2 www-data www-data 4096  3月 22 16:02 cgi-bin/
drwxr-x— 2 www-data www-data 4096  3月 22 16:18 conf/
drwx—— 2 www-data www-data 4096  3月 22 16:02 git/
drwx—— 2 www-data www-data 4096  3月 22 16:02 hooks/
drwx—— 3 www-data www-data 4096  3月 22 16:17 svn/
drwx—— 2 www-data www-data 4096  3月 22 16:02 trac/
root@ubuntu:/home/www#

myname@mymail.com用来接收submin创建用户时接收第一次密码验证链接和密码,这样就完成了 submin2安装和初始化。

5. 开始配置apache2使用submin2
cd /etc/apache2/conf.d/
ln -s /home/www/conf/apache-webui-cgi.conf apache-submin-cgi.conf
root@Ubuntu:/etc/apache2/conf.d# ln -s /home/www/conf/apache-svn.conf apache-svn.conf
root@ubuntu:/etc/apache2/mods-enabled# ln -s ../mods-available/authz_svn.load authz_svn.load

service apache2 restart

root@ubuntu:/home/svn# submin2-admin /home/www initenv jackey.jiao@infowarelab.com

Please provide a location for the Subversion repositories. For new Subversion
repositories, the default setting is ok. If the path is not absolute, it will
be relative to the submin environment. If you want to use an existing
repository, please provide the full pathname to the Subversion parent
directory (ie. /var/lib/svn).

Path to the repository? [svn]>

Please provide a location for the git repositories. For new git repositories,
the default setting is ok. If the path is not absolute, it will be relative to
the submin environment. If you want to use an existing repository, please
provide the full pathname to the git parent directory (ie. /var/lib/git).

Path to the git repositories? [git]>

Please provide a location for the parent dir of Trac environments. For a new
installation, the default setting is ok. If you don’t want to use Trac, the
default setting is also ok. For existing Trac environments, please provide
the full path.

Path to trac environment? [trac]>

Please provide a hostname that can be used to reach the web interface. This
hostname will be used in communication to the user (a link in email, links
in the web interface).

Hostname? [ubuntu]>

The HTTP path tells Submin where the website is located relative to the root.
This is needed for proper working of the website. Submin will be accesible
from /submin, Subversion will be accessible from /svn.
If you use Trac, it will be accessible from /trac.

HTTP base? [/]>
Apache files created:
/home/www/conf/apache-webui-cgi.conf
/home/www/conf/apache-webui-wsgi.conf
/home/www/conf/apache-svn.conf
/home/www/conf/apache-trac-modPython.conf
/home/www/conf/apache-trac-cgi.conf
/home/www/conf/apache-trac-fcgid.conf
/home/www/conf/apache-trac-modwsgi.conf

6. 开始使用submin2
在客户端的浏览器上输入
http://localhost/submin就会出现submin的登录界面,在用户名框输入admin,输入任意密码,提交,系统提示密码错误。
进入邮箱打开邮件链接,进行密码重置。

7. 遇到问题:
问题1:
—————————————–
Please include the relevent files in your apache config. If you have
selected to generate all files (recommended), do not include all files,
but only select one version (e.g. svn and webui-cgi but not webui-wsgi).

Also make sure that you have the appropriate modules installed and enabled.
Depending on your choices, these may include: mod_dav_svn, mod_authz_svn,
mod_authn_dbd, mod_dbd, mod_wsgi, mod_cgi, mod_cgid and mod_python
Traceback (most recent call last):
File “/usr/bin/submin2-admin”, line 6, in
success = sa.run()
File “/usr/lib/python2.7/dist-packages/submin/subminadmin/subminadmin.py”, line 82, in run
return self.execute(self.argv[2:])
File “/usr/lib/python2.7/dist-packages/submin/subminadmin/subminadmin.py”, line 158, in execute
rc = Class.run()
File “/usr/lib/python2.7/dist-packages/submin/subminadmin/c_initenv.py”, line 200, in run
self.interactive()
File “/usr/lib/python2.7/dist-packages/submin/subminadmin/c_initenv.py”, line 118, in interactive
self.create_env()
File “/usr/lib/python2.7/dist-packages/submin/subminadmin/c_initenv.py”, line 178, in create_env
self.sa.execute([‘trac’, ‘init’])
File “/usr/lib/python2.7/dist-packages/submin/subminadmin/subminadmin.py”, line 158, in execute
rc = Class.run()
File “/usr/lib/python2.7/dist-packages/submin/subminadmin/c_trac.py”, line 96, in run
subcmd(self.argv[1:])
File “/usr/lib/python2.7/dist-packages/submin/subminadmin/c_trac.py”, line 39, in subcmd_init
if not trac.exists():
File “/usr/lib/python2.7/dist-packages/submin/subminadmin/trac.py”, line 17, in exists
return trac.tracAdminExists()
File “/usr/lib/python2.7/dist-packages/submin/models/trac.py”, line 61, in tracAdminExists
if e.errno == e.errno.ENOENT: # could not find executable
AttributeError: ‘int’ object has no attribute ‘ENOENT’

修改/usr/lib/python2.7/dist-packages/submin/models/trac.py文件,将if e.errno == e.errno.ENOENT: # could not find executable修改为if e.errno == os.errno.ENOENT: # could not find executable

错误2:
——————————————————–
root@ubuntu:/etc/apache2/conf.d# service apache2 restart
Syntax error on line 45 of /etc/apache2/conf.d/apache-svn.conf:
Invalid command ‘AuthzSVNAccessFile’, perhaps misspelled or defined by a module not included in the server configuration
Action ‘configtest’ failed.
The Apache error log may have more information.
…fail!
通过加载root@ubuntu:/etc/apache2/mods-enabled# ln -s ../mods-available/authz_svn.load authz_svn.load 解决

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

赞(0) 打赏
转载请注明出处:服务器评测 » Ubuntu 12.10下安装 Submin2和svn
分享到: 更多 (0)

听说打赏我的人,都进福布斯排行榜啦!

支付宝扫一扫打赏

微信扫一扫打赏