#####################################
# THIS IS NOT A COMPLETE APACHE CONFIG FILE!!!!
#####################################

#####################################
# What is it then? It's just an example of the 
# kind of location section you're going to
# want to have. Edit the following stuff as
# needed, and then plug it into your httpd.conf.
#####################################

# Apache::Watchdog::RunAway configs:
# For more info on these, read perldoc Apache::Watchdog::RunAway
# The names of these vars correspond to the ones in those documents.
# Most of the defaults should work ok. Edit paths where necessary
#
# NOTE: These only need to appear once per *server*. If you do multiple
# location or virtualhost installs on one apache, you can cut here until 
# </perl> after the first one.  
# Note: people have a lot of problems with this. If you
# can get Apache::Scoreboard to compile, go ahead and set this up.
# Otherwise, leave it off. Currently, it's use is deprecated.

#<perl>
#  use Apache::Watchdog::RunAway;				  
#  $Apache::Watchdog::RunAway::TIMEOUT        = 80;
#  $Apache::Watchdog::RunAway::POLLTIME       = 5;
#  $Apache::Watchdog::RunAway::DEBUG          = 0;
#  $Apache::Watchdog::RunAway::LOCK_FILE      = '/tmp/safehang.lock';
#  $Apache::Watchdog::RunAway::LOG_FILE       = '/usr/local/apache/logs/watchdog.log';
#  $Apache::Watchdog::RunAway::SCOREBOARD_URL = 'http://localhost/scoreboard';
#</perl>

# You also need to set up the scoreboard location, 
# for Apache::Watchdog::RunAway. Again, only one of these should 
# appear on any given server. It goes a little something like:
#PerlModule Apache::Scoreboard
#<Location /scoreboard>
#  SetHandler perl-script
#  PerlHandler Apache::Scoreboard::send
#  order deny,allow
#  deny from all
#  allow from localhost
#</Location>

# Edit the path below to point to your scoop lib/ directory
<perl>
  use lib qw( /www/scoop/lib );
</perl>

  
# This is the important bit:
<Location __URL_PATH__>
    SetHandler perl-script
    PerlHandler Scoop::ApacheHandler

    ##################################
    # Edit these variables to match your 
    # local setup. Note that this is now the 
    # *only* place you need to enter this
    # stuff.
    ##################################
   
    # Pick which Database you're using
    # The only Current DB supported is mySQL
    PerlSetVar DBType mySQL
    # PerlSetVar DBType Oracle
    # PerlSetVar DBType postgres
    # PerlSetVar DBType mSQL
    # PerlSetVar DBType Sybase
	
        ##  One MySQL specific Thing:
        # Set the version of mysql you're using
        # this is here to preserve compatibility with
        # 3.22, 3.23, 4.0x, and 4.1x. Needs to be one of these values:
        # 3.22 - DEPRECATED If you're running MySQL 3.22, you really should
        #                   upgrade.
        # 3.23 - older stable version
        # 4.0  - current stable version
        # 4.1  - developement version
        #
        # If you set mysql_version to 4.0 or 4.1, Scoop will use some of the
        # newer mysql features that are NOT present in MySQL 3.23.x. If you are
        # not running MySQL 4.x, set this var to 3.23 (or 3.22 as appropriate),
        # and Scoop will ignore them. Do not try to use the 4.x features in
        # 3.23 or 3.22, because they will not work!

        PerlSetVar mysql_version __MYSQL_VER__
        ############################

    ##  Some Oracle Specific stuff:
    # Standard ORACLE_HOME Env
    # PerlSetVar ORACLE_HOME /oraexe/app/oracle/product/8.1.5
    # Schema information for Oracle
    # if you're going to be using a different login and no aliasing
    # if you're not sure that you need this, ask your DBA
    # PerlSetVar Schema scoop
    ############################

    # Database Config:
    # The name of your scoop Database
    # will become 'TWO_TASK' ENV if Oracle
    PerlSetVar db_name __DBNAME__ 

    # The host where mySQL is running
    PerlSetVar db_host __DBHOST__

    # The user to connect as
    PerlSetVar db_user __DBUSER__

    # The user's database password
    PerlSetVar db_pass __DBPASS__

    # Archive config:
    # Set these vars if you use an archive database
    #PerlSetVar db_name_archive __DBNAMEARCHIVE__ 

    # The host where mySQL is running
    #PerlSetVar db_host_archive __DBHOSTARCHIVE__

    # The user to connect as
    #PerlSetVar db_user_archive __DBUSERARCHIVE__

    # The user's database password
    #PerlSetVar db_pass_archive __DBPASSARCHIVE__

    # Memcached config
    # Set 'memcached_servers' to the address and port of where your
    # memached servers are running. If you have more than one, separate
    # them with commas. Ex: 127.0.0.1:11211
    #PerlSetVar memcached_servers   127.0.0.1:11211
    # Set 'memcached_compress' to your desired level of compression it
    # will use. We have 10_000 here as a reasonalbe default
    #PerlSetVar memcached_compress  10_000

    # Slave Config
    # Set this if you're using a slave db
    #PerlSetVar db_name_slave __SLAVENAME__

    # the slave host. If you have more than one, seperate them with
    # commas: i.e., 1.2.3.4,1.2.3.5,1.2.3.6
    #PerlSetVar db_host_slave __SLAVEHOST__

    # slave db user
    #PerlSetVar db_user_slave __SLAVEUSER__

    # slave db pass
    #PerlSetVar db_pass_slave __SLAVEPASS__

    # Archive Slave Config
    # Set this if you're using a slave archive db
    #PerlSetVar db_name_slave_arch  __SLAVENAMEARCH__

    # the slave host. If you have more than one, seperate them with
    # commas: i.e., 1.2.3.4,1.2.3.5,1.2.3.6
    #PerlSetVar db_host_slave_arch  __SLAVEHOSTARCH__

    # slave db user
    #PerlSetVar db_user_slave_arch  __SLAVEUSERARCH__

    # slave db pass
    #PerlSetVar db_pass_slave_arch  __SLAVEPASSARCH__

    # Set below to your host name if you're
	# using a two-server proxy type system.
	# It will let the mod_perl server know what 
	# name it's supposed to go by. Most will just leave 
	# this alone.
	#PerlSetVar mailname www.mysite.com
	
    # This is the path to the VERSION file in scoop, will be
    # used with op=stats eventually
    <perl>
      my $vfile = '/www/scoop/VERSION';
      my $v = do $vfile;
	  push(@{ $Location{'__URL_PATH__'}->{PerlSetVar} },
         [ scoop_version  => $v->{Version}  ],
         [ scoop_date     => $v->{Date}     ],
		 [ scoop_revision => $v->{Revision} ],
         [ scoop_author   => $v->{Author}   ],
         [ scoop_state    => $v->{State}    ]
      );
    </perl>

    # Cookie config-- put the host name for cookie targeting here.
    # Note that it *must* have at least 2 dots-- so to send
    # cookies to any host in 'foo.org', enter ".foo.org"
    # The "path" part of the cookie will be done automagically
    # using the "rootdir" var (you DID set that, right? Read INSTALL)
    PerlSetVar cookie_host __COOKIE_HOST__
  
    # Mail::Sendmail Config-- enter your SMTP host here
    PerlSetVar SMTP __SMTP_SERVER__

	# Enter a "site id" below-- Any string is fine, just
	# make sure it's unique for this partuclar site.
	PerlSetVar site_id __SITE_ID__

    # Enter a site key below. This is used as the key for
	# some Blowfish encrypted form variables, which are 
	# used to prevent IP spoofing. It can be as long as you 
	# like, and needs to be as unguessable as possible.
	# DO NOT USE AN OBVIOUS VALUE! A bunch of quasi-random
	# characters will do.
	# ex: mmDfhbT4837%jQQaamOF0)(#??/Q
	PerlSetVar site_key __SITE_KEY__

        # DB Failure page. This page will be displayed if the db
        # goes away instead of the usual "Internal Server Error" page.
        # By default, it lives in /pages/dbdown.html. An example is provided.
        PerlSetVar dbdown_page /pages/dbdown.html

    # Linkpoint cc processing settings.
	# See doc/Linkpoint.howto for instructions.
	# If you're not using the Linkpoint payment system,
	# just leave these commented out.
    #PerlSetVar linkpt_host     secure.linkpt.net
    #PerlSetVar linkpt_port     1139
    #PerlSetVar linkpt_store    xxxxxx
    #PerlSetVar linkpt_keyfile  /www/scoop/lib/LPERL/xxxxxx.pem
    #PerlSetVar lbin_location   /www/scoop/lib/LPERL/lbin
    #PerlSetVar lbin_tmp_dir    /www/scoop/cctmp

    # This should be the full path the the startup.pl file in your scoop install
    PerlRequire /www/scoop/etc/startup.pl
</Location>

# Replace the fist bit with the URL path to your images, and the second with 
# the filesystem path to the "html/images" subdir in your scoop distro 
# (or wherever you put the images). This has to come AFTER the main Location
# section.
Alias __URL_PATH__/images/ "/www/scoop/html/images/"

<Location __URL_PATH__/images>
  SetHandler default-handler
</Location>

<Location __URL_PATH__/pages>
  SetHandler default-handler
</Location>

#This seems a little odd, but it fixes a problem with location based installs
#where apache didn't know where to find backend.rdf and dynamic-comments.js
Alias __URL_PATH__ "/www/scoop/html/"

<Location ~ "^/(robots\.txt|favicon\.ico)$">
  SetHandler default-handler
</Location>
