Edgewall Software

Changes between Initial Version and Version 1 of TracOnSLES9


Ignore:
Timestamp:
Oct 25, 2005, 4:18:08 PM (19 years ago)
Author:
trac@…
Comment:

Creating a knowledge base for victims of SLES9's enterprise feature-set

Legend:

Unmodified
Added
Removed
Modified
  • TracOnSLES9

    v1 v1  
     1= Trac on SuSE Linux Enterprise 9 =
     2
     3There 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.
     4
     5I 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:
     6
     7 * The obvious absence of a Trac package
     8 * The pysqlite library is not included in the Python packages, nor is it available in an additional package.
     9 * The !ClearSilver library is not available in any package
     10 * The Python/SWIG bindings are not configured in the Subversion package
     11
     12I 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.
     13
     14'''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 platforms.  Use what helps you and contribute what might help others.
     15
     16= 1. YaST-able Prerequisites =
     17
     18In 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:
     19
     20 * '''apache2'''              2.0.49-27.29
     21 * '''apache2-prefork'''      2.0.49-27.29
     22 * '''apache2-devel'''        2.0.49-27.29
     23 * '''apache2-mod_python'''   3.1.3-37.1
     24
     25 * '''python'''               2.3.3-88.1
     26 * '''python-devel'''         2.3.3-88.1
     27
     28I 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.
     29
     30
     31= 2. Package Build Order =
     32
     33The 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.
     34
     35As 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.
     36
     37== 2.1: SQLite 3.27 ==
     38(http://www.sqlite.org/download.html)
     39
     40This configure is straight-forward.  You should be able to use the ./configure, make, make install method with impunity.
     41
     42{{{
     43./configure
     44make
     45make install
     46}}}
     47
     48== 2.2: pysqlite 2.0.5 ==
     49(http://initd.org/pub/software/pysqlite/releases/2.0/2.0.5/ and http://initd.org/tracker/pysqlite)
     50
     51The 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.
     52
     53{{{
     54python setup.py build
     55python setup.py install
     56}}}
     57
     58== 2.3: !ClearSilver 0.9.3 ==
     59(http://www.clearsilver.net/downloads/)
     60
     61I 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.
     62
     63There are two gotchas with the !ClearSilver build:
     64 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.
     65 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).
     66
     67=== 2.3.1: Add the following line to the python/setup.py file, around line 70. ===
     68
     69{{{
     70os.environ["CFLAGS"] = os.environ["CFLAGS"].replace('-c', '')
     71}}}
     72
     73It should be after these lines:
     74
     75{{{
     76INC_DIRS = expand_vars(INC_DIRS, make_vars)
     77LIB_DIRS = expand_vars(LIB_DIRS, make_vars)
     78LIBRARIES = expand_vars(LIBRARIES, make_vars)
     79}}}
     80
     81And before these lines:
     82
     83{{{
     84setup(name="clearsilver",
     85      version=VERSION,
     86      description="Python ClearSilver Wrapper",
     87      author="Brandon Long",
     88}}}
     89
     90=== 2.3.2: build and install the !ClearSilver libraries: ===
     91
     92{{{
     93CFLAGS=-fPIC ./configure --with-python=/usr/bin/python
     94CFLAGS=-fPIC make
     95make install
     96}}}
     97
     98
     99== 2.4: Subversion 1.2.3 ==
     100(http://subversion.tigris.org/downloads/subversion-1.2.3.tar.gz)
     101
     102The 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:
     103
     104=== 2.4.1: Create `/etc/apache2/httpd2-prefork.conf` and add a bogus !LoadModule directive: ===
     105
     106{{{
     107###Subversion/apxs install script workaround:
     108LoadModule      foo     /bar.so
     109}}}
     110
     111=== 2.4.2: Perform the normal installation.  You may want to use some additional parameters, but this is what I used: ===
     112
     113{{{
     114./configure --with-zlib --with-swig --with-apxs=/usr/sbin/apxs2
     115make
     116make install
     117}}}
     118
     119=== 2.4.3: Build and install the swig-py bindings to `/usr/local/lib` ===
     120
     121{{{
     122make swig-py
     123make install-swig-py
     124}}}
     125
     126=== 2.4.4: Copy the python bindings to the site-packages directory, so Python can find them.  (If you used a different prefix, substitute it for `/usr/local` in these steps.) ===
     127
     128{{{
     129cp -R /usr/local/lib/svn-python/libsvn /usr/lib64/python2.3/site-packages
     130cp -R /usr/local/lib/svn-python/svn /usr/lib64/python2.3/site-packages
     131}}}
     132
     133=== 2.4.5: 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.) ===
     134{{{
     135cp /usr/local/lib/libsvn_swig_py-1.so.0.0.0 /usr/lib64
     136ln -s /usr/lib64/libsvn_swig_py-1.so.0.0.0 /usr/lib64/libsvn_swig_py-1.so.0
     137ldconfig
     138}}}
     139
     140
     141== 2.5: Trac 0.9b2 ==
     142(http://ftp.edgewall.com/pub/trac/trac-0.9b2.tar.gz)
     143
     144At this point, the Trac installation should be as simple as on any other platform.  I used the default installation path, `/usr/share/trac`.
     145
     146{{{
     147python setup.py install
     148}}}
     149
     150
     151= 3. Additional Setup =
     152
     153As 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.
     154
     155== 3.1: Pick a place for your Subversion project repository (if you do not have an existing one). ==
     156
     157I 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:
     158
     159{{{
     160svnadmin create /var/svn/project
     161}}}
     162
     163== 3.2: Pick a place for your Trac project environment. ==
     164I 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:
     165
     166{{{
     167trac-admin /var/trac/project initenv
     168}}}
     169
     170You 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.
     171
     172== 3.3: Set up Apache to work with the rest of your toys. ==
     173
     174In 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.
     175
     176=== 3.3.1: Add the handful of DAV/SVN related modules to the APACHE_MODULES variable in /etc/sysconfig/apache2. ===
     177You should make sure the list contains dav, dav_fs, dav_svn, authz_svn, and python.
     178
     179=== 3.3.2: Add a directory to APACHE_CONF_INCLUDE_DIRS to catch your project-specific configurations. ===
     180I 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.
     181
     182=== 3.3.3: Create a basic htpasswd file for the Subversion repository and Trac installation. ===
     183As 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:
     184
     185{{{
     186htpasswd2 -c /svn/conf/someprojectusers <a_user_name>
     187}}}
     188
     189=== 3.3.4: Add a configuration file for your project to `/etc/apache2/my_conf`. ===
     190This 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.
     191
     192{{{
     193<Location /svn/someproject>
     194  DAV svn
     195  SVNPath /var/svn/someproject
     196  <LimitExcept GET PROPFIND OPTIONS REPORT>
     197    AuthType Basic
     198    AuthName "Some Project Repository"
     199    AuthUserFile /var/svn/conf/someprojectusers
     200    Require valid-user
     201  </LimitExcept>
     202</Location>
     203
     204Alias /trac "/usr/share/trac/htdocs"
     205
     206<Location /someproject>
     207  SetHandler mod_python
     208  PythonHandler trac.web.modpython_frontend
     209  PythonOption TracEnv /var/trac/someproject
     210  PythonOption TracUriRoot /someproject
     211</Location>
     212
     213<Location /someproject/login>
     214  AuthType Basic
     215  AuthName "Trac - Some Project"
     216  AuthUserFile /var/svn/conf/someproject
     217  Require valid-user
     218</Location>
     219}}}
     220
     221=== 3.3.5: Make sure that your Apache user has access to the repository and Trac environment. ===
     222On 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.
     223
     224=== 3.3.6: Reload Apache. ===
     225`/etc/init.d/apache2 reload` should take care of pulling in the new configuration and setting up both the Subversion and Trac access.
     226
     227=== 3.3.7: Cross your fingers and try it out. ===
     228If 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.
     229
     230--------
     231
     232See also: [wiki:TracOnSuSE TracOnSuSE], TracInstall