Trac Installation on Fedora Core 3
NOTE: This walkthru does NOT work properly IF you enable SELinux during the installation. I suppose it may work properly if you disable it after installation, but I didn't try it that way. I tried my first time around with an installation that had SELinux enabled and spent many hours trying to figure out what was going on. I admittedly am not an expert in kernel programming nor do I know much of anything about the intricate details related to SELinux. Therefore I have disabled the functionality altogether. If you can get trac to function properly with SELinux enabled PLEASE let me know (jbrandenburg at yahoo.com).
There is now some information available on running Trac with SELinux enabled at TracWithSeLinux.
NOTE: The firewall should be enabled for most individuals, I have disabled it because it's inside an already firewalled area and I just didn't want to mess with multiple firewalls. You only need to expose the webserver port and possibly ssh if you plan on doing remote administration.
- Installed as a server (Fedora lets you choose from Desktop, Workstation, Server, ..) and also added development tools
- Firewall disabled
- SELinux disabled
Configured yum via Dag
- I setup yum to download the updates from dag, per the instructions in TracOnFedoraCore. For the lazy..
Edit the file /etc/yum.conf and add this to the end of the file.
[dag] name=Dag RPM Repository for Fedora Core baseurl=http://apt.sw.be/fedora/$releasever/en/$basearch/dag
- Downloaded additional gpg keys that were specified at http://www.fedorafaq.org/#gpgsig
yum install trac # (accept the additional files that are dependencies) yum update # (optional) (I would do this one first if you have never done it, I had some php dependency issues)
Subversion (SVN) Configuration
Determine where you want your subversion projects stored. I stored it in /var/svn/projectname
- NOTE: CREATE YOUR SVN REPOSITORY OR IMPORT IT HERE..
- I copied the subversion repository over to the server in /var/svn/projectname
Add Trac Project Environment
I ran the trac-admin script to create the trac project.
Determine where you will install your trac environment files. I opted to use /opt/tracdb/projectname
mkdir /opt/tracdb trac-admin /opt/tracdb/projectname initenv # Fill out all the necessary information
- I had a problem with this command, as I got the error "Failed to create environment. global name 'sqlite' is not defined", even though I had installed pysqlite-2.0.5 (manually). The problem turned out to be the ld path, as described at http://lists.edgewall.com/archive/trac/2005-October/005150.html
- If you do get this problem add this line to /etc/ld.so.conf
I edited the /etc/httpd/conf/httpd.conf as instructed from the notes from trac-admin and from TracInstall
Add this to the end of /etc/httpd/conf/httpd.conf
Alias /trac /usr/share/trac/htdocs/ #or where you installed the trac htdocs #You have to allow people to read the files in htdocs <Directory "/usr/share/trac/htdocs"> Options Indexes MultiViews AllowOverride None Order allow,deny Allow from all </Directory> # Trac need to know where the database is located <Location "/cgi-bin/trac.cgi"> SetEnv TRAC_ENV "/path/to/projectenv" </Location> # You need this to allow users to authenticate # trac.htpasswd can be created with # cmd 'htpasswd -c trac.htpasswd' (UNIX) # do 'man htpasswd' to see all the options <Location "/cgi-bin/trac.cgi/login"> AuthType Basic AuthName "trac" AuthUserFile /somewhere/trac.htpasswd Require valid-user </Location>
- CAUTION: If you intend to use this server for hosting other websites, then you may want to reconsider this change (Alternatives found here):
- I changed ScriptAlias from
ScriptAlias /cgi-bin/ "/var/www/cgi-bin/"
ScriptAlias /cgi-bin/ "/usr/share/trac/cgi-bin/"
- For pretty URL’s (ie using http://trac.company.com instead of http://trac.company.com/cgi-bin/trac.cgi)
RewriteEngine On RewriteRule ^/$ /cgi-bin/trac.cgi [R]
Assign file permissions
I assigned the rights
chown apache:apache /opt/tracdb/projectname -R chown apache:apache /var/svn/projectname -R
cd /etc/httpd/conf htpasswd –b trac.htpasswd username password
service httpd restart
Login to trac via your browser:
point your browser to [http://servername/cgi-bin/trac.cgi]
If all went well then this should be your first step into your Trac system.