Instalación de paquetes en ubuntu

Sobre la base de la imagen que me da linode:

sudo apt-get update
sudo apt-get upgrade --show-upgraded
sudo apt-get install language-pack-es bash-completion
sudo apt-get install build-essential
sudo apt-get install apache2 apache2-mpm-prefork
sudo apt-get install postgresql
sudo apt-get install php5 php5-cgi php5-cli php-pear php5-suhosin php5-dev php5-pgsql
sudo apt-get install subversion subversion-tools libapache2-svn libsvn-perl php5-svn \
                     python-svn websvn python-subversion apache2-suexec \
                     libapache2-mod-auth-pgsql libapache2-mod-auth-plain \
                     libapache2-mod-perl2 libapache2-mod-suphp

sudo touch /var/www/favicon.ico /var/www/robots.txt

# paquetes necesarios para el trac
# (no instalo el paquete python-genshi porque es muy viejo, se va a instalar
# la nueva versión sola con el easy_install del trac).
sudo apt-get install python-distribute python-psycopg2 libapache2-mod-wsgi

Creación repositorios svn

Creamos uno para el desarrollo y otro para las configuraciones del server

sudo mkdir -pv /var/svn
sudo svnadmin create --fs-type fsfs /var/svn/devel
sudo svnadmin create --fs-type fsfs /var/svn/config

# permisos amigos del apache 
sudo chown -R www-data:www-data /var/svn/*

Creo un virtual host svn.kalkulisto.com en /etc/apache2/sites-available/svn.kalkulisto.com.conf:

<VirtualHost *:80>
        ServerName svn.kalkulisto.com

        ServerAdmin webmaster@ybab.net

        <Location />
                DAV svn

                # Set this to the path to your repository
                #SVNPath /var/lib/svn
                # Alternatively, use SVNParentPath if you have multiple repositories under
                # under a single directory (/var/lib/svn/repo1, /var/lib/svn/repo2, ...).
                # You need either SVNPath and SVNParentPath, but not both.
                SVNParentPath /var/svn

                SVNListParentPath on

                SVNPathAuthz off

                # Access control is done at 3 levels: (1) Apache authentication, via
                # any of several methods.  A "Basic Auth" section is commented out
                # below.  (2) Apache <Limit> and <LimitExcept>, also commented out
                # below.  (3) mod_authz_svn is a svn-specific authorization module
                # which offers fine-grained read/write access control for paths
                # within a repository.  (The first two layers are coarse-grained; you
                # can only enable/disable access to an entire repository.)  Note that
                # mod_authz_svn is noticeably slower than the other two layers, so if
                # you don't need the fine-grained control, don't configure it.

                # Basic Authentication is repository-wide.  It is not secure unless
                # you are using https.  See the 'htpasswd' command to create and
                # manage the password file - and the documentation for the
                # 'auth_basic' and 'authn_file' modules, which you will need for this
                # (enable them with 'a2enmod').
                AuthType Basic
                AuthName "Subversion Repository"
                AuthUserFile /etc/apache2/dav_svn.passwd

                Require valid-user

                # To enable authorization via mod_authz_svn
                #AuthzSVNAccessFile /etc/apache2/dav_svn.authz

                # The following three lines allow anonymous read, but make
                # committers authenticate themselves.  It requires the 'authz_user'
                # module (enable it with 'a2enmod').
                #<LimitExcept GET PROPFIND OPTIONS REPORT>
                        #Require valid-user
                #</LimitExcept> 

        </Location>

        ErrorLog /var/log/apache2/svn.kalkulisto.com_error.log

        # Possible values include: debug, info, notice, warn, error, crit, alert, emerg.
        LogLevel warn

        CustomLog /var/log/apache2/svn.kalkulisto.com_access.log combined

        ServerSignature On

</VirtualHost>

sudo htpasswd -c /etc/apache2/dav_svn.passwd baby
sudo htpasswd /etc/apache2/dav_svn.passwd emilio

Habilito el virtual host y restarteo el apache

sudo a2ensite svn.kalkulisto.com.conf
sudo invoke-rc.d apache2 restart

Instalación del trac

Instalo de acuerdo a las instrucciones en http://trac.edgewall.org/wiki/TracInstall

sudo easy_install Babel==0.9.5
sudo easy_install Trac

Esto instaló Babel, Genshi y Trac en /usr/local/lib/python2.6/dist-packages

Creación del environment

sudo -u postgres createuser --password --pwprompt --createdb --createrole --echo trac_db_admin

La salida es más o menos así:

Enter password for new role: <poner_clave_para_el_nuevo_usuario_de_la_base>
Enter it again: <repetir_clave_para_el_nuevo_usuario_de_la_base>
Shall the new role be a superuser? (y/n) n
Password: <no_poner_nada>
CREATE ROLE trac_db_admin PASSWORD 'md5_alguna_zaraza_hexadecimal_hashd' NOSUPERUSER CREATEDB CREATEROLE INHERIT LOGIN;

Las 2 primeras veces hay que poner la clave que se desesa para el usuario de la base de datos. Hay que contestar no cuando pregunta si debe ser un superuser y cuando pide una última clave está pidiendo la del usuario postgres, ahí no hay que poner nada porque se autentica con ident.

createdb --host localhost --username trac_db_admin --password --owner trac_db_admin --echo -E UTF8 trac_db

La salida es más o menos así:

Password: <la_clave_del_usuario_trac_db_admin>
CREATE DATABASE trac_db OWNER trac_db_admin ENCODING 'UTF8';

sudo mkdir -pv /var/trac
sudo trac-admin /var/trac/trac.kalkulisto.com initenv

La salida es algo así:

Creating a new Trac environment at /var/vhost-www/trac.kalkulisto.com

Trac will first ask a few questions about your environment 
in order to initialise 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]> Kalkulisto
 
 Please specify the connection string for the database to use.
 By default, a local SQLite database is created in the environment
 directory. It is also possible to use an already existing
 PostgreSQL database (check the Trac documentation for the exact
 connection string syntax).

Database connection string [sqlite:db/trac.db]> postgres://trac_db_admin:<la_clave_de_trac_db_admin>@localhost:5432/trac_db

Creating and initialising project
 Installing default wiki pages
  TracGuide imported from /usr/local/lib/python2.6/dist-packages/Trac-0.12.2-py2.6.egg/trac/wiki/default-pages/TracGuide
  TracPermissions imported from /usr/local/lib/python2.6/dist-packages/Trac-0.12.2-py2.6.egg/trac/wiki/default-pages/TracPermissions
  SandBox imported from /usr/local/lib/python2.6/dist-packages/Trac-0.12.2-py2.6.egg/trac/wiki/default-pages/SandBox
  TracRss imported from /usr/local/lib/python2.6/dist-packages/Trac-0.12.2-py2.6.egg/trac/wiki/default-pages/TracRss
  WikiMacros imported from /usr/local/lib/python2.6/dist-packages/Trac-0.12.2-py2.6.egg/trac/wiki/default-pages/WikiMacros
  TracEnvironment imported from /usr/local/lib/python2.6/dist-packages/Trac-0.12.2-py2.6.egg/trac/wiki/default-pages/TracEnvironment
  InterWiki imported from /usr/local/lib/python2.6/dist-packages/Trac-0.12.2-py2.6.egg/trac/wiki/default-pages/InterWiki
  TitleIndex imported from /usr/local/lib/python2.6/dist-packages/Trac-0.12.2-py2.6.egg/trac/wiki/default-pages/TitleIndex
  CamelCase imported from /usr/local/lib/python2.6/dist-packages/Trac-0.12.2-py2.6.egg/trac/wiki/default-pages/CamelCase
  TracInstall imported from /usr/local/lib/python2.6/dist-packages/Trac-0.12.2-py2.6.egg/trac/wiki/default-pages/TracInstall
  TracLogging imported from /usr/local/lib/python2.6/dist-packages/Trac-0.12.2-py2.6.egg/trac/wiki/default-pages/TracLogging
  TracCgi imported from /usr/local/lib/python2.6/dist-packages/Trac-0.12.2-py2.6.egg/trac/wiki/default-pages/TracCgi
  TracQuery imported from /usr/local/lib/python2.6/dist-packages/Trac-0.12.2-py2.6.egg/trac/wiki/default-pages/TracQuery
  TracBrowser imported from /usr/local/lib/python2.6/dist-packages/Trac-0.12.2-py2.6.egg/trac/wiki/default-pages/TracBrowser
  TracUpgrade imported from /usr/local/lib/python2.6/dist-packages/Trac-0.12.2-py2.6.egg/trac/wiki/default-pages/TracUpgrade
  TracTickets imported from /usr/local/lib/python2.6/dist-packages/Trac-0.12.2-py2.6.egg/trac/wiki/default-pages/TracTickets
  TracIni imported from /usr/local/lib/python2.6/dist-packages/Trac-0.12.2-py2.6.egg/trac/wiki/default-pages/TracIni
  TracImport imported from /usr/local/lib/python2.6/dist-packages/Trac-0.12.2-py2.6.egg/trac/wiki/default-pages/TracImport
  TracNavigation imported from /usr/local/lib/python2.6/dist-packages/Trac-0.12.2-py2.6.egg/trac/wiki/default-pages/TracNavigation
  TracStandalone imported from /usr/local/lib/python2.6/dist-packages/Trac-0.12.2-py2.6.egg/trac/wiki/default-pages/TracStandalone
  WikiNewPage imported from /usr/local/lib/python2.6/dist-packages/Trac-0.12.2-py2.6.egg/trac/wiki/default-pages/WikiNewPage
  TracFastCgi imported from /usr/local/lib/python2.6/dist-packages/Trac-0.12.2-py2.6.egg/trac/wiki/default-pages/TracFastCgi
  TracChangeset imported from /usr/local/lib/python2.6/dist-packages/Trac-0.12.2-py2.6.egg/trac/wiki/default-pages/TracChangeset
  WikiRestructuredText imported from /usr/local/lib/python2.6/dist-packages/Trac-0.12.2-py2.6.egg/trac/wiki/default-pages/WikiRestructuredText
  TracLinks imported from /usr/local/lib/python2.6/dist-packages/Trac-0.12.2-py2.6.egg/trac/wiki/default-pages/TracLinks
  RecentChanges imported from /usr/local/lib/python2.6/dist-packages/Trac-0.12.2-py2.6.egg/trac/wiki/default-pages/RecentChanges
  TracModPython imported from /usr/local/lib/python2.6/dist-packages/Trac-0.12.2-py2.6.egg/trac/wiki/default-pages/TracModPython
  TracWiki imported from /usr/local/lib/python2.6/dist-packages/Trac-0.12.2-py2.6.egg/trac/wiki/default-pages/TracWiki
  WikiFormatting imported from /usr/local/lib/python2.6/dist-packages/Trac-0.12.2-py2.6.egg/trac/wiki/default-pages/WikiFormatting
  TracBackup imported from /usr/local/lib/python2.6/dist-packages/Trac-0.12.2-py2.6.egg/trac/wiki/default-pages/TracBackup
  TracWorkflow imported from /usr/local/lib/python2.6/dist-packages/Trac-0.12.2-py2.6.egg/trac/wiki/default-pages/TracWorkflow
  InterMapTxt imported from /usr/local/lib/python2.6/dist-packages/Trac-0.12.2-py2.6.egg/trac/wiki/default-pages/InterMapTxt
  TracReports imported from /usr/local/lib/python2.6/dist-packages/Trac-0.12.2-py2.6.egg/trac/wiki/default-pages/TracReports
  WikiHtml imported from /usr/local/lib/python2.6/dist-packages/Trac-0.12.2-py2.6.egg/trac/wiki/default-pages/WikiHtml
  WikiDeletePage imported from /usr/local/lib/python2.6/dist-packages/Trac-0.12.2-py2.6.egg/trac/wiki/default-pages/WikiDeletePage
  TracSupport imported from /usr/local/lib/python2.6/dist-packages/Trac-0.12.2-py2.6.egg/trac/wiki/default-pages/TracSupport
  TracRevisionLog imported from /usr/local/lib/python2.6/dist-packages/Trac-0.12.2-py2.6.egg/trac/wiki/default-pages/TracRevisionLog
  WikiStart imported from /usr/local/lib/python2.6/dist-packages/Trac-0.12.2-py2.6.egg/trac/wiki/default-pages/WikiStart
  TracModWSGI imported from /usr/local/lib/python2.6/dist-packages/Trac-0.12.2-py2.6.egg/trac/wiki/default-pages/TracModWSGI
  TracAccessibility imported from /usr/local/lib/python2.6/dist-packages/Trac-0.12.2-py2.6.egg/trac/wiki/default-pages/TracAccessibility
  TracUnicode imported from /usr/local/lib/python2.6/dist-packages/Trac-0.12.2-py2.6.egg/trac/wiki/default-pages/TracUnicode
  TracSyntaxColoring imported from /usr/local/lib/python2.6/dist-packages/Trac-0.12.2-py2.6.egg/trac/wiki/default-pages/TracSyntaxColoring
  WikiPageNames imported from /usr/local/lib/python2.6/dist-packages/Trac-0.12.2-py2.6.egg/trac/wiki/default-pages/WikiPageNames
  TracInterfaceCustomization imported from /usr/local/lib/python2.6/dist-packages/Trac-0.12.2-py2.6.egg/trac/wiki/default-pages/TracInterfaceCustomization
  PageTemplates imported from /usr/local/lib/python2.6/dist-packages/Trac-0.12.2-py2.6.egg/trac/wiki/default-pages/PageTemplates
  TracTimeline imported from /usr/local/lib/python2.6/dist-packages/Trac-0.12.2-py2.6.egg/trac/wiki/default-pages/TracTimeline
  TracAdmin imported from /usr/local/lib/python2.6/dist-packages/Trac-0.12.2-py2.6.egg/trac/wiki/default-pages/TracAdmin
  TracNotification imported from /usr/local/lib/python2.6/dist-packages/Trac-0.12.2-py2.6.egg/trac/wiki/default-pages/TracNotification
  WikiRestructuredTextLinks imported from /usr/local/lib/python2.6/dist-packages/Trac-0.12.2-py2.6.egg/trac/wiki/default-pages/WikiRestructuredTextLinks
  WikiProcessors imported from /usr/local/lib/python2.6/dist-packages/Trac-0.12.2-py2.6.egg/trac/wiki/default-pages/WikiProcessors
  TracRoadmap imported from /usr/local/lib/python2.6/dist-packages/Trac-0.12.2-py2.6.egg/trac/wiki/default-pages/TracRoadmap
  InterTrac imported from /usr/local/lib/python2.6/dist-packages/Trac-0.12.2-py2.6.egg/trac/wiki/default-pages/InterTrac
  TracTicketsCustomFields imported from /usr/local/lib/python2.6/dist-packages/Trac-0.12.2-py2.6.egg/trac/wiki/default-pages/TracTicketsCustomFields
  TracSearch imported from /usr/local/lib/python2.6/dist-packages/Trac-0.12.2-py2.6.egg/trac/wiki/default-pages/TracSearch
  TracPlugins imported from /usr/local/lib/python2.6/dist-packages/Trac-0.12.2-py2.6.egg/trac/wiki/default-pages/TracPlugins
  TracFineGrainedPermissions imported from /usr/local/lib/python2.6/dist-packages/Trac-0.12.2-py2.6.egg/trac/wiki/default-pages/TracFineGrainedPermissions
  TracRepositoryAdmin imported from /usr/local/lib/python2.6/dist-packages/Trac-0.12.2-py2.6.egg/trac/wiki/default-pages/TracRepositoryAdmin

---------------------------------------------------------------------
Project environment for 'Kalkulisto' created.

You may now configure the environment by editing the file:

  /var/trac/trac.kalkulisto.com/conf/trac.ini

If you'd like to take this new project environment for a test drive,
try running the Trac standalone web server `tracd`:

  tracd --port 8000 /var/trac/trac.kalkulisto.com

Then point your browser to http://localhost:8000/trac.kalkulisto.com.
There you can also browse the documentation for your installed
version of Trac, including information on further setup (such as
deploying Trac to a real web server).

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

  http://trac.edgewall.org/

Congratulations!

mkdir -pv /var/vhost-www
sudo trac-admin /var/trac/trac.kalkulisto.com deploy /var/vhost-www/trac.kalkulisto.com

La salida es así:

Copying resources from:
  trac.web.chrome.Chrome
    /usr/local/lib/python2.6/dist-packages/Trac-0.12.2-py2.6.egg/trac/htdocs
    /var/trac/trac.kalkulisto.com/htdocs
Creating scripts.

sudo chgrp www-data /var/trac/trac.kalkulisto.com/conf/trac.ini
sudo chmod g+r /var/trac/trac.kalkulisto.com/conf/trac.ini

<VirtualHost *:80>
        ServerName trac.kalkulisto.com

        ServerAdmin webmaster@ybab.net

        Alias /trac/chrome/common /var/vhost-www/trac.kalkulisto.com/htdocs/common
        Alias /trac/chrome/site /var/vhost-www/trac.kalkulisto.com/htdocs/site

        <Directory /var/vhost-www/trac.kalkulisto.com/htdocs>
                Order allow,deny
                Allow from all
        </Directory>

        WSGIScriptAlias /trac /var/vhost-www/trac.kalkulisto.com/cgi-bin/trac.wsgi

        <Directory /var/vhost-www/trac.kalkulisto.com/cgi-bin>
                WSGIApplicationGroup %{GLOBAL}
                Order deny,allow
                Allow from all
        </Directory>

        <Location /trac/login>
                AuthType Basic
                AuthName "Kalkulisto trac"
                AuthUserFile /etc/apache2/dav_svn.passwd
                Require valid-user
        </Location>

        ErrorLog /var/log/apache2/trac.kalkulisto.com_error.log

        # Possible values include: debug, info, notice, warn, error, crit, alert, emerg.
        LogLevel warn

        CustomLog /var/log/apache2/trac.kalkulisto.com_access.log combined

        ServerSignature On

</VirtualHost>

sudo a2ensite trac.kalkulisto.com.conf
sudo invoke-rc.d apache2 restart

sudo trac-admin /var/trac/trac.kalkulisto.com permission add baby TRAC_ADMIN
sudo trac-admin /var/trac/trac.kalkulisto.com permission add emilio TRAC_ADMIN

InstalacionKalkulisto (última edición 2011-05-14 20:01:02 efectuada por MarianoAbsatz)