ChiliProject is not maintained anymore. Please be advised that there will be no more updates.

We do not recommend that you setup new ChiliProject instances and we urge all existing users to migrate their data to a maintained system, e.g. Redmine. We will provide a migration script later. In the meantime, you can use the instructions by Christian Daehn.

Chiliproject + svn + mysql + thin

Added by Wiki Bit at 2011-10-10 06:53 am

Hi,

I'm trying to setup my environment like this :
- Chiliproject (on ruby 1.9.2) with mysql as backend db
- Subversion
- thin webserver as application server

with following config :
- chiliproject is running with thin server, on port 8888 (http://ipaddress:8888)
- automatic repository creation is turned on, and works at first sight (repo's get created)
- svnserve is running on default port as a daemon (port 3690)

when I use svn locally, to e.g. import or make a folder in a specific repo : it works
when I use svn from a remote machine, I get the message "Authorization failed"

 svn mkdir --parents svn://x.x.x.x/test01/{trunk,tags,branches} --username id123 --password id123 -m "Creating Initial Directories" 
svn: Authorization failed

Not using Apache at the moment, I wanted to keep it with thin webserver only

some extra info:
- user id123 is admin in chiliproject, and is manager of the project "test01"
- on that machine, port 80 and 8080 are reserved, so any other apps (like svn, chiliproject, ..) must run on other ports
- port 3690 and 8888 are allowed through the firewall on that machine, I also tested without the firewall (just to make sure) but does not make a difference

Any help is appreciated

WB


Replies (6)

RE: Chiliproject + svn + mysql + thin - Added by Chris Dähn at 2011-10-10 07:26 am

Hi,

just for my understanding: The user "id123" and password "id123" belong to a registered subversion user and/or subversion uses the same authorisation like ChiliProject?

For me it looks like a bad/missing subversion user.

ciao,
Chris

RE: Chiliproject + svn + mysql + thin - Added by Wiki Bit at 2011-10-10 07:32 am

Hi,

well, I didn't create any svn user manually, I assumed/hope that this would also be handled by chiliproject? (like in the apache solution?)
(I also could not find any reference to the fact you have to create svn users manually)
that would be a maintenance pain, and make chiliproject unusable

WB

RE: Chiliproject + svn + mysql + thin - Added by Chris Dähn at 2011-10-10 07:39 am

Hi,

it seems to be possible to use the Redmine authentication for Subversion, if Subversion runs as Apache service and is explicitely configured to ask the Redmine/ChiliProject database for user and password.

For a first search I found this and the guys seemed to got it working:
http://www.redmine.org/boards/2/topics/6387

ciao,
Chris

RE: Chiliproject + svn + mysql + thin - Added by Wiki Bit at 2011-10-11 09:01 am

Hi,

ok, I switched from thin to apache2 for application server, and now indeed I can issue svn commands from remote machines,
but ... :( when I browse to a project, and click on repository, I get

404

The entry or revision was not found in the repository.

the log tells me it is a permissions issue

[Tue Oct 11 10:46:02 2011] [error] [client 127.0.0.1] File does not exist: /var/www/sys
[Tue Oct 11 10:47:02 2011] [error] [client 127.0.0.1] File does not exist: /var/www/sys
svn: Unable to open an ra_local session to URL
svn: Unable to open repository 'file:///opt/svn/test01'
svn: Can't open file '/opt/svn/test01/format': Permission denied
svn: Unable to open an ra_local session to URL
svn: Unable to open repository 'file:///opt/svn/test01'
svn: Can't open file '/opt/svn/test01/format': Permission denied
[Tue Oct 11 10:48:03 2011] [error] [client 127.0.0.1] File does not exist: /var/www/sys

but, nothing changed to the permissions on the filesystem

also, the cronjob for

cat /etc/cron.d/chiliproject 
* * * * * root /usr/local/bin/ruby /opt/chiliproject/extra/svn/reposman.rb --redmine-host localhost:8888 --scm Subversion --svn-dir /opt/svn --owner www-data --url file:///opt/svn --key=6BsV5h7Klu3h46xEMSik >> /var/log/reposman.log

now suddenly gives the error (in reposman.log) below, I've a feeling all these new issues are related to the fact that now that /sys/ cannot be found

Unable to connect to http://localhost:8888/sys/: Failed with 404 Not Found

these are the config files for apache :

#/etc/apache2/conf.d$ cat svn.config 
PerlLoadModule Apache2::Redmine
<Location /svn>
    DAV svn
    SVNParentPath "/opt/svn" 
    Order deny,allow
    Deny from all
    Satisfy any

    PerlAccessHandler Apache::Authn::Redmine::access_handler
    PerlAuthenHandler Apache::Authn::Redmine::authen_handler
    AuthType Basic
    AuthName "Chiliproject Subversion Repository" 

    #read-only access    
    <Limit GET PROPFIND OPTIONS REPORT>
        Require valid-user
         Allow from 127.0.0.1
         Satisfy any
    </Limit>
        # write access
        <LimitExcept GET PROPFIND OPTIONS REPORT>
        Require valid-user
    </LimitExcept>

    ## for mysql
    RedmineDSN "DBI:mysql:database=xxxxx;host=localhost" 
    RedmineDbUser "xxxxx" 
    RedmineDbPass "xxxxx" 
</Location>

and

#:/etc/apache2/sites-available$ cat default
<VirtualHost *:8888>
    ServerAdmin webmaster@localhost

    DocumentRoot /var/www/
    <Directory />
        Options FollowSymLinks
        AllowOverride None
    </Directory>
    <Directory /var/www/>
        Options Indexes FollowSymLinks MultiViews
        AllowOverride None
        Order allow,deny
        allow from all
    </Directory>

    ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
    <Directory "/usr/lib/cgi-bin">
        AllowOverride None
        Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
        Order allow,deny
        Allow from all
    </Directory>

    ErrorLog ${APACHE_LOG_DIR}/error.log

    # Possible values include: debug, info, notice, warn, error, crit,
    # alert, emerg.
    LogLevel warn

    CustomLog ${APACHE_LOG_DIR}/access.log combined

    Alias /doc/ "/usr/share/doc/" 
    <Directory "/usr/share/doc/">
        Options Indexes MultiViews FollowSymLinks
        AllowOverride None
        Order deny,allow
        Deny from all
        Allow from 127.0.0.0/255.0.0.0 ::1/128
    </Directory>

</VirtualHost>
#/etc/apache2/sites-available$ cat chiliproject 
        <Directory /var/www/chili>
                RailsBaseURI /chili
                PassengerResolveSymlinksInDocumentRoot on
        </Directory>
#/etc/apache2/sites-available$ 

there is a symbolic link from /var/www/chili to /opt/chiliproject/public

so... what am I missing? (or what should I also look at to troubleshoot?

Thanks

WB

RE: Chiliproject + svn + mysql + thin - Added by Wiki Bit at 2011-10-11 02:32 pm

Ok,

I was able to resolve part of the problem :
- the problem not being able to browse the repo's through the webinterface : resolved

because all pointed to an access/permissions problem, amongst the dozens of config files checked, I checked also

/etc/apache2/mods-available/passenger.conf

as Passenger is used by Apach2 for ruby

the file automatically created after the install process (I mean installing, ruby, gems, apache2, subversion, ... etc and then "gem install passenger")

looks like this:

<IfModule mod_passenger.c>
  PassengerRoot /usr/local/lib/ruby/gems/1.9.1/gems/passenger-3.0.9
  PassengerRuby /usr/local/bin/ruby
</IfModule>

because apache2 also uses www-data to run (and thus access files)
after setting a default passenger user, which tells the application explicitly to use www-data, it seems to work

<IfModule mod_passenger.c>
  PassengerRoot /usr/local/lib/ruby/gems/1.9.1/gems/passenger-3.0.9
  PassengerRuby /usr/local/bin/ruby
*  PassengerDefaultUser www-data*
</IfModule>

so, I'm left with the issue of the reposman.rb not running correctly to automatically create repo's etc...

anyone idea's?

WB

RE: Chiliproject + svn + mysql + thin - Added by Wiki Bit at 2012-01-25 11:42 am

To close this thread : I'm still using the
  • PassengerDefaultUser www-data*

because otherwise I didn't get it working

Case closed for now :)

WB

(1-6/6)