
Installing TRAC on FreeBSD for Beginners
The trac project
I will not describe its capabilities and why this system is needed, everything is off. website ( http://trac.edgewall.org ) or Wikipedia .
I will only consider installation and configuration in detail for beginners (the article is dedicated to a friend Enver from Ryazan, who might still be useful to someone), whoever has already encountered this benefit will not bring this article.
FreeBSD + SVN + Apache2 + Trac Bundle
For beginners, more about the bunch and the way it works
All sources of the software under development are in SVN (it is convenient to see all the changes and it is always easy to roll back if necessary).
Trac is a system that provides the possibility of interactive work primarily with the svn repository, as well as the wiki (not counting additional modules).
Installation
First we put Apache 2.2 Download and install the python mod Next SVN Installing Trac and the webadmin module, if desired, you can install other modules, at your discretion
cd /usr/ports/www/apache22
make WITH_BERKELEYDB=db42 install
cd /tmp
fetch http://www.apache.org/dist/httpd/modpython/mod_python-3.3.1.tgz
tar -xvf mod_python-3.3.1.tgz
cd mod_python-3.3.1
./configure
make
make install
rm -R mod_python-3.3.1 mod_python-3.3.1.tgz
cd /usr/ports/devel/subversion
make WITH_MOD_DAV_SVN= install
cd /usr/ports/www/trac
make install
cd /usr/ports/www/trac-webadmin/
make install
Customization
Теперь когда все установлено приступаем к настройке, для начала настроим Subversion.
Создаем директорию для хранения репозиториев, т.к. мы будем юзать доступ через апач с модулем WebDav, то лучше хранить их в папке с правами группы апача
mkdir /usr/local/www/repository
создаем проект
svnadmin create /usr/local/www/repository/project_name
рекурсивно назначаем права группы и пользователя apache
chown -R www:www /usr/local/www/repository
создаем файл с пользователями и паролями
htpasswd -c /usr/local/etc/project_name.passwd user_name
для добавления пользователя та же самая команда, но без ключа -c
Переходим к Apache
проверим включен ли mod_dav_svn в конфиге апача
edit /usr/local/etc/apache22/httpd.conf
(должна быть строка вида LoadModule dav_svn_module libexec/apache22/mod_dav_svn.so)там же добавляем ниже
LoadModule python_module libexec/apache22/mod_python.so
еще ниже раскомменчиваем сроку
Include etc/apache22/extra/httpd-vhosts.conf
сохраняем…
open the file with virtual hosts
edit /usr/local/etc/apache22/extra/httpd-vhosts.conf
and
save the changes and restart the apache we
check the repository for work through the browser and SVN client (I use Subcommander and SmartSVN for Linux and Windows, respectively) server_ip / svn / project_name well and using the user names you created.NameVirtualHost *:80
ServerAdmin webmaster@project_name.ru
DocumentRoot "/usr/local/www/trac/htdocs"
ServerName trac.project_name.ru
ErrorLog "/var/log/trac.project_name.ru-error_log"
AuthType Basic
AuthName "Subversion repository"
AuthUserFile /usr/local/etc/project_name.passwd
Require valid-user
DAV svn
SVNParentPath /usr/local/www/repository
apachectl restart
Next, create a project in Trac
create a folder for projects, copy the statics and create the project itself, fill it out, install according to the instructions, the name of the project the default database is used sqlite just click (for other databases the information here http://trac.edgewall.org/wiki/DatabaseBackend ) repository type: svn path to the repository: / usr / local / www / repository / project_name the rest is by default ... open the project’s config file for editing, find the directives and set new values and add the webadmin module at the end; more about all the directives here we assign trac.edgewall.org/wiki/TracIni administrator rights to one of the users make project synchronization
cd /usr/local/www
mkdir trac
cd trac
mkdir -pv /usr/local/www/trac/htdocs/i
cp -R /usr/local/share/trac/htdocs/* /usr/local/www/trac/htdocs/i
echo "Project Name" >> /usr/local/www/trac/htdocs/index.html
trac-admin project_name initenv
edit /usr/local/www/trac/project_name/conf/trac.ini
htdocs_location = /i/
default_charset = utf-8
base_url =http://server_ip/project_name
[components]
webadmin.* = enabled
trac-admin /usr/local/www/trac/project_name permission add user_name TRAC_ADMIN
trac-admin /usr/local/www/trac/project_name resync
after installation, we again assign the rights to the folder with the projects. We
chown -R www:www /usr/local/www/trac
check the functionality of Trac
tracd --port 8000 /usr/local/www/trac/project_name
and watch it in the browser http: // server_ip: 8000.To complete the process, use the combination
If everything works fine, then you need Trac to start the apache ...
Open it again for editing
edit /usr/local/etc/apache22/extra/httpd-vhosts.conf
Add Reboot the apache again and open the browser in http: // server_ip / project_name We go under the admin login and put things in order do not forget to set permissions for http: // users trac.edgewall.org/wiki/TracPermissions For Linux systems, only the installation process and file paths are different. You can run several projects on one server, so just create a new project in svn and trac and add them to httpd-vhosts.conf P.S .:
SetHandler mod_python
PythonInterpreter main_interpreter
PythonHandler trac.web.modpython_frontend
PythonOption TracEnv/usr/local/www/trac/project_name
PythonOption TracUriRoot /project_name
The article was written with the greatest simplification for understanding the initial Linux users, therefore, comments that “it’s better to do this” or “it will be safer this way” can be omitted, because I assumed that the server on the local network of the company, and not on the Internet ...