Setting up a complete Subversion, Trac and Web Development Environment |
[eluser]Murodese[/eluser]
Disclaimer: I am doing this completely from memory. I've gotten this working over the last <large amount of weeks>, so my memory of it is pretty faded. However, someone asked me to describe it, so here it is. If you get error messages and the like, just post and I should be able to help out. Hardware Requirements: x Client PCs (fairly os-inspecific) 1 Development Server (ours is a box running Debian Lenny) Software Requirements: Client PCs: - An IDE that supports subversion in some way - we use Eclipse with Aptana (setup below), but any client that supports svn should be ok. - Some way of autosyncing to the development server's working folder. For windows, this is WinSCP. I don't know of any mac program that can do it. Server: - A LAMP stack - we use apache2/php5/mysqld5 - FTP/SFTP server - we use MySecureShell - Subversion - Trac - PHPDocumentor Setting up the server: Firstly you need to set up a basic lamp stack. There are a bajillion tutorials on this elsewhere, so I'm not going to cover it. Substitute apt for the package manager of your distro, this is just for a general idea of the packages required. Once you've got apache, mysql and php working together, you need to install subversion and trac. Code: apt-get install subversion libapache2-svn trac Now we set up project folders. Code: mkdir -p /var/local/svn/<project name> Next we need to add users, add them to the apache group and set access permissions. Code: adduser <username> Next, adding the apache handlers. For this, I have the following urls (obviously domain.tld is your host): http://<project name>.svn.domain.tld/ http://<project name.trac.domain.tld/ http://domain.tld/<project name>/trunk http://domain.tld/<project name>/working/<user> http://domain.tld/<project name>/docs This means that to use svn or trac, you'd connect to the first two urls. For viewing the current working copies or trunk build on the website itself, you'd use the bottom ones. The documentation is autogenerated each commit and put into docs. So, we have the following apache config files; Code: vim /etc/apache2/sites-enabled/trac.domain.tld.conf Make sure you create the log folders if they don't exist, and then you can restart apache (/etc/init.d/apache2 restart). Next, we want to set up our post-commit hooks. You also need to install phpdoc, but off the top of my head I don't remember if aptitude has a package for it. Failing that, get it off PEAR (go to their site). Code: cp /var/local/svn/<project name>/hooks/post-commit.tmpl /var/local/svn/<project name>/hooks/post-commit Code: vim /var/local/svn/<project name>/hooks/post-commit And create the phpdoc config file as /var/local/svn/<project name>/hooks/phpdoc.ini. To see how to do this, check out the phpdoc documentation. When setting where to output the data to, you want it as /var/www/<project name>/docs Set up your trac environment (using the trac documentation) and you're pretty much done. Install your ftp server of choice, and (if supported), make the following change to the users' default jail: ie. MySecureShell Code: Home /var/www/<project path>/working/$USER Obviously once you set up more than a single project, you'll need to organise your directories slightly better. But I'm super lazy, so onto the client. |
Welcome Guest, Not a member yet? Register Sign In |