Edgewall Software

Changes between Version 12 and Version 13 of TracOnSLES9


Ignore:
Timestamp:
Feb 22, 2015, 11:38:48 AM (5 years ago)
Author:
figaro
Comment:

Cosmetic changes

Legend:

Unmodified
Added
Removed
Modified
  • TracOnSLES9

    v12 v13  
    1 = Trac on SuSE Linux Enterprise 9 =
    2 
    3 '''Warning: always start by reading the generic TracInstall instructions, which contains up-to-date installation instructions. In particular, the following instructions were current when Trac was at version 0.9'''
     1= Trac on SuSE Linux Enterprise 9
     2
     3'''Warning: Read the generic TracInstall instructions for the up-to-date installation instructions. In particular, the following instructions were current when Trac was at version 0.9'''
    44
    55'''Update: These instructions also work with Trac 0.10.3.1, Subversion 1.3.2 and !ClearSilver 0.10.4'''
    66
    7 There are a number of reasons that setting up a Trac installation on SLES9 is somewhat painful.  This documentation is meant to alleviate some of this pain, outlining what was an effective process for me.  My particular scenario is a dual EM64T Xeon (x86_64) machine, which complicated things only slightly, in my experience.  It may be possible to optimize the binaries with some -march=nocona trickery, but I haven't been so daring to date. The configure scripts may already be taking care of this.
    8 
    9 I tried to find a configuration that would be 100% YaST-able (with offical packages), but fell a bit short.  The most substantial problems I found were:
     7My particular scenario is a dual EM64T Xeon (x86_64) machine. It may be possible to optimize the binaries with some `-march=nocona` trickery. The configure scripts may already be taking care of this.
     8
     9I tried to find a configuration that would be 100% YaST-able with official packages, but the most substantial problems I found were:
    1010
    1111 * The obvious absence of a Trac package
     
    1414 * The Python/SWIG bindings are not configured in the Subversion package
    1515
    16 I had thought the Novell SLES SDK (http://developer.novell.com/wiki/index.php/SLES_SDK) would be a good starting point, but it seems that the only relevant package is the Subversion RPM that lacks SWIG support.  Coupled with the other dependencies, I realized I had to build some things from the ground up.
    17 
    18 '''NOTE:''' Since I already have existing installations of Trac on Apache/mod_python, that is the most familiar configuration for me.  You may want to use FastCGI, lighttpd, or some other configuration.  The steps here should still be applicable for building the required components for Trac.  Things will be a little different on 32-bit systems and may even be different for AMD 64-bit platforms.  Use what helps you and contribute what might help others.
    19 
    20 = 1. YaST-able Prerequisites =
    21 
    22 In an attempt to keep as much as possible under the system management outlined by SuSE and YaST, I used packaged versions of Apache, Python, and mod_python.  The packages and versions I used were:
     16The [http://developer.novell.com/wiki/index.php/SLES_SDK Novell SLES SDK] would be a good starting point, but it seems that the only relevant package is the Subversion RPM that lacks SWIG support. Coupled with the other dependencies, I realized I had to build some things from the ground up. The following is a Apache/mod_python based installation.
     17
     18== YaST-able prerequisites
     19
     20In an attempt to keep as much as possible under the system management outlined by SuSE and YaST, the following packages were used:
    2321
    2422 * '''apache2'''              2.0.49-27.8
     
    2725 * '''libapr0'''              2.0.49-27.8
    2826 * '''apache2-mod_python'''   3.1.3-37.1
    29 
    3027 * '''python'''               2.3.3-88.1
    3128 * '''python-devel'''         2.3.3-88.1
    32 
    3329 * '''zlib-devel'''           1.2.1-70.12
    3430
    35 I used apache2-prefork because I also use PHP4, which is not recommended for use with apache2-worker due to threading issues.  apache2-devel provides APXS2, which is used in setting up the Apache modules for Subversion.  python-devel is required to use distutils, which are used in setting up pysqlite.  zlib-devel is required for ClearSilver 10.4 (http://tech.groups.yahoo.com/group/ClearSilver/message/761).
    36 
    37 
    38 = 2. Package Build Order =
    39 
    40 The build/install order is somewhat flexible, since Trac has a number of first-level dependencies, rather than a chain.  This order is rather arbitrary.  You may also elect to choose somewhat different versions, within the limits of the support of Trac.  I haven't tried many alternative configurations.  I know the versions I used here work cleanly.
    41 
    42 As a precautionary note: I was relatively cavalier regarding installation and library paths, some being in the more traditional `/usr/local`, some finding their way to `/usr/lib64`, and so on.  You may wish to specify `--prefix=[somewhere]` for all `./configure` scripts and decide where better to place things.
    43 
    44 == 2.1: SQLite (3.27 and 3.3.13 known to be ok) ==
    45 
     31I used apache2-prefork because I also use PHP4, which is not recommended for use with Apache2-worker due to threading issues. Apache2-devel provides APXS2, which is used in setting up the Apache modules for Subversion. Python-devel is required to use distutils, which are used in setting up Pysqlite. zlib-devel is required for ClearSilver 10.4 (http://tech.groups.yahoo.com/group/ClearSilver/message/761).
     32
     33== Package Build Order
     34
     35The build/install order is somewhat flexible, since Trac has a number of first-level dependencies, rather than a chain. This order is rather arbitrary. You may also choose different versions, within the limits of the support of Trac. I know the versions I used here work cleanly.
     36
     37'''Note''': I was relatively cavalier regarding installation and library paths, some being in the more traditional `/usr/local`, some finding their way to `/usr/lib64`, and so on. You may wish to specify `--prefix=[somewhere]` for all `./configure` scripts and decide where better to place things.
     38
     39=== SQLite (3.27 and 3.3.13 known to be ok)
    4640
    4741(http://www.sqlite.org/download.html)
    4842
    49 This configure is straight-forward.  You should be able to use the ./configure, make, make install method with impunity.
     43This configure is straight-forward:
    5044
    5145{{{
     
    5549}}}
    5650
    57 == 2.2: pysqlite (2.0.5 and 2.3.3 known to be ok) ==
     51=== Pysqlite (2.0.5 and 2.3.3 known to be ok)
     52
    5853(http://initd.org/pub/software/pysqlite/releases/2.0/2.0.5/ and http://initd.org/tracker/pysqlite)
    5954
    60 The pysqlite installation requires distutils, which are packaged with python-devel.  If you get some strange error messages, check this first.  If you have installed your SQLite somewhere other than `/usr/local`, you'll have to modify setup.cfg accordingly. The library should automatically be installed in your `/usr/lib64/python2.3/site-packages` directory.
     55The pysqlite installation requires distutils, which are packaged with python-devel. If you get some strange error messages, check this first. If you have installed your SQLite somewhere other than `/usr/local`, you'll have to modify setup.cfg accordingly. The library should automatically be installed in your `/usr/lib64/python2.3/site-packages` directory.
    6156
    6257{{{
     
    6560}}}
    6661
    67 == 2.3: !ClearSilver ==
     62=== !ClearSilver
     63
    6864(http://www.clearsilver.net/downloads/)
    6965
    70 === 2.3.1 !ClearSilver 0.10.4 ===
     66'''Note''': the use of !ClearSilver has been deprecated in favor of Genshi.
     67
     68==== !ClearSilver 0.10.4
    7169
    7270The problem with Python configuration (see 0.10.2 and the patch for it) has been solved. !ClearSilver 0.10.4 can be built like the following:
     
    7876}}}
    7977
    80 === 2.3.2 !ClearSilver 0.10.2 ===
    81 
    82 Some of the problems with 0.9.3 (below) have been fixed in this release,
    83 but a couple have not been fixed.  Please see [wiki:TracOnSLES9ClearSilverFix]
    84 for more information, as well as a patch that makes this work.
    85 
    86 === 2.3.3 !ClearSilver 0.9.3 ===
    87 
    88 I used 0.9.3 because it was the lowest version that was required by Trac.  I initially tried to install the newest (0.10.1), but the configure was balking at the target of x86_64-unknown-linux-gnu.  There is apparently a patch that can be applied to work around this, but I did not use it.  As with the other C packages, the `configure` parameters should include `--prefix=[your_location]` if you are installing somewhere outside the default.  You must also pass the `--with-python=[path/bin/python]` parameter to set up the python bindings.
    89 
    90 There are two gotchas with the !ClearSilver build:
    91  1. You may have to pass `-fPIC` as part of your CFLAGS.  This is apparently required for x86_64 support.  I don't pretend to understand all of the architecture details, but the compiler told me to recompile with `-fPIC`, so I did and all is seemingly well.
    92  2. You may have to make a modification to the setup.py when installing the Python bindings.  In my setup, the `-c` flag was passed to gcc along with `-o`, which is prohibited.  I simply remove `-c` from the CFLAGS, per a newsgroups post (http://groups.yahoo.com/group/ClearSilver/message/242).
    93 
    94 ==== 2.3.3.1: Add the following line to the python/setup.py file, around line 70. ====
     78==== !ClearSilver 0.10.2
     79
     80Some of the problems with 0.9.3 (below) have been fixed in this release, but a couple have not been fixed. Please see [wiki:TracOnSLES9ClearSilverFix] for more information, as well as a patch that makes this work.
     81
     82==== !ClearSilver 0.9.3
     83
     84I used 0.9.3 because it was the lowest version that was required by Trac. I initially tried to install the newest (0.10.1), but the configure was balking at the target of x86_64-unknown-linux-gnu. There is apparently a patch that can be applied to work around this, but I did not use it. As with the other C packages, the `configure` parameters should include `--prefix=[your_location]` if you are installing somewhere outside the default. You must also pass the `--with-python=[path/bin/python]` parameter to set up the python bindings.
     85
     86Caveats with the !ClearSilver build:
     87 1. You may have to pass `-fPIC` as part of your CFLAGS. This is apparently required for x86_64 support. I don't pretend to understand all of the architecture details, but the compiler told me to recompile with `-fPIC`, so I did and all is seemingly well.
     88 1. You may have to make a modification to the setup.py when installing the Python bindings. In my setup, the `-c` flag was passed to gcc along with `-o`, which is prohibited. I simply remove `-c` from the CFLAGS, per a newsgroups post (http://groups.yahoo.com/group/ClearSilver/message/242).
     89
     90==== Add the following line to the python/setup.py file, around line 70
    9591
    9692{{{
     
    115111}}}
    116112
    117 ==== 2.3.3.2: Build and install the !ClearSilver libraries: ====
     113==== Build and install the !ClearSilver libraries
    118114
    119115{{{
     
    123119}}}
    124120
    125 
    126 == 2.4: Subversion (1.2.3 or 1.3.2; 1.4.x won't build) ==
    127 (http://subversion.tigris.org/downloads/subversion-1.2.3.tar.gz or http://subversion.tigris.org/downloads/subversion-1.3.2.tar.gz ;
    128 Subversion 1.4 doesn't fit SLES9 well, because it needs a newer libapr0)
    129 
    130 The build of Subversion is pretty simple once the other details are out of the way, but there are some SuSE-specific configuration things that must be cleaned up.  In my case, make install broke unless I created the previously non-existent http2-prefork.conf.  The install script must be determining this path somehow with APXS, but I haven't taken the time to completely understand what it's calculating, and how it diverges from the actual configuration.  There are also some things that seem to fall through the cracks regarding the libraries.  My procedure was:
    131 
    132 === 2.4.1: Create `/etc/apache2/httpd2-prefork.conf` and add a bogus !LoadModule directive: ===
     121== Subversion (1.2.3 or 1.3.2)
     122
     123(http://subversion.tigris.org/downloads/subversion-1.2.3.tar.gz or http://subversion.tigris.org/downloads/subversion-1.3.2.tar.gz)
     124
     125Subversion 1.4 doesn't fit SLES9 well, because it needs a newer libapr0.
     126
     127The build of Subversion is pretty simple once the other details are out of the way, but there are some SuSE-specific configuration things that must be cleaned up. In my case, make install broke unless I created the previously non-existent http2-prefork.conf. The install script must be determining this path somehow with APXS, but I haven't taken the time to completely understand what it's calculating, and how it diverges from the actual configuration. There are also some things that seem to fall through the cracks regarding the libraries.  My procedure was:
     128
     129=== Create `/etc/apache2/httpd2-prefork.conf` and add a bogus !LoadModule directive
    133130
    134131{{{
     
    137134}}}
    138135
    139 === 2.4.2: Perform the normal installation.  You may want to use some additional parameters, but this is what I used: ===
     136=== Perform the normal installation
     137
     138You may want to use some additional parameters, but this is what I used:
    140139
    141140{{{
     
    145144}}}
    146145
    147 === 2.4.3: Build and install the swig-py bindings to `/usr/lib64/python2.3/site-packages` ===
     146=== Build and install the swig-py bindings to `/usr/lib64/python2.3/site-packages`
    148147
    149148You should make sure swig-py bindings get installed into this directory (by default, they are installed to $(prefix_dir)/lib), so that Python could find them.
     
    157156}}}
    158157
    159 === 2.4.4: Copy the C library to `/usr/lib64` and update the library cache.  (If you used a different prefix, substitute it for `/usr/local` in these steps.) ===
     158=== Copy the C library to `/usr/lib64` and update the library cache
     159
     160If you used a different prefix, substitute it for `/usr/local` in these steps:
     161
    160162{{{
    161163cp /usr/local/lib/libsvn_swig_py-1.so.0.0.0 /usr/lib64
     
    164166}}}
    165167
    166 
    167 == 2.5: Trac (0.9b2 or 0.10.3.1) ==
     168== Trac (0.9b2 or 0.10.3.1)
     169
    168170(http://ftp.edgewall.com/pub/trac/trac-0.9b2.tar.gz or http://ftp.edgewall.com/pub/trac/trac-0.10.3.1.tar.gz)
    169171
    170 At this point, the Trac installation should be as simple as on any other platform.  I used the default installation path, `/usr/share/trac`.
     172At this point, the Trac installation should be as simple as on any other platform. I used the default installation path `/usr/share/trac`.
    171173
    172174{{{
     
    174176}}}
    175177
    176 
    177 = 3. Additional Setup =
    178 
    179 As much as I'd like to say that's all there is, there are still a couple of steps to actually getting your installation up.  You should refer to the installation guide (http://projects.edgewall.com/trac/wiki/TracInstall) first, but I'll describe my somewhat-overlapping process for finishing the setup of the Apache/mod_python installation.
    180 
    181 == 3.1: Pick a place for your Subversion project repository (if you do not have an existing one). ==
    182 
    183 I like `/var/svn` to house my respositories and `/var/svn/conf` to hold the configs for them.  Select anywhere that seems reasonable to you.  You create the repository with svnadmin:
     178== Additional Setup
     179
     180You should refer to TracInstall first, but I'll describe my somewhat-overlapping process for finishing the setup of the Apache/mod_python installation.
     181
     182=== Pick a place for your Subversion project repository (if you do not have an existing one)
     183
     184I like `/var/svn` to house my respositories and `/var/svn/conf` to hold the configs for them. Select anywhere that seems reasonable to you. You create the repository with svnadmin:
    184185
    185186{{{
     
    187188}}}
    188189
    189 == 3.2: Pick a place for your Trac project environment. ==
    190 I like `/var/trac` for my Trac environments.  As with the Subversion home, select anywhere that seems reasonable to you.  Trac environments are created with trac-admin:
     190=== Pick a place for your Trac project environment
     191
     192I like `/var/trac` for my Trac environments. As with the Subversion home, select anywhere that seems reasonable to you. Trac environments are created with trac-admin:
    191193
    192194{{{
     
    194196}}}
    195197
    196 You will have to answer a small handful of questions about the project, entering a name, connection string, shared trac directory, and repository location.  Having installed trac to the default of `/usr/share/trac`, and using SQLite for my data store, I entered the project name and path to the Subversion repository, leaving defaults for the other two questions.
    197 
    198 == 3.3: Set up Apache to work with the rest of your toys. ==
    199 
    200 In order for everything to work, you need to make some modifications to your Apache configuration.  Assuming everything is in the SuSE default locations, you'll need to modify some parameters in `/etc/sysconfig` and create a configuration for your project.  I decided to configure Subversion fully in its own right, rather than only using the Trac functionality.  I suspect most installations will be similar.
    201 
    202 === 3.3.1: Add the handful of DAV/SVN related modules to the APACHE_MODULES variable in /etc/sysconfig/apache2. ===
    203 You should make sure the list contains dav, dav_fs, dav_svn, authz_svn, and python.
    204 
    205 === 3.3.2: Add a directory to APACHE_CONF_INCLUDE_DIRS to catch your project-specific configurations. ===
    206 I used `/etc/apache2/my_conf/*.conf`, so any *.conf files in that directory are included at startup/rehash.  You could be more specific by using APACHE_CONF_INCLUDE_FILES, or a more restrictive file mask, but I find this to be convenient.
    207 
    208 === 3.3.3: Create a basic htpasswd file for the Subversion repository and Trac installation. ===
    209 As seems to be the case on multiple projects, I like to keep my Subversion and Trac authentication synchronized, and an easy way to do that is to use the same htpasswd file.  I place it in `/svn/conf/[project]users`, typically.  You can add the first user with:
     198You will have to answer a small handful of questions about the project, entering a name, connection string, shared trac directory and repository location. Having installed trac to the default of `/usr/share/trac`, and using SQLite for my data store, I entered the project name and path to the Subversion repository, leaving defaults for the other two questions.
     199
     200=== Set up Apache to work with the rest of your toys
     201
     202In order for everything to work, you need to make some modifications to your Apache configuration. Assuming everything is in the SuSE default locations, you'll need to modify some parameters in `/etc/sysconfig` and create a configuration for your project. I decided to configure Subversion fully in its own right, rather than only using the Trac functionality. Most installations will be similar.
     203
     204==== Add the handful of DAV/SVN related modules to the APACHE_MODULES variable in /etc/sysconfig/apache2
     205
     206You should make sure the list contains dav, dav_fs, dav_svn, authz_svn and Python.
     207
     208==== Add a directory to APACHE_CONF_INCLUDE_DIRS to catch your project-specific configurations
     209
     210I used `/etc/apache2/my_conf/*.conf`, so any *.conf files in that directory are included at startup/rehash. You could be more specific by using APACHE_CONF_INCLUDE_FILES, or a more restrictive file mask, but I find this to be convenient.
     211
     212==== Create a basic htpasswd file for the Subversion repository and Trac installation
     213
     214As seems to be the case on multiple projects, I like to keep my Subversion and Trac authentication synchronized, and an easy way to do that is to use the same htpasswd file. I place it in `/svn/conf/[project]users`. You can add the first user with:
    210215
    211216{{{
     
    213218}}}
    214219
    215 === 3.3.4: Add a configuration file for your project to `/etc/apache2/my_conf`. ===
    216 This is where you actually set up your Subversion and Trac access.  Everybody likes their project directories set up differently, depending on where the server is hosted, if virtual hosts are available, and so on, but here is a basic setup that will get both Subversion and Trac up and running off of the same htpasswd file.
     220==== Add a configuration file for your project to `/etc/apache2/my_conf`
     221
     222This is where you actually set up your Subversion and Trac access. Here is a basic setup that will get both Subversion and Trac up and running off of the same htpasswd file:
    217223
    218224{{{
     
    245251}}}
    246252
    247 === 3.3.5: Make sure that your Apache user has access to the repository and Trac environment. ===
    248 On my installation, `wwwrun` is the Apache user, so I used `chown -R wwwrun:root /var/svn /var/trac` to get things rolling.  You may have some additional permissions to implement on top of these, but they should get you started.
    249 
    250 === 3.3.6: Reload Apache. ===
     253==== Make sure that your Apache user has access to the repository and Trac environment
     254
     255On my installation, `wwwrun` is the Apache user, so `chown -R wwwrun:root /var/svn /var/trac` was used. You may have some additional permissions to implement on top of these, but they should get you started.
     256
     257==== Reload Apache
     258
    251259`/etc/init.d/apache2 reload` should take care of pulling in the new configuration and setting up both the Subversion and Trac access.
    252260
    253 === 3.3.7: Cross your fingers and try it out. ===
    254 If you follow this guide, you should at least get a working installation running.  Once you've got that, customization for virtual hosts, different authentication, and so on should follow typical Trac behavior, where you are more likely to find support if you get stumped.
     261=== Conclusion
     262
     263Customization for virtual hosts, different authentication, and so on should follow typical Trac behavior.
    255264
    256265--------
    257 
    258266See also: [wiki:TracOnSuSE TracOnSuSE], TracInstall