You are not logged in.
Hello
I'd like to use cgit like in projects.archlinux.org
all i want is urls like
http://domain/repo.git
however i can only get
http://domain/cgit.cgi/repo.git
i tried virtual-root=/ it seems to work (links are shown as http://domain/repo.git) but i get 404s when i click on them
how can i do that using virtualhost?
Last edited by poorguy (2010-02-19 21:40:52)
Offline
apache has a module to rewrite urls, and it is called mod_rewrite.
HTH.
Offline
I've did it. Here's how:
Note: you have to put "virtual-root=/" line to /etc/cgitrc
<VirtualHost *:80>
ServerName git.mydomain.com
DocumentRoot "/srv/http/cgit"
DirectoryIndex cgit.cgi
SetEnv CGIT_CONFIG /etc/cgitrc
<Directory "/srv/http/cgit">
Options FollowSymlinks ExecCGI
Allow from all
AllowOverride all
Order allow,deny
<Files cgit.cgi>
SetHandler cgi-script
</Files>
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^.* /cgit.cgi/$0 [L,PT]
</Directory>
<Directory "/srv/gitosis/repositories">
Allow from all
</Directory>
# To debug rewrite just enable them.
# RewriteLog /var/log/httpd/rewrite_log
# RewriteLogLevel 9
ErrorLog /var/log/httpd/gitweb
</VirtualHost>
Offline