{"id":570,"date":"2006-05-27T18:54:09","date_gmt":"2006-05-27T16:54:09","guid":{"rendered":"http:\/\/www.marblestation.com\/blog\/?p=570"},"modified":"2012-04-26T22:08:45","modified_gmt":"2012-04-26T20:08:45","slug":"trac-subversion-a-ubuntu","status":"publish","type":"post","link":"https:\/\/www.marblestation.com\/?p=570","title":{"rendered":"Trac (subversion) a Ubuntu"},"content":{"rendered":"<p><a href=\"http:\/\/www.edgewall.com\/trac\/\">Trac<\/a> \u00e9s un sistema integrat per gestionar projectes de software que proporciona:<\/p>\n<ol>\n<li>Interf\u00edcie web pel sistema subversion.<\/li>\n<li>Gesti\u00f3 de bugs.<\/li>\n<li>Gesti\u00f3 de sol\u00b7licituds.<\/li>\n<li>Planificaci\u00f3 en el temps.<\/li>\n<li>Generaci\u00f3 de documentaci\u00f3 estil wiki.<\/li>\n<\/ol>\n<p>Instal\u00b7laci\u00f3:<\/p>\n<pre>\r\naptitude install trac libapache2-svn\r\n<\/pre>\n<p>Creem el fitxer de configuraci\u00f3 per Apache \u201c\/etc\/apache2\/sites-available\/trac\u201d amb el contingut:<br \/>\n<!--more--><\/p>\n<pre>\r\n&#60;VirtualHost *>\r\n        ServerAdmin webmaster@localhost\r\n        ServerName trac.example.com\r\n        DocumentRoot \/usr\/share\/trac\/cgi-bin\/\r\n        &#60;Directory \/usr\/share\/trac\/cgi-bin\/>\r\n                Options Indexes FollowSymLinks MultiViews ExecCGI\r\n                AllowOverride All\r\n                Order allow,deny\r\n                allow from all\r\n        &#60;\/Directory>\r\n        Alias \/trac \"\/usr\/share\/trac\/htdocs\"\r\n\r\n        &#60;Location \/trac.cgi>\r\n            SetEnv TRAC_ENV_PARENT_DIR \"\/var\/trac\"\r\n        &#60;\/Location>\r\n\r\n        DirectoryIndex trac.cgi\r\n        ErrorLog \/var\/log\/apache2\/error.trac.log\r\n        CustomLog \/var\/log\/apache2\/access.trac.log combined\r\n&#60;\/VirtualHost>\r\n<\/pre>\n<p>Descomentar del fitxer \u201c\/etc\/apache2\/apache2.conf\u201d la l\u00ednia:<\/p>\n<pre>\r\n# To use CGI scripts outside \/cgi-bin\/:\r\n#\r\nAddHandler cgi-script .cgi\r\n<\/pre>\n<p>Activem la configuraci\u00f3 que acabem de crear i desactivem el site que configura Apache per defecte:<\/p>\n<pre>\r\na2ensite trac\r\na2dissite default\r\n<\/pre>\n<p>Reiniciem apache:<\/p>\n<pre>\r\n\/etc\/init.d\/apache2 restart\r\n<\/pre>\n<p>Creem el repositori subversion relacionat i afegim un projecte:<\/p>\n<pre>\r\nmkdir \/var\/svn\r\nsvnadmin create \/var\/svn\r\ncd \/tmp\r\nmkdir projecte\/\r\ncd projecte\/\r\necho Hello > Hola.cs\r\nsvn import . -m \"Inici\"  file:\/\/\/var\/svn\/projecte\r\ncd\r\nrm -rf \/tmp\/projecte\r\n<\/pre>\n<p>Inicialitzem l&#8217;entorn per Trac:<\/p>\n<pre>\r\ncd \/var\/trac\/\r\ntrac-admin \/var\/trac\/projecte initenv\r\n<\/pre>\n<p>A les preguntes contestem:<\/p>\n<pre>\r\nCreating a new Trac environment at \/var\/trac\/projecte\r\n\r\nTrac will first ask a few questions about your environment\r\nin order to initalize and prepare the project database.\r\n\r\n Please enter the name of your project.\r\n This name will be used in page titles and descriptions.\r\n\r\nProject Name [My Project]> El meu projecte\r\n\r\n Please specify the connection string for the database to use.\r\n By default, a local SQLite database is created in the environment\r\n directory. It is also possible to use an already existing\r\n PostgreSQL database (check the Trac documentation for the exact\r\n connection string syntax).\r\n\r\nDatabase connection string [sqlite:db\/trac.db]>\r\n\r\n Please specify the absolute path to the project Subversion repository.\r\n Repository must be local, and trac-admin requires read+write\r\n permission to initialize the Trac database.\r\n\r\nPath to repository [\/var\/svn\/test]> \/var\/svn\/projecte\r\n\r\n Please enter location of Trac page templates.\r\n Default is the location of the site-wide templates installed with Trac.\r\n\r\nTemplates directory [\/usr\/share\/trac\/templates]>\r\n\r\nCreating and Initializing Project\r\n Configuring Project\r\n ...\r\n\r\n---------------------------------------------------------------------\r\nProject environment for 'El meu projecte' created.\r\n\r\nYou may now configure the environment by editing the file:\r\n\r\n  \/var\/trac\/projecte\/conf\/trac.ini\r\n\r\nIf you'd like to take this new project environment for a test drive,\r\ntry running the Trac standalone web server `tracd`:\r\n\r\n  tracd --port 8000 \/var\/trac\/projecte\r\n\r\nThen point your browser to http:\/\/localhost:8000\/projecte.\r\nThere you can also browse the documentation for your installed\r\nversion of Trac, including information on further setup (such as\r\ndeploying Trac to a real web server).\r\n\r\nThe latest documentation can also always be found on the project\r\nwebsite:\r\n\r\n  http:\/\/projects.edgewall.com\/trac\/\r\n\r\nCongratulations!\r\n<\/pre>\n<p>Donem permisos per a que es pugui modificar el contingut del directori des de la web:<\/p>\n<pre>\r\nchown -R www-data \/var\/trac\/projecte\/\r\n<\/pre>\n<p>Ara ja es possible accedir a \u201chttp:\/\/localhost\/\u201d on es mostrar\u00e0 un llistat de tots el projectes disponibles, en el nostre cas nom\u00e9s hi haur\u00e0 \u201cEl meu projecte\u201d.<\/p>\n<p>Per permetre acc\u00e9s per password cal afegir a \u201c\/etc\/apache2\/sites-available\/trac\u201d (abans de \u201c\u201d):<\/p>\n<pre>\r\n\t&#60;Location \"\/trac.cgi\/*\/login\">\r\n            AuthType Basic\r\n            AuthName \"Trac\"\r\n            AuthUserFile \/etc\/apache2\/dav_svn.passwd\r\n            Require valid-user\r\n       &#60;\/Location>\r\n<\/pre>\n<p>Crearem el fitxer \u201c\/etc\/apache2\/dav_svn.passwd\u201d amb el usuaris \u201cuser1\u201d i \u201cuser2\u201d:<\/p>\n<pre>\r\nhtpasswd2 -c \/etc\/apache2\/dav_svn.passwd user1\r\nhtpasswd2 \/etc\/apache2\/dav_svn.passwd user2\r\n<\/pre>\n<p>A cada usuari podem assignar-li una serie de permisos a Trac, per aix\u00f2 utilitzarem la comanda trac-admin:<\/p>\n<pre>\r\n# trac-admin \/var\/trac\/projecte\/\r\nTrac [\/var\/trac\/projecte]> permission list\r\n...\r\nTrac [\/var\/trac\/projecte]> permission add user1 TRAC_ADMIN\r\nTrac [\/var\/trac\/projecte]> quit\r\n<\/pre>\n<p>Al fer \u201cpermission list\u201d es pot veure el llistat d&#8217;usuaris amb els seus permisos. L&#8217;usuari anonymous sempre existeix i representa tots els usuaris que no s&#8217;han identificat, si volguessim fer que tothom s&#8217;hagi d&#8217;identificar podr\u00edem treure tots el permisos a anonymous.<\/p>\n<p>Per habilitar l&#8217;acc\u00e9s normal subversion (amb perm\u00eds de lectura per tothom) cal afegir a \u201c\/etc\/apache2\/sites-available\/trac\u201d (abans de \u201c\u201d):<\/p>\n<pre>\r\n\t&#60;Location \/svn\/>\r\n            DAV svn\r\n            SVNPath \/var\/svn\/\r\n            AuthType Basic\r\n            AuthName \"Subversion Repository\"\r\n            AuthUserFile \/etc\/apache2\/dav_svn.passwd\r\n            &#60;LimitExcept GET PROPFIND OPTIONS REPORT>\r\n                Require valid-user\r\n            &#60;\/LimitExcept>\r\n        &#60;\/Location>\r\n<\/pre>\n<p>Els usuaris son els mateixos que per l&#8217;aplicaci\u00f3 Trac, donat que aquests es defineixen al fitxer \u201c\/etc\/apache2\/dav_svn.passwd\u201d tal i com ja hem vist.<\/p>\n<p>Ara podr\u00edem fer una copia local del repositori amb:<\/p>\n<pre>\r\nsvn checkout http:\/\/localhost\/svn\/projecte\r\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>Trac \u00e9s un sistema integrat per gestionar projectes de software que proporciona: Interf\u00edcie web pel sistema subversion. Gesti\u00f3 de bugs. Gesti\u00f3 de sol\u00b7licituds. Planificaci\u00f3 en el temps. Generaci\u00f3 de documentaci\u00f3 estil wiki. Instal\u00b7laci\u00f3: aptitude install trac libapache2-svn Creem el fitxer de configuraci\u00f3 per Apache \u201c\/etc\/apache2\/sites-available\/trac\u201d amb el contingut:<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4,6],"tags":[],"class_list":["post-570","post","type-post","status-publish","format-standard","hentry","category-catala","category-tecnologia"],"_links":{"self":[{"href":"https:\/\/www.marblestation.com\/index.php?rest_route=\/wp\/v2\/posts\/570","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.marblestation.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.marblestation.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.marblestation.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.marblestation.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=570"}],"version-history":[{"count":2,"href":"https:\/\/www.marblestation.com\/index.php?rest_route=\/wp\/v2\/posts\/570\/revisions"}],"predecessor-version":[{"id":1924,"href":"https:\/\/www.marblestation.com\/index.php?rest_route=\/wp\/v2\/posts\/570\/revisions\/1924"}],"wp:attachment":[{"href":"https:\/\/www.marblestation.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=570"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.marblestation.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=570"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.marblestation.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=570"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}