我尝试将Trac安装从debian wheezy服务器迁移到另一个debian jessie。
如果我将所有文件复制到新服务器,则会收到消息,我必须使用trac-admin /var/trac/blimus upgrade
进行升级,这似乎可行,但似乎并没有更新所有插件。
例如,我在旧版Trac中安装了一个插件,该插件可让您登录网页,而不是htaccess弹出窗口。
在新服务器上,我现在收到错误消息
Error: Not Found
No handler matched request to /login
如何重新获得网络登录信息?
有没有一种方法可以分析旧的trac文件夹(已安装了哪些插件),因此我可以在新安装的工具中安装缺少的插件?
我检查了新的trac.ini文件并添加了缺少的选项this is my trac.ini
这些是我的版本:
# trac-admin --version
Warning: Detected setuptools version 5.5.1.
Welcome to trac-admin 1.0.2
答案 0 :(得分:1)
如果该插件以plugins
的形式安装在Environment eggs
目录中,那么当您复制环境时,它们将被带到新服务器上。但是,您几乎肯定需要升级到较新的版本,因此我建议从Environment plugins
目录中删除鸡蛋。这些插件也可能已安装在Python的site-packages
中。或者可以使用Debian的软件包管理器安装它们,我不确定那里是否有插件,您可能要使用apt
进行搜索。参见Trac Plugin documentation。
您正在运行哪个版本的Trac?我认为是1.2.3。
您trac.ini
显示已安装3个插件,在Trac 1.2(NeverNotifyUpdaterPlugin)中不再需要其中的一个。您应该安装以下两个:
* AccountManagerPlugin
* XmlRpcPlugin
我不知道Debian是否打包了那些以供分发。如果没有,则可以install them with pip。
答案 1 :(得分:0)
该说明适用于Debian jessie(Trac 1.0.2)和Ubuntu 14.04 trusty(Trac 1.0.1)
# cd ~/
# tar -cvzf trac-example.tgz /var/trac/example
# cp /var/trac/example/conf/trac.ini trac.ini-example
# update your trac.ini-example to match new settings
#!/usr/bin/env bash
####################### config ##############################
INSTALLPATH=/var/trac/example
DEPLOYPATH=/var/www/trac-example
# where you store your tgz backup and the new trac.ini file
BACKUP_PATH=~/
#############################################################
# install packages without user interaction:
export DEBIAN_FRONTEND=noninteractive
apt-get -y install unzip apache2 trac trac-accountmanager trac-xmlrpc libapache2-mod-python libapache2-mod-python-doc libapache2-mod-wsgi
a2dismod python
a2enmod rewrite
# add trac user for apache WSGIDaemonProcess:
adduser --shell /bin/sh --no-create-home --disabled-password trac
mkdir -p /home/trac/.keep-for-mod_wsgi
mkdir -p /var/trac
tar -C /var/trac/ -xvzf $BACKUP_PATH/trac-example.tgz
# copy your new config here:
cp $INSTALLPATH/conf/trac.ini $INSTALLPATH/conf/trac.ini-backup
cp $BACKUP_PATH/trac.ini-example $INSTALLPATH/conf/trac.ini
rm -rf $INSTALLPATH/plugins/nevernotifyupdaterplugin-0.0.* $INSTALLPATH/eggs/*
cd $INSTALLPATH/
trac-admin $INSTALLPATH upgrade
trac-admin $INSTALLPATH wiki upgrade
trac-admin $INSTALLPATH deploy $DEPLOYPATH/
chmod ugo+x $DEPLOYPATH/cgi-bin/ $DEPLOYPATH/htdocs/
# downgrade genshi from 7.3 to 6.0 due to error when adding an attachment:
easy_install -U Genshi==0.6
# upgrade setuptools
easy_install -U setuptools==1.4.2
#(在Trac 1.0.x上仍然需要,在1.2 ist上已过时)
cd /tmp
wget "https://trac-hacks.org/browser/nevernotifyupdaterplugin/1.0?r│
ev=17630&format=zip"
unzip 1.0\?r*
cd 1.0/
python setup.py bdist_egg
cp dist/nevernotifyupdaterplugin-1.0-py2.7.egg $INSTALLPATH/plugins/
VHOST=$(cat <<EOF
<VirtualHost *:80>
Alias /trac/chrome/common $DEPLOYPATH/htdocs/site/common
Alias /trac/chrome/site $DEPLOYPATH/htdocs/site
<Directory "$DEPLOYPATH/htdocs">
Require all granted
</Directory>
<Location "/trac">
SetEnv TRAC_ENV "$INSTALLPATH"
SetEnv PYTHON_EGG_CACHE "$INSTALLPATH/.python-eggs"
SetEnv TRAC_ENV_INDEX_TEMPLATE $INSTALLPATH/templates
</Location>
##trac mit mod_wsgi
WSGIDaemonProcess trac user=trac group=trac threads=25
WSGIScriptAlias /trac $DEPLOYPATH/cgi-bin/trac.wsgi
<Directory $DEPLOYPATH/apache>
WSGIApplicationGroup %{GLOBAL}
Require all granted
</Directory>
<Directory $DEPLOYPATH/cgi-bin>
Require all granted
</Directory>
<Directory $DEPLOYPATH/htdocs/common>
Require all granted
</Directory>
<Directory $DEPLOYPATH/htdocs/site>
Require all granted
</Directory>
</VirtualHost>
EOF
)
echo "${VHOST}" > /etc/apache2/sites-available/trac-example.conf
a2ensite trac-example
在全新安装的系统上,禁用默认的apache配置
rm /etc/apache2/sites-enabled/000-default.conf
然后重新启动apache
service apache2 restart