Version 11 (modified by 19 years ago) ( diff ) | ,
---|
Trac Installation on Fedora Core 3
Fedora Installation
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)
Trac Configuration
Subversion (SVN) Configuration
Determine where you want your subversion projects stored. I stored it in /var/svn/projectname
mkdir /var/svn
- 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
Apache Configuration
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>
- I changed ScriptAlias from
- CAUTION: If you intend to use this server for hosting other websites, then you may want to reconsider this change (There are other alternatives that you can find)
ScriptAlias /cgi-bin/ "/var/www/cgi-bin/"
- to
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
Add Users
cd /etc/httpd/conf htpasswd –b trac.htpasswd username password
Restart Apache
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.
Error handling
Oops…
Trac detected an internal error:
[Errno 2] No such file or directory: '/usr/share/trac/myproject.db/VERSION' Traceback (most recent call last):
File "/usr/lib/python2.3/site-packages/trac/core.py", line 531, in cgi_start
real_cgi_start()
File "/usr/lib/python2.3/site-packages/trac/core.py", line 513, in real_cgi_start
env = open_environment()
File "/usr/lib/python2.3/site-packages/trac/core.py", line 189, in open_environment
env = Environment.Environment(env_path)
File "/usr/lib/python2.3/site-packages/trac/Environment.py", line 57, in init
self.verify()
File "/usr/lib/python2.3/site-packages/trac/Environment.py", line 70, in verify
fd = open(os.path.join(self.path, 'VERSION'), 'r')
IOError: [Errno 2] No such file or directory: '/usr/share/trac/myproject.db/VERSION'
If anyone encounters this error and fixes it please add solution here.