cd /usr/lib
sudo chown -R www-data:www-data cgi-bin
cd cgi-bin
上面配置使用Apache内建支持的基于htpasswd文件的Basic认证方式,使用/etc/apache2/trac.htpasswd为口令文件,因此需要创建这一文件,并创建用于访问Trac系统的用户名和密码。这通过htpasswd命令完成,如下所示:
cd /etc/apache2
创建apache虚拟机:sudo vi /etc/apache2/sites-available/trac
内容如下:
ServerName wslnxcnhz0286
ServerAdmin [email protected]
DocumentRoot /var/www/CeoCio
SetHandler mod_python
PythonInterpreter main_interpreter
PythonHandler trac.web.modpython_frontend
PythonOption TracEnv /var/www/CeoCio/
PythonOption TracUriRoot /
SetEnv PYTHON_EGG_CACHE /tmp
AuthType Basic
AuthName "CMET_WZU Trac Server"
AuthUserFile /var/www/CeoCio/.htpasswd
Require valid-user
ErrorLog "/var/log/apache2/trac_errors.log"
CustomLog "/var/log/apache2/trac_accesses.log" common
sudo a2dissite default(关闭默认的虚拟机)
sudo a2ensite trac(启动trac虚拟机)
sudo /etc/init.d/apache2 reload (让apache重新登陆)
由于使用了域名,则需要在DNS(域名)服务器上将wslnxcnhz0286指向本机即可,如果没有DNS服务器,又想测试一个效果,可以在/etc/hosts文档中加入以下配置:
127.0.0.1 wslnxcnhz0286
sudo a2enmod python
tracd --port 8000 /var/www/CeoCio
Intall Trac's plugin
最后附上最终的配置文件
/var/www/CeoCio/conf/trac.ini
# -*- coding: utf-8 -*-
[account-manager]
password_file = /var/www/CeoCio/.htpasswd
password_store = HtPasswdStore
[attachment]
max_size = 262144
render_unsafe_content = false
[browser]
downloadable_paths = /trunk, /branches/*, /tags/*
hide_properties = svk:merge
render_unsafe_content = false
[changeset]
max_diff_bytes = 10000000
max_diff_files = 0
wiki_format_messages = true
[components]
acct_mgr.admin.* = enabled
acct_mgr.api.* = enabled
acct_mgr.db.* = enabled
acct_mgr.htfile.* = enabled
acct_mgr.http.* = enabled
acct_mgr.pwhash.* = enabled
acct_mgr.web_ui.* = enabled
acct_mgr.web_ui.emailverificationmodule = disabled
acct_mgr.web_ui.loginmodule = enabled
burndown.* = enabled
burndown.burndown.burndowncomponent = enabled
burndown.burndown_admin_milestones.burndownmilestonesadminpanel = enabled
cc_selector.* = enabled
cc_selector.cc_selector.ticketwebuiaddon = enabled
estimationtools.burndownchart.burndownchart = enabled
estimationtools.hoursinplaceeditor.hoursinplaceeditor = enabled
estimationtools.hoursremaining.hoursremaining = enabled
estimationtools.workloadchart.workloadchart = enabled
flashgantt.flashgantt.flashganttplugin = disabled
iniadmin.* = enabled
talm_importer.* = enabled
talm_importer.importer.importmodule = disabled
timingandestimationplugin.* = enabled
timingandestimationplugin.webui.timingestimationandbillingpage = enabled
trac.notification.notificationsystem = enabled
trac.ticket.notification.ticketnotificationsystem = enabled
tracrpc.* = enabled
tracwysiwyg.* = enabled
webadmin.basics.* = enabled
webadmin.logging.* = enabled
webadmin.perm.* = enabled
webadmin.plugin.* = enabled
webadmin.ticket.* = enabled
webadmin.web_ui.* = enabled
wikiticketcalendarmacro.* = enabled
[header_logo]
alt =
height = -1
link = http://172.16.4.41/
src = common/trac_banner.png
width = -1
[logging]
log_file = trac.log
log_level = INFO
log_type = file
[mimeviewer]
enscript_modes = text/x-dylan:dylan:4
enscript_path = enscript
max_preview_size = 262144
mime_map = text/x-dylan:dylan,text/x-idl:ice,text/x-ada:ads:adb
php_path = php
silvercity_modes =
tab_width = 8
[notification]
always_notify_owner = true
always_notify_reporter = true
always_notify_updater = true
mime_encoding = base64
smtp_always_bcc =
smtp_always_cc =
smtp_default_domain =
smtp_enabled = true
smtp_from = [email protected]
smtp_password =
smtp_port = 25
smtp_replyto =
smtp_server = mail.hengtiansoft.com
smtp_subject_prefix = __default__
smtp_user =
use_public_cc = False
use_short_addr = false
use_tls = false
[project]
descr = My example project
footer = Visit the Trac open source project at
http://trac.edgewall.org/
icon = common/trac.ico
name = CeoCio
url = http://172.16.4.41/
[search]
min_query_length = 3
[ticket]
default_component = General
default_milestone = Tag - rev. 2109
default_priority = major
default_resolution = finished
default_severity = S3
default_type = defect
default_version = 2.0
restrict_owner = true
[ticket-custom]
billable = checkbox
billable.label = Billable?
billable.order = 3
billable.value = 1
estimatedhours = text
estimatedhours.label = Estimated Number of Hours
estimatedhours.order = 1
estimatedhours.value = 0
hours = text
hours.label = Add Hours to Ticket
hours.order = 2
hours.value = 0
internal = checkbox
internal.label = Internal?
internal.order = 5
internal.value = 0
totalhours = text
totalhours.label = Total Hours
totalhours.order = 4
totalhours.value = 0
[ticket-workflow]
accept = new -> assigned
accept.operations = set_owner_to_self
accept.permissions = TICKET_MODIFY
leave = * -> *
leave.default = 1
leave.operations = leave_status
pass = testing -> closed
pass.name = Passes Testing
pass.operations = set_resolution
pass.set_resolution = fixed
reassign = new,assigned,needs_work,reopened -> new
reassign.operations = set_owner
reassign.permissions = TICKET_MODIFY
reject = testing -> needs_work
reject.name = Failed testing, return to developer
reopen = closed -> reopened
reopen.operations = del_resolution
reopen.permissions = TICKET_CREATE
resolve = new,assigned,reopened -> closed
resolve.operations = set_resolution
resolve.permissions = TICKET_MODIFY
testing = new,accepted,needs_work,assigned,reopened -> testing
testing.name = Submit to reporter for testing
testing.permissions = TICKET_MODIFY
[timeline]
changeset_long_messages = false
changeset_show_files = 0
default_daysback = 30
ticket_show_details = false
[trac]
authz_file =
authz_module_name =
base_url = http://172.16.4.41
check_auth_ip = true
database = sqlite:db/trac.db
default_charset = iso-8859-15
default_handler = WikiModule
htdocs_location =
ignore_auth_case = false
mainnav = wiki,timeline,roadmap,browser,tickets,newticket,search
metanav = login,logout,settings,help,about
permission_policies = InternalTicketsPolicy, DefaultPermissionPolicy, LegacyAttachmentPolicy
permission_store = DefaultPermissionStore
timeout = 20
[wiki]
ignore_missing_pages = false
render_unsafe_content = false
split_page_names = false