Mailing List Archive

Trac to host multiple SVN repositories
Hi

We brought up SVN 1.14.1 on RHEL9.X and Trac 1.5.4. The production server
hosts multiple SVN repositories and need to enable trac to support the same.
The server supports apache and followed the Trac documentation for the
installation steps, configuring mod_wsgi, deployment for CGI/WSGI scripts.

SVN: /opt/svn/repo1, /opt/svn/repo2, /opt/svn/repo3
Trac: /opt/trac/repo1, /opt/trac/repo2, /opt/trac/repo3

https://trac.edgewall.org/wiki/TracInstall#cgi-bin

mkdir -p /opt/trac
trac-admin /opt/trac/repo1 initenv
trac-admin /opt/trac/repo1 deploy /var/www
ls /var/www
cgi-bin htdocs
chmod ugo+x /var/www/cgi-bin/*


*trac-admin /opt/trac/be2_sw_new initenv*
Creating a new Trac environment at /opt/trac/be2_sw_new

Trac will first ask a few questions about your environment
in order to initialize and prepare the project database.

Please enter the name of your project.
This name will be used in page titles and descriptions.

Project Name [My Project]> be2_sw_new

Please specify the connection string for the database. By default,
a local SQLite database is created in the environment directory.
It is also possible to use an existing MySQL or PostgreSQL database
(check the Trac documentation for the connection string syntax).

Database connection string [sqlite:db/trac.db]>

Project environment for 'be2_sw_new' created.

You may configure the environment by editing the file:

/opt/trac/be2_sw_new/conf/trac.ini

You can run the Trac standalone web server `tracd` and point
your browser to http://localhost:8000/be2_sw_new.

tracd --port 8000 /opt/trac/be2_sw_new

Navigate to "Help/Guide" to browse the documentation for Trac,
including information on further setup (such as deploying Trac
to a real web server).

The latest documentation can also be found on the project
website:

https://trac.edgewall.org/

# ls /opt/trac/
be2_sw_new
# *trac-admin /opt/trac/be2_sw_new deploy /var/www/*
Copying resources from:
trac.web.chrome.Chrome
/usr/local/lib/python3.9/site-packages/trac/htdocs
/opt/trac/be2_sw_new/htdocs
Creating scripts.

$ cat /var/www/cgi-bin/trac.wsgi
#!/usr/bin/python3
import os

def application(environ, start_request):
if not 'trac.env_parent_dir' in environ:
environ.setdefault('trac.env_path', '/opt/trac/be2_sw_new')
if 'PYTHON_EGG_CACHE' in environ:
os.environ['PYTHON_EGG_CACHE'] = environ['PYTHON_EGG_CACHE']
elif 'trac.env_path' in environ:
os.environ['PYTHON_EGG_CACHE'] = \
os.path.join(environ['trac.env_path'], '.egg-cache')
elif 'trac.env_parent_dir' in environ:
os.environ['PYTHON_EGG_CACHE'] = \
os.path.join(environ['trac.env_parent_dir'], '.egg-cache')
from trac.web.main import dispatch_request
return dispatch_request(environ, start_request)

Updated the /opt/trac/be2_sw_new/trac/conf.ini file with the below info.
[repositories]
.dir = /opt/svn/be2_sw_new
.sync_per_request = true

[components]
tracopt.versioncontrol.svn.svn_fs.subversionconnector = enabled
tracopt.versioncontrol.svn.svn_prop.subversionmergepropertydiffrenderer =
enabled
tracopt.versioncontrol.svn.svn_prop.subversionmergepropertyrenderer =
enabled
tracopt.versioncontrol.svn.svn_prop.subversionpropertyrenderer = enabled

configuration data added in the apache config file.








*WSGIScriptAlias /trac /var/www/cgi-bin/trac.wsgi<Directory
/var/www/cgi-bin> WSGIApplicationGroup %{GLOBAL} # For Apache 2.4
<IfModule mod_authz_core.c> Require all granted
</IfModule></Directory>*

Standalone tracd server for be2_sw_new is accessible over
http://127.0.0.1:8000/be2_sw_new and could able to view the test commits
after running the command

* tracd --port 8000 /opt/trac/be2_sw_new*

However, we need the support to access multiple repositories over trac to
view the changeset and other features. Any help is highly appreciated.




Thanks
Pradeep

--
You received this message because you are subscribed to the Google Groups "Trac Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to trac-users+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/trac-users/d2a31a30-76dd-41db-8594-b70f7c414bf5n%40googlegroups.com.
Re: Trac to host multiple SVN repositories [ In reply to ]
On Friday, August 18, 2023 at 9:55:38?AM UTC-7 mvvlp...@gmail.com wrote:

Hi

We brought up SVN 1.14.1 on RHEL9.X and Trac 1.5.4. The production server
hosts multiple SVN repositories and need to enable trac to support the same.
The server supports apache and followed the Trac documentation for the
installation steps, configuring mod_wsgi, deployment for CGI/WSGI scripts.

SVN: /opt/svn/repo1, /opt/svn/repo2, /opt/svn/repo3
Trac: /opt/trac/repo1, /opt/trac/repo2, /opt/trac/repo3

https://trac.edgewall.org/wiki/TracInstall#cgi-bin

mkdir -p /opt/trac
trac-admin /opt/trac/repo1 initenv
trac-admin /opt/trac/repo1 deploy /var/www
ls /var/www
cgi-bin htdocs
chmod ugo+x /var/www/cgi-bin/*


*trac-admin /opt/trac/be2_sw_new initenv*
Creating a new Trac environment at /opt/trac/be2_sw_new

Trac will first ask a few questions about your environment
in order to initialize and prepare the project database.

Please enter the name of your project.
This name will be used in page titles and descriptions.

Project Name [My Project]> be2_sw_new

Please specify the connection string for the database. By default,
a local SQLite database is created in the environment directory.
It is also possible to use an existing MySQL or PostgreSQL database
(check the Trac documentation for the connection string syntax).

Database connection string [sqlite:db/trac.db]>

Project environment for 'be2_sw_new' created.

You may configure the environment by editing the file:

/opt/trac/be2_sw_new/conf/trac.ini

You can run the Trac standalone web server `tracd` and point
your browser to http://localhost:8000/be2_sw_new.

tracd --port 8000 /opt/trac/be2_sw_new

Navigate to "Help/Guide" to browse the documentation for Trac,
including information on further setup (such as deploying Trac
to a real web server).

The latest documentation can also be found on the project
website:

https://trac.edgewall.org/

# ls /opt/trac/
be2_sw_new
# *trac-admin /opt/trac/be2_sw_new deploy /var/www/*
Copying resources from:
trac.web.chrome.Chrome
/usr/local/lib/python3.9/site-packages/trac/htdocs
/opt/trac/be2_sw_new/htdocs
Creating scripts.

$ cat /var/www/cgi-bin/trac.wsgi
#!/usr/bin/python3
import os

def application(environ, start_request):
if not 'trac.env_parent_dir' in environ:
environ.setdefault('trac.env_path', '/opt/trac/be2_sw_new')
if 'PYTHON_EGG_CACHE' in environ:
os.environ['PYTHON_EGG_CACHE'] = environ['PYTHON_EGG_CACHE']
elif 'trac.env_path' in environ:
os.environ['PYTHON_EGG_CACHE'] = \
os.path.join(environ['trac.env_path'], '.egg-cache')
elif 'trac.env_parent_dir' in environ:
os.environ['PYTHON_EGG_CACHE'] = \
os.path.join(environ['trac.env_parent_dir'], '.egg-cache')
from trac.web.main import dispatch_request
return dispatch_request(environ, start_request)

Updated the /opt/trac/be2_sw_new/trac/conf.ini file with the below info.
[repositories]
.dir = /opt/svn/be2_sw_new
.sync_per_request = true

[components]
tracopt.versioncontrol.svn.svn_fs.subversionconnector = enabled
tracopt.versioncontrol.svn.svn_prop.subversionmergepropertydiffrenderer =
enabled
tracopt.versioncontrol.svn.svn_prop.subversionmergepropertyrenderer =
enabled
tracopt.versioncontrol.svn.svn_prop.subversionpropertyrenderer = enabled

configuration data added in the apache config file.








*WSGIScriptAlias /trac /var/www/cgi-bin/trac.wsgi<Directory
/var/www/cgi-bin> WSGIApplicationGroup %{GLOBAL} # For Apache 2.4
<IfModule mod_authz_core.c> Require all granted
</IfModule></Directory>*

Standalone tracd server for be2_sw_new is accessible over
http://127.0.0.1:8000/be2_sw_new and could able to view the test commits
after running the command

* tracd --port 8000 /opt/trac/be2_sw_new*

However, we need the support to access multiple repositories over trac to
view the changeset and other features. Any help is highly appreciated.




Thanks
Pradeep


You've only specified a default repository, see:
https://trac.edgewall.org/wiki/TracRepositoryAdmin#ReposTracIni

You just need a config like this:

[repositories]
repos1.dir = /opt/svn/repos1
repos1.sync_per_request = true
repos2.dir = /opt/svn/repos2
repos2.sync_per_request = true
...


--
You received this message because you are subscribed to the Google Groups "Trac Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to trac-users+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/trac-users/d0c81368-5330-4a00-b257-9e7ac1822addn%40googlegroups.com.