Report abuse

/etc/apache2/sites-available/gitorious

<VirtualHost *:80>
  <Directory /var/www/pcname/gitorious/public>
    Options FollowSymLinks
    AllowOverride None
    Order allow,deny
    Allow from All
  </Directory>

  DocumentRoot /var/www/pcname/gitorious/public
  ServerName pcname

  ErrorLog /var/www/pcname/log/error.log
  CustomLog /var/www/pcname/log/access.log combined
</VirtualHost>

/etc/apache2/sites-available/gitorious-ssl

<IfModule mod_ssl.c>
  <VirtualHost *:443>
    DocumentRoot /var/www/pcname/gitorious/public

    <Directory /var/www/pcname/gitoirous/public>
      Options FollowSymLinks
      AllowOverride None
      Order allow,deny
      allow from all
    </Directory>

    ErrorLog /var/www/pcname/log/apache2-error.log
    LogLevel warn

    SSLEngine on
    SSLCertificateFile /etc/ssl/certs/ssl-cert-snakeoil.pem
    SSLCertificateKeyFile /etc/ssl/private/ssl-cert-snakeoil.key
    BrowserMatch ".*MSIE.*" nokeepalive ssl-unclean-shutdown downgrade-1.0 force-response-1.0
    CustomLog /var/www/pcname/log/apache2-access.log combined
  </VirtualHost>
</IfModule>

/etc/apache2/sites-available/pcname (by http://cjohansen.no/en/ruby/setting_up_gitorious_on_your_own_server)

<VirtualHost *>
  <Directory /var/www/pcname/gitorious/public>
    Options FollowSymLinks
    AllowOverride None
    Order allow,deny
    Allow from All
  </Directory>

  DocumentRoot /var/www/pcname/gitorious/public
  ServerName pcname

  ErrorLog /var/www/pcname/log/error.log
  CustomLog /var/www/pcname/log/access.log combined

  # Gzip/Deflate
  AddOutputFilterByType DEFLATE text/html text/plain text/xml text/javascript text/css application/x-javascript
  BrowserMatch ^Mozilla/4 gzip-only-text/html
  BrowserMatch ^Mozilla/4\.0[678] no-gzip
  BrowserMatch \bMSIE !no-gzip !gzip-only-text/html

  <FilesMatch "\.(ico|pdf|flv|jpg|jpeg|png|gif|js|css|swf)$">
    ExpiresActive On
    ExpiresDefault "access plus 1 year"
  </FilesMatch>

  # No Etags
  FileETag None

  RewriteEngine On

  # Check for maintenance file and redirect all requests
  RewriteCond %{DOCUMENT_ROOT}/system/maintenance.html -f
  RewriteCond %{SCRIPT_FILENAME} !maintenance.html
  RewriteRule ^.*$ /system/maintenance.html [L]
</VirtualHost>

/etc/apache2/ports.conf

# If you just change the port or add more ports here, you will likely also
# have to change the VirtualHost statement in
# /etc/apache2/sites-enabled/000-default
# This is also true if you have upgraded from before 2.2.9-3 (i.e. from
# Debian etch). See /usr/share/doc/apache2.2-common/NEWS.Debian.gz and
# README.Debian.gz

NameVirtualHost *:80
Listen 80

<IfModule mod_ssl.c>
    # SSL name based virtual hosts are not yet supported, therefore no
    # NameVirtualHost statement here
    Listen 443
</IfModule>