List for cgit developers and users
 help / color / mirror / Atom feed
From: al at ila5.info (Al)
Subject: Getting Cgit Working on a Shared Host With Proper .htaccess
Date: Wed, 04 Jul 2012 09:45:15 +0300	[thread overview]
Message-ID: <4FF3E67B.5070809@ila5.info> (raw)

So I posted a request on StackOverflow[0], worded like so:

>
> So I just installed cgit on a shared host. I custom compiled it and use symlinks from $HOME/mydomain-and-public-www-folder.tld/g to $HOME/local/lib/cgit/prod to link $HOME/local/lib/cgit/${git describe} to a build from my updated builds to test the latest version. What does this include?
>
> [sharedhost]$ pwd
> $HOME/local/lib/cgit/prod
> [sharedhost]$ ls
> .htaccess  cgit.cgi  cgit.css  cgit.png lib/
>
> Now, that looks all nice and good on the landing page when I put in https://mydomain.tld/g/ in the browser and I see the pretty cgit interface. When I click any link, I get the proper repos, but all the formatting is gone (the CSS, PNG, and JS files go bye-bye, and all the links are in the form https://mydomain.tld/g/cgit.cgi/randomrepo.git for all the URLs. Of course all the files in the prod path are not working, because the browser looks for things like https://mydomain.tld/g/cgit.cgi/cgit.css instead of the needed https://mydomain.tld/g/cgit.css. Now, this was my basic .htaccess file to get it working.
>
> [sharedhost]$ more .htaccess
> # GIT BEGIN ###########################################################
>
> Options +Indexes +FollowSymLinks +ExecCGI
>
> Action fastcgi-script cgit.cgi
>
> SetEnv HTTP_CGIT_CONFIG /home/username/local/lib/cgit/cgit-conf/cgitrc
>
> RewriteEngine On
> DirectoryIndex cgit.cgi
>
> # GIT END ############################################################
>
> # AUTHENTICATION BEGIN ###############################################
> AuthType Digest
> AuthName "cgitdigestdomain"
> AuthDigestDomain /cgitdigestdomain/
> AuthUserFile  /home/username/local/lib/cgit/cgit-conf/.htpasswd
> Require valid-user
> # AUTHENTICATION END  ################################################
>
> I have tried a whole bunch of Rewrite patterns recommended like this [1] or that [2]. I am relatively new to more advanced .htaccess rules, so can someone point on how to remove cgit.cgi from the URLs with mod-rewrite and ensure css and png files in the same directory are accessible and QSA/query strings are handled properly. Sorry for the long post. I thought more detail would show why the obvious how-tos on this were not working for me.
>
> [1] Remove 'index.php' from URL with .htaccess
>
> [2] htaccess remove subdirectory from url


I have tried the first recommended solution, amongst many many others 
while reading Apache httpd docs, and I feel I must be missing something. 
Can someone point out to me how to properly get a .htaccess file to 
remove cgit.cgi even with it in the same directory as underlying 
component files? I wanted to bundle my compilation of cgit in one place 
as I had to change some variables for my shared host, and I wanted to 
keep up with development of cgit. Any thoughts?

[0] 
http://stackoverflow.com/questions/11316580/htaccess-remove-cgit-cgi-from-path/11317208#11317208




                 reply	other threads:[~2012-07-04  6:45 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4FF3E67B.5070809@ila5.info \
    --to=cgit@lists.zx2c4.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).