Creating a new Trac project via trac-admin initenv

爱⌒轻易说出口 提交于 2020-01-04 05:15:36

问题


I'm somewhat new to Trac. I'm running trac version 0.11.7 on an ubuntu system.

I'm trying to create another project via the following command:

"trac-admin /var/lib/trac/shipping_tracker initenv".

After answering the various questions, the program fails and returns an error ( see: http://pastebin.com/yijzpB3i ) "Table 'system' already exists"

Does this mean that every-time I need to create a new project, I'll have to go into the mysql database and create a new database, like trac1, trac2, etc??

I did notice this particular ticket ( http://trac.edgewall.org/ticket/5138 ) where someone states you have to create a new database for each project. Is this correct??

Thank you.

--Mike


回答1:


Every Trac environment, being a completely self-contained space, uses a separate database. So yes, you need to create a new database for each environment (although it might be a bad idea to name them trac1, trac2 etc.).

If you want to create new environments often, what you really need is probably multi-project support, which allows you to have different projects within one environment. However, it is still not done as of Trac 0.13, and is planned for 0.14.

You might also want to read about various ideas on having multiple projects with Trac. One of them deals with making Trac store multiple environments in a single database, though it might be outdated and probably breaks automatic updates.




回答2:


I am using Trac 1.0, running as a stand-alone server, and in order to run multiple projects on one trac installation you still need to set up new environment using

trac-admin /path/to/trac/yournewpoject initenv

... then create .htpasswd file in the /path/to/trac/yournewpoject dir, add users using

htpasswd /path/to/trac/yournewpoject/.htpasswd newuser

(or copy an existing .htpasswd file there) ... and then restart trac with similar to the followin command:

python /path/to/tracd --user=yourlinuxuser --group=yourlinuxgroup -d \
-b hostname -p 8000 \
--basic-auth=oldproject,/path/to/trac/oldproject/.htpasswd,realmname \
--basic-auth=yournewpoject,/path/to/trac/yournewpoject/.htpasswd,realmname \
/path/to/trac/oldproject \
/path/to/trac/yournewpoject

This is valid in case you are using the same type of basic authentication as I do.



来源:https://stackoverflow.com/questions/7150591/creating-a-new-trac-project-via-trac-admin-initenv

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!