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: |
| 7 | My 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 | |
| 9 | I tried to find a configuration that would be 100% YaST-able with official packages, but the most substantial problems I found were: |
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: |
| 16 | The [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 | |
| 20 | In an attempt to keep as much as possible under the system management outlined by SuSE and YaST, the following packages were used: |
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 | | |
| 31 | 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). |
| 32 | |
| 33 | == Package Build Order |
| 34 | |
| 35 | 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 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) |
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 | |
| 80 | Some 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 | |
| 84 | 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. |
| 85 | |
| 86 | Caveats 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 |
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 | |
| 125 | Subversion 1.4 doesn't fit SLES9 well, because it needs a newer libapr0. |
| 126 | |
| 127 | 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: |
| 128 | |
| 129 | === Create `/etc/apache2/httpd2-prefork.conf` and add a bogus !LoadModule directive |
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 | |
| 180 | You 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 | |
| 184 | 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: |
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: |
| 198 | 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. |
| 199 | |
| 200 | === Set up Apache to work with the rest of your toys |
| 201 | |
| 202 | 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. 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 | |
| 206 | You 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 | |
| 210 | 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. |
| 211 | |
| 212 | ==== Create a basic htpasswd file for the Subversion repository and Trac installation |
| 213 | |
| 214 | 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`. You can add the first user with: |
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 | |
| 255 | On 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 | |