List for cgit developers and users
 help / color / mirror / Atom feed
From: jamie.couture at gmail.com (Jamie Couture)
Subject: Installing using Apache rewrites
Date: Thu, 4 Aug 2011 11:54:20 -0400	[thread overview]
Message-ID: <CAH-DoZ5NV_s6UUrSBVnmW4vPczJdUQhpptkfTJvMGLFO0dEW=A@mail.gmail.com> (raw)
In-Reply-To: <20110804151418.GA28814@singpolyma.net>

I don't bother with rewrite rules for cgit anymore.  My vhost looks
something like this:

cgit.conf
-----------
<VirtualHost *:80>
   ServerName example.com

   Alias /cgit-data /var/www/cgit
   ScriptAlias / /var/www/cgi-bin/cgit/

</VirtualHost>

/etc/cgitrc
-------------
...
css=/cgit-data/cgit.css
logo=/cgit-data.cgit.png
virtual-root=/
...

It will inherit the parent DocumentRoot and Directory settings.  If you
want, you can specify them for your own sanity:
DocumentRoot /var/www/cgit

<Directory /var/www/cgit>
Options None
AllowOverride None
Order allow,deny
Allow from all
</Directory>

I don't think there's much apache config help here, but I thought I'd offer
my insight; at the very least, what I have done.

If you want to go crazy, you can even set Expires headers for your images /
css in your config as well, but you can find examples of how to do that in
apache's documentation.

On Thu, Aug 4, 2011 at 11:14 AM, Stephen Paul Weber <
singpolyma at singpolyma.net> wrote:

> I'm trying to set cgit up on a Debian system using Apache2 with rewrites.
>  I have this:
>
> RewriteEngine on
> RewriteCond %{REQUEST_FILENAME} !-f
> RewriteCond %{REQUEST_FILENAME} !-d
> RewriteRule ^(?!\/*cgi-bin)\/*(.*) /cgi-bin/cgit.cgi/$1 [PT,L]
>
> ScriptAlias /cgi-bin/ /usr/local/lib/cgi-bin/cgit/
> <Directory "/usr/local/lib/cgi-bin/cgit/"**>
>        AllowOverride None
>        Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
>        Order allow,deny
>        Allow from all
> </Directory>
>
> It's working except for:
> 1) The main page does not work.  No matter what rewrites I add I can't seem
>    to make the main page come up
> 2) The static CSS/image resources are not being loaded, but I think I just
>    need another Alias for them probably
> 3) Links in the app still link to /cgi-bin/cgit.cgi/, which is ugly
>
> Any thoughts on how to fix these things?
>
> --
> Stephen Paul Weber, @singpolyma
> See <http://singpolyma.net> for how I prefer to be contacted
> edition right joseph
>
> ______________________________**_________________
> cgit mailing list
> cgit at hjemli.net
> http://hjemli.net/mailman/**listinfo/cgit<http://hjemli.net/mailman/listinfo/cgit>
>



      reply	other threads:[~2011-08-04 15:54 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-08-04 15:14 singpolyma
2011-08-04 15:54 ` jamie.couture [this message]

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='CAH-DoZ5NV_s6UUrSBVnmW4vPczJdUQhpptkfTJvMGLFO0dEW=A@mail.gmail.com' \
    --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).