
#--------------------------------------------------------------
# OCS Inventory Next Generation
#--------------------------------------------------------------
Alias /download /opt/inventory/ocs/download
Alias /ocs      /opt/inventory/ocs/ocsreports
{
    if (exists $ocs{'URL'})
      { $OUT .= "Alias  /$ocs{'URL'} /opt/inventory/ocs/ocsreports"; }
}

<Directory /opt/inventory/ocs/download>
  Options None
  Options +Indexes
  Options +Includes
  AllowOverride None
  order deny,allow
  deny from all
  allow from { $localAccess }
  php_admin_value open_basedir /opt/inventory/ocs/download:/tmp
</Directory>

<Directory /opt/inventory/ocs/ocsreports>
{
    my $ocssec = $ocs{'HTTPS'} || "off";
    if ($ocssec eq "off")
      { $OUT .= "  # SSLRequireSSL on"; }
    else
      { $OUT .= "  SSLRequireSSL on"; }
}
  AddType application/x-httpd-php .php .php3 .phtml
  Options None
  Options +Indexes
  Options +Includes
  order deny,allow
  deny from all
{
    my $ocspa = $ocs{'PublicAccess'} || "local";
    if ($ocspa eq "local")
      { $OUT .= "  allow from $localAccess"; }
    else
      { $OUT .= "  allow from all"; }
}
  php_admin_value open_basedir /opt/inventory/ocs:/tmp
  php_admin_value post_max_size { $ocs{MaxUpload} }
  php_admin_value upload_max_filesize { $ocs{MaxUpload} }
#  php_value max_execution_time -1
#  php_value max_input_time -1
</Directory>

PerlSetEnv OCS_MODPERL_VERSION 1

PerlSetEnv OCS_LOGPATH "/var/log/ocsinventory-NG"

PerlSetEnv OCS_DB_HOST localhost
PerlSetEnv OCS_DB_PORT 3306
PerlSetEnv OCS_DB_NAME { $ocs{DbName} }
PerlSetEnv OCS_DB_LOCAL { $ocs{DbName} }
PerlSetEnv OCS_DB_USER { $ocs{DbUser} }
PerlSetVar OCS_DB_PWD { $ocs{DbPassword} }

PerlSetEnv OCS_OPT_FREQUENCY 0
PerlSetEnv OCS_OPT_PROLOG_FREQ 24
PerlSetEnv OCS_OPT_DEPLOY 1
PerlSetEnv OCS_OPT_TRACE_DELETED 0
PerlSetEnv OCS_OPT_AUTO_DUPLICATE_LVL 7
PerlSetEnv OCS_OPT_LOGLEVEL 0
PerlSetEnv OCS_OPT_INVENTORY_DIFF 1
PerlSetEnv OCS_OPT_INVENTORY_TRANSACTION 1
PerlSetEnv OCS_OPT_PROXY_REVALIDATE_DELAY 3600
PerlSetEnv OCS_OPT_LOCK_REUSE_TIME 3600
PerlSetEnv OCS_OPT_IPDISCOVER 2
PerlSetEnv OCS_OPT_IPDISCOVER_MAX_ALIVE 7
PerlSetEnv OCS_OPT_IPDISCOVER_LATENCY 100
PerlSetEnv OCS_OPT_REGISTRY 0
PerlSetEnv OCS_OPT_UPDATE 0
PerlSetEnv OCS_OPT_DOWNLOAD 0
PerlSetEnv OCS_OPT_DOWNLOAD_FRAG_LATENCY 10
PerlSetEnv OCS_OPT_DOWNLOAD_CYCLE_LATENCY 0
PerlSetEnv OCS_OPT_DOWNLOAD_PERIOD_LATENCY 0
PerlSetEnv OCS_OPT_DOWNLOAD_TIMEOUT 30
PerlSetEnv OCS_OPT_WEB_SERVICE_ENABLED 0
PerlSetEnv OCS_OPT_PROLOG_FILTER_ON 1
PerlSetEnv OCS_OPT_INVENTORY_FILTER_ON 1
PerlSetEnv OCS_OPT_INVENTORY_FILTER_FLOOD_IP 1
PerlSetEnv OCS_OPT_INVENTORY_FILTER_FLOOD_IP_CACHE_TIME 60

PerlModule Apache::DBI
PerlModule Compress::Zlib
PerlModule XML::Simple

PerlModule Apache::Ocsinventory
PerlModule Apache::Ocsinventory::Server::Constants
PerlModule Apache::Ocsinventory::Server::System
PerlModule Apache::Ocsinventory::Server::Communication
PerlModule Apache::Ocsinventory::Server::Inventory
PerlModule Apache::Ocsinventory::Server::Duplicate
PerlModule Apache::Ocsinventory::Server::Option::Registry
PerlModule Apache::Ocsinventory::Server::Option::Update
PerlModule Apache::Ocsinventory::Server::Option::Ipdiscover
PerlModule Apache::Ocsinventory::Server::Option::Download

<Location /ocsinventory>
  order deny,allow
{
    my $ocsia = $ocs{'InventoryAccess'} || "local";
    if ($ocsia eq "local")
      { $OUT .= "  allow from $localAccess"; }
    else
      { $OUT .= "  allow from all"; }
}
  Satisfy Any
  SetHandler perl-script
  PerlHandler Apache::Ocsinventory
</Location>

PerlModule Apache::Ocsinventory::SOAP;
<location /ocsinterface>
  SetHandler perl-script
  perlHandler "Apache::Ocsinventory::SOAP"
  order deny,allow
{
    my $ocsia = $ocs{'InventoryAccess'} || "local";
    if ($ocsia eq "local")
      { $OUT .= "  allow from $localAccess"; }
    else
      { $OUT .= "  allow from all"; }
}
  Satisfy any
</location>
#--------------------------------------------------------------

