Rewrite and URL issues

503 visualizzazioni
Passa al primo messaggio da leggere

Mark Fraser

da leggere,
4 gen 2013, 18:07:4304/01/13
a git...@googlegroups.com
This is a similar problem to what dpk posted today but not exactly the same so I am posting it separately.  I am using with gitolite in case that matters (but I have relaxed the permissions on the repo directories managed by gitolite).

I extracted the version 0.3 tarball from today.

My config.ini looks like this:

-------------------------------

client = '/usr/bin/git' ; Your git executable path
repositories = '/home/gitolite/repositories/' ; Path to your repositories

[app]
debug = true
; I don't know if baseurl is still needed..seems like my results are the same either way
baseurl = 'http://sub.example.com.com/gitlist' ; Base URL of the application

--------------------------------

virtual host directive in httpd.conf:

<VirtualHost *:80>
    DocumentRoot /var/www/html
    ServerName sub.example.com
    <Directory "/var/www/html">
        AllowOverride All
        Options -Indexes
    </Directory>
</VirtualHost>

----------------------------------

htaccess:

----------------------------
<IfModule mod_rewrite.c>
    Options -MultiViews

    RewriteEngine On
    RewriteBase /var/www/html/gitlist/

    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteRule ^(.*)$ index.php [L,NC]
    
    AuthName "Git List"
    AuthType Basic
    AuthUserFile /var/www/.gitlistpwds
    Require valid-user

</IfModule>
<Files config.ini>
    order allow,deny
    deny from all
</Files>
----------------------------------------

With this setup, going to http://sub.example.com/gitlist results in the browser error message saying that /index.php does not exist (i.e. it's trying to go to /var/www/html/index.php )

In this case if I go to http://sub.example.com/gitlist/index.php, the repository list (apparently) properly appears.  When I click on one of the repos, I get:

-------------------------------
Whoops, looks like something went wrong.

1/1 RuntimeException: Unknown option: -c
usage: git [--version] [--exec-path[=GIT_EXEC_PATH]] [--html-path]
[-p|--paginate|--no-pager] [--no-replace-objects]
[--bare] [--git-dir=GIT_DIR] [--work-tree=GIT_WORK_TREE]
[--help] COMMAND [ARGS]
----------------------------------------------

If I remove the rewrite rule from .htaccess, I am able to access the index page by either specifying index.php or not.  But in that case when I click on a repo, it tries to find the repo underneath the gitlist directory:

______________________________

The requested URL /gitlist/testing.git/ was not found on this server.

------------------------------------------------------

Can someone please help sort out this mess?

Thanks

Mark Fraser

da leggere,
19 gen 2013, 09:36:5319/01/13
a git...@googlegroups.com
This is kind of sad.

Klaus Silveira

da leggere,
22 gen 2013, 08:46:5922/01/13
a git...@googlegroups.com
The error with the -c option occurs because you're using an old Git version. You need at least 1.7.2.

Mark Fraser

da leggere,
13 feb 2013, 18:34:0313/02/13
a git...@googlegroups.com
Thank you Klaus --

Yes that was part of the problem.  I'm having other issues that have cropped up once I got past this which I may post separately later.
Rispondi a tutti
Rispondi all'autore
Inoltra
0 nuovi messaggi