Article Title: Install Trac + Subversion + Apache in Ubuntu. Linux is a technology channel of the IT lab in China. Including desktop applications, Linux system management, kernel research, embedded systems, open source, and other basic categories 1. Install svn:
$ Sudo apt-get install subversion
$ Sudo apt-get install libapache2-svn // This is part of apache installation and does not have to be installed if http is not used.
2. Configure the svn Server:
First, create a subversion user group and add both www-data and yourself to the group. (You can choose system> System Management> users and groups from the Ubuntu menu ).
Second, create the svn root location,
$ Sudo mkdir/home/svn
$ Cd/home/svn
Then, start a new knowledge base,
$ Sudo mkdir myproject
$ Sudo chown-R root: subversion myproject // here you need to add permissions to www-data, because apache is used later.
$ Sudo chmod-R g + rws myproject // This is to grant the members of the group the corresponding permissions on all files added to the File Repository.
$ Sudo svnadmin create/home/svn/myproject // start a new knowledge base
Finally, set user authentication,
$ Sudo vim/home/svn/myproject/conf/svnserve. conf // uncomment # [general] And # password-db = passwd, which means that the passwd file in the same directory is used as the password database.
$ Sudo vim/home/svn/myproject/conf/passwd // Add the admin user and password.
3. Use the svn client:
Here we only introduce two methods. Assume that the working directory is located under/home/cyndi/work.
$ Svn co file: // home/svn/myproject // This is accessed when the client and server are on the same machine.
$ Svn co svn: // 10.28.158.20./ home/svn/myproject? Username admin
In addition, to simplify the directory when the client accesses the knowledge base, you can enable daemon on the server,
$ Svnserve-d? Foreground-r/home/svn
In this way, client access can be simplified,
$ Svn co svn: // 10.28.158.20./ myproject? Username admin
For detailed svn installation and setup, refer to: http://wiki.ubuntu.org.cn/SubVersion
4. Install and set trac, similar to svn:
$ Sudo apt-get install trac
$ Sudo trac-admin/home/trac initenv // you can use the default values except for the project name (myprojectname) and svn repository path (/home/svn/myproject.
$ Sudo chown-R root: www-data trac // use www-data: www-data
$ Sudo chmod-R g + rsw trac
5. Set User Permissions:
First, create a user. The second parameter specifies the location where the user file is stored, the third parameter specifies the connected domain, and the fourth parameter is the user name,
Next, bind the trac system permission to the user created in the passwd. digest file,
$ Trac-admin/home/trac/permission add admin TICKET_ADMIN // add the specified permissions to the admin user/group. For more permission settings, see: http://trac.edgewall.org/wiki/TracPermissions
$ Trac-admin/home/trac/permission add www-data admin // bind the www-data user with the same permissions as admin
Second, start the daemon listener and specify a port to process web requests,
In addition, if you do not want to enable user permissions,
$ Tracd-p 8000/home/trac/
(I tried this step. The authorization method is not easy to use and I still don't know why .)
6. Apache settings
Add following conf at the end of apache2.conf:
Options Indexes MultiViews
AllowOverride None
Order allow, deny
Allow from all
SetHandler mod_python
PythonHandler trac. web. modpython_frontend
PythonOption TracEnv/home/trac/testproject
PythonOption TracUriRoot/trac
AuthType Basic
AuthName "Trac"
AuthUserFile/etc/apache2/trac. passwd // use htdigest to generate a password file. trac, apache, and svn can share a password file.
Require valid-user
7. Notes
The above configuration is for the python mode. If CGI and Python cannot be configured together, "wiki.png" and other strange problems may occur, which I cannot do.
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.