SVN + Trac module for ISPConfig3

Discussion in 'Developers' Forum' started by quentusrex, Nov 2, 2008.

  1. quentusrex

    quentusrex New Member

    I'm interested in making a module that will allow the ISPConfig3 admin to allow clients to build svn and trac projects. Is anyone else interested in this module? Also, could someone send me links to ISPConfig3 module documentation? I'm considering setting something up along the lines of the way phpmyadmin is setup. One install, but have the client specific files in their web folders. and the client apache configuration in their vhost file.
     
  2. till

    till Super Moderator Staff Member ISPConfig Developer

    The Link to the developer documentation is in the sticky post of this forum named "ISPConfig 3 Developer documentation".
     
  3. till

    till Super Moderator Staff Member ISPConfig Developer

    One note. If you are searching for documentation of the software installation function, there is no documentation available yet. The software packages are .zip files containing at least a setup.sh script which is executed when the package gets installed plus the files that shall be installed.

    I attached a package named test.zip
     

    Attached Files:

    • test.zip
      File size:
      151 bytes
      Views:
      377
  4. quentusrex

    quentusrex New Member

    Is it better for ISPConfig3 modules to use a web directory such as www.mydomain.com/webmail/ ? or use a subdomain such as: webmail.mydomain.com ?
     
  5. quentusrex

    quentusrex New Member

    Is there a way to manually upload a module into ISPConfig3? to install a custom module?
     
  6. quentusrex

    quentusrex New Member

    Would there be a problem with adding a folder in the client's /var/clients/clientX/webY/svn and /var/clients/clientX/webY/trac ???

    This way they aren't viewable from the web, but they are managed in the client's web folder, and thus subject to the clients web space restrictions. Would this also be tracked by webalizer and subject to the clients bandwidth restrictions? That would be useful.
     
  7. till

    till Super Moderator Staff Member ISPConfig Developer

    I dont see any problems with that.

    +
    That depends on how you access them. If they were accessed like www.domain.com/trac/, then yes. If you access them like trac.domain.com, they will not be part of the webalizer stats.
     
  8. quentusrex

    quentusrex New Member

    Awesome. We'll see how it goes. here is my initial tutorial/build of the system. It allows for one install of trac and svn on the server, then allows easy install for each individual client. Thus it will be easy to add into a module to allow a user to have access to. :-D

    This install is still rough. I need to test it a few more times, but it seems to work. It is initially designed to host a single project, but can easily be changed to host multiple projects.



    1. sudo apt-get install apache2 libapache2-mod-python subversion-tools libapache2-svn python-setuptools subversion python-subversion

    2. sudo easy_install Trac

    3. sudo mkdir /var/clients/client1/web1/trac

    4. sudo chown web1:client1 /var/clients/client1/web1/trac

    5. vim /etc/apache2/sites-enabled/mydomain.vhost

    Add the following near the end, but above the </VirtualHost>
    ================================

    <Location /trac>
    SetHandler mod_python
    PythonInterpreter main_interpreter
    PythonHandler trac.web.modpython_frontend
    PythonOption TracEnv /var/clients/client1/web1/trac/testproject
    PythonOption TracUriRoot /trac/testproject
    PythonOption PYTHON_EGG_CACHE /tmp
    </Location>

    <Location /trac/login>
    AuthType Basic
    AuthName "myproject"
    AuthUserFile /var/clients/client1/web1/trac/.passwd
    Require valid-user
    </Location>


    <Location /svn>
    DAV svn
    AuthType Basic
    AuthName "My Trac"
    AuthUserFile /var/clients/client1/web1/svn/.passwd
    AuthzSVNAccessFile /var/local/svn/svn.example.com/conf/authz
    SVNPath /var/local/svn/svn.example.com
    Require valid-user
    </Location>

    ================================

    6. sudo mkdir /var/clients/client1/web1/svn

    7. sudo chown web1:client1 /var/clients/client1/web1/svn

    8. sudo svnadmin create /var/clients/client1/web1/svn/<YourProjectNameHere>

    9. sudo chown -R web1:client1 /var/clients/client1/web1/svn

    10. sudo /etc/init.d/apache2 reload

    11. sudo trac-admin /var/clients/client1/web1/trac/<YourProjectNameHere> initenv <projectname> sqlite:db/trac.db svn /var/clients/client1/web1/svn/<YourProjectNameHere>

    12. sudo chown -R web1:client1 /var/clients/client1/web1/trac

    13. sudo apt-get install build-essential graphviz htmldoc enscript

    14. sudo rm /var/clients/client1/web1/svn/.passwd

    15. sudo touch /var/clients/client1/web1/svn/.passwd

    14. sudo rm /var/clients/client1/web1/trac/.passwd

    15. sudo touch /var/clients/client1/web1/trac/.passwd

    (so that trac can manage it's own users)
    16. sudo chown web1:client1 /var/clients/client1/web1/trac/.passwd

    17. Now some trac plugins:
    sudo easy_install http://svn.edgewall.org/repos/genshi/trunk/
    sudo easy_install http://trac-hacks.org/svn/accountmanagerplugin/trunk
    sudo easy_install http://trac-hacks.org/svn/customfieldadminplugin/0.11
    sudo easy_install http://trac-hacks.org/svn/eclipsetracplugin/tracrpcext/0.10
    sudo easy_install http://trac-hacks.org/svn/iniadminplugin/0.11
    sudo easy_install http://trac-hacks.org/svn/masterticketsplugin/0.11
    sudo easy_install http://trac-hacks.org/svn/pagetopdfplugin/0.10/
    sudo easy_install http://trac-hacks.org/svn/progressmetermacro/0.11
    sudo easy_install http://trac-hacks.org/svn/ticketdeleteplugin/0.11
    sudo easy_install http://trac-hacks.org/svn/tracwysiwygplugin/0.11
    sudo easy_install http://wikinotification.ufsoft.org/svn/trunk

    18. htpasswd /var/clients/client1/web1/svn/.passwd <username>

    19. htpasswd /var/clients/client1/web1/trac/.passwd <username>

    20. trac-admin /var/clients/client1/web1/trac/<YourProjectNameHere> permission add <username> TRAC_ADMIN

    21. /etc/init.d/apache2 restart
     
    Last edited: Nov 2, 2008
  9. quentusrex

    quentusrex New Member

    TracError: The user www-data requires read _and_ write permission to the database file /var/clients/client1/web1/trac/testproject/db/trac.db and the directory it is located in.


    Should I change the ownership of these files to www-data???
     
  10. till

    till Super Moderator Staff Member ISPConfig Developer

    Either that or make it world redable.

    Another solution might be to use python as cgi (if thats possible) instead of mod_python together with suexec so the file can be owned by the web user and nobody else needs permissions to this file.
     
  11. quentusrex

    quentusrex New Member

    I've changed the ownerships with chown -R www-data /var/clients/client1/web1/trac and chown -R www-data /var/clients/client1/web1/svn . It works fine for me. I just tested it to add a new project to another client, and it works great. I'll rework the guide so it's in the pieces for server install, then for each client. That'll come later though.
     
  12. quentusrex

    quentusrex New Member

    That's a good idea. I know trac can be run as cgi. I'll look into that.


    http://trac.edgewall.org/wiki/TracFastCgi
     
    Last edited: Nov 2, 2008
  13. quentusrex

    quentusrex New Member

    Kalua, and all:

    This will be very helpful to anyone who is trying to install drupal, and other software on the same client website:

    ==================================================


    <VirtualHost *:80>
    DocumentRoot /var/clients/client1/web4/web

    ServerName mydomain.com
    ServerAdmin [email protected]

    ErrorLog /var/clients/client1/web4/log/error.log

    ErrorDocument 400 /error/invalidSyntax.html
    ErrorDocument 401 /error/authorizationRequired.html
    ErrorDocument 403 /error/forbidden.html
    ErrorDocument 404 /error/fileNotFound.html
    ErrorDocument 405 /error/methodNotAllowed.html
    ErrorDocument 500 /error/internalServerError.html
    ErrorDocument 503 /error/overloaded.html

    <Directory /var/www/mydomain.com/web>
    Options FollowSymLinks Indexes
    AllowOverride Indexes AuthConfig Limit FileInfo
    Order allow,deny
    Allow from all
    </Directory>

    # suphp enabled
    <Directory /var/clients/client1/web4/web>
    suPHP_Engine on
    # suPHP_UserGroup web4 client1
    AddHandler x-httpd-suphp .php .php3 .php4 .php5
    suPHP_AddHandler x-httpd-suphp
    DirectoryIndex drupal/index.php
    </Directory>

    <Directory /var/clients/client1/web4/web/drupal>
    suPHP_Engine on
    # suPHP_UserGroup web4 client1
    AddHandler x-httpd-suphp .php .php3 .php4 .php5
    suPHP_AddHandler x-httpd-suphp
    DirectoryIndex drupal/index.php
    RewriteEngine on
    RewriteBase /drupal/
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule ^(.*)$ index.php?q=$1 [L,QSA]
    </Directory>



    php_admin_value sendmail_path "/usr/sbin/sendmail -t -i [email protected]"
    #php_admin_value open_basedir /var/clients/client1/web4:/usr/share/php5
    #php_admin_value upload_tmp_dir /var/clients/client1/web4/tmp
    #php_admin_value session.save_path /var/clients/client1/web4/tmp

    <Location /trac>
    SetHandler mod_python
    PythonInterpreter main_interpreter
    PythonHandler trac.web.modpython_frontend
    PythonOption TracEnvParentDir /var/clients/client1/web4/web/trac/
    PythonOption TracUriRoot /trac
    PythonOption PYTHON_EGG_CACHE /tmp
    </Location>

    <Location /trac/[[:alnum:]]+/login>
    AuthType Basic
    AuthName "MyDomain Trac Development"
    AuthUserFile /var/clients/client1/web4/web/trac/.passwd
    Require valid-user
    </Location>


    <Location /svn>
    DAV svn
    AuthType Basic
    AuthName "My Trac"
    AuthUserFile /var/clients/client1/web4/svn/.passwd
    #AuthzSVNAccessFile /var/local/svn/svn.example.com/conf/authz
    SVNPath /var/clients/client1/web4/svn/
    Require valid-user
    </Location>



    </VirtualHost>
     
  14. quentusrex

    quentusrex New Member

    Pay special attention to the DocumentIndex setting on the root /web/ directory. This will forward all requests for 'www.mydomain.com' to 'www.mydomain.com/drupal/index.php'

    This way you have all of the drupal stuff in one single directory.... Very useful.... This way drupal rewrite settings won't screw up other software on your server, like Trac, or something.
     

Share This Page