--- /dev/null
+# Include this file in httpd.conf using:
+# ,,Include demarc.conf directive''
+
+# BEST WAY TO RUN demarc IS TO USE mod-ssl DUE TO SECURITY REASONS
+
+<IfModule !mod_ssl.c>
+# For Non-SSL (pleace your domain instead localhost)
+Redirect /demarc http://localhost//dm/demarc
+</IfModule>
+
+<IfModule mod_ssl.c>
+# For SSL (pleace your domain instead localhost)
+Redirect /demarc https://localhost/dm/demarc
+</IfModule>
+
+Alias /dm_images "/usr/share/demarc/images"
+
+<Directory "/usr/share/demarc/cgi">
+ AllowOverride all
+ DirectoryIndex demarc
+</Directory>
+
+
+<IfModule !mod_perl.c>
+# For regular Perl add:
+# --------------------
+ScriptAlias /dm "/usr/share/demarc/cgi"
+
+</IfModule>
+
+<IfModule mod_perl.c>
+# For Mod_Perl add:
+# --------------------
+
+ PerlModule Apache::Registry
+ KeepAlive Off
+ Alias /dm /usr/share/demarc/cgi
+
+<Location /dm>
+ SetHandler perl-script
+ PerlHandler Apache::Registry
+ Options ExecCGI
+ allow from all
+ PerlSendHeader On
+ DirectoryIndex demarc
+</Location>
+</IfModule>
--- /dev/null
+diff -urN demarc-1.05-RC1.org/bin/demarcd demarc-1.05-RC1/bin/demarcd
+--- demarc-1.05-RC1.org/bin/demarcd Sat Sep 1 14:40:42 2001
++++ demarc-1.05-RC1/bin/demarcd Sat Sep 1 14:43:17 2001
+@@ -78,7 +78,7 @@
+ # Get all options from the command line / conf file:
+ getopts("hDi:c:Ff:SkI",\%opts) || &print_usage;
+ &print_usage if $opts{'h'};
+-my $config_file = $opts{'f'} || "/usr/local/demarc/conf/demarcd.conf";
++my $config_file = $opts{'f'} || "/etc/demarcd/demarcd.conf";
+ %conf = &parse_config;
+
+ ############
+@@ -104,12 +104,12 @@
+
+ ##########
+ # Path/filename of logfile
+-my $logfile = &get_config_value("logfile") || "/usr/local/demarc/log/demarcd_log";
++my $logfile = &get_config_value("logfile") || "/var/log/demarcd";
+ ##########
+
+ ##########
+ # Path/filename of allowed commands file
+-my $cmdfile = &get_config_value("cmdfile") || "/usr/local/demarc/conf/regen.cmds";
++my $cmdfile = &get_config_value("cmdfile") || "/etc/demarcd/regen.cmds";
+ ##########
+
+ my $temp_binary_directories = &get_config_value("binary_dirs");
+@@ -152,7 +152,7 @@
+
+ if ($run_snort_locally){
+ $snort_binary_path = &binary_search($conf{'snort_binary'},"snort");
+- $snort_conf_file = $opts{'c'} || &get_config_value("snort_conf_file") || "/usr/local/demarc/conf/snort.conf";
++ $snort_conf_file = $opts{'c'} || &get_config_value("snort_conf_file") || "/var/state/demarcd/snort.conf";
+ $snort_options = &get_config_value("snort_options") || " -o -D -q ";#Special options for snort
+ }
+
+diff -urN demarc-1.05-RC1.org/cgi/DEMARC_config.pm demarc-1.05-RC1/cgi/DEMARC_config.pm
+--- demarc-1.05-RC1.org/cgi/DEMARC_config.pm Sat Sep 1 14:40:42 2001
++++ demarc-1.05-RC1/cgi/DEMARC_config.pm Sat Sep 1 14:44:04 2001
+@@ -23,7 +23,7 @@
+
+ $conf{'whois_command'} = "/usr/bin/whois";
+ $conf{'traceroute_command'} = "/usr/sbin/traceroute";
+-$conf{'nslookup_command'} = "/usr/sbin/nslookup";
++$conf{'nslookup_command'} = "/usr/bin/nslookup";
+ $conf{'ping_command'} = "/usr/sbin/ping";
+
+ $conf{'allow_anonymous_access'} = 0;
+diff -urN demarc-1.05-RC1.org/cgi/demarc demarc-1.05-RC1/cgi/demarc
+--- demarc-1.05-RC1.org/cgi/demarc Sat Sep 1 14:40:42 2001
++++ demarc-1.05-RC1/cgi/demarc Sat Sep 1 14:44:52 2001
+@@ -62,7 +62,7 @@
+ BEGIN{
+ # CHANGE this to reflect where you have your StaticServices.pm module
+ # which SHOULD be the same as where this script resides
+- push (@INC,"/usr/local/demarc/cgi");
++ push (@INC,"/usr/share/demarc/cgi");
+ };
+
+ use StaticServices; #Make SURE your cgi-bin directory is in your INC array above
+@@ -116,7 +116,7 @@
+ my $v_graphics_path = "/dm_images";
+ my $this_program = "demarc";
+ my $v_base_path = $conf{'v_base_path'};
+-my $base_path = "/usr/local/demarc/cgi";
++my $base_path = "/usr/share/demarc/cgi";
+ my $template_subdir = "/templates";
+ my $home_url = "$v_base_path/$this_program";
+ ##############################################
+diff -urN demarc-1.05-RC1.org/conf/demarcd.conf demarc-1.05-RC1/conf/demarcd.conf
+--- demarc-1.05-RC1.org/conf/demarcd.conf Sat Sep 1 14:40:42 2001
++++ demarc-1.05-RC1/conf/demarcd.conf Sat Sep 1 14:46:41 2001
+@@ -49,16 +49,16 @@
+ #
+
+ # Base path where DEMARC is installed: "/usr/local/demarc" is the default / suggested location
+-base_path = /usr/local/demarc
+-config_file = /usr/local/demarc/conf/demarcd.conf
+-pid_path = /usr/local/demarc/run
++base_path = /usr/share/demarc
++config_file = /etc/demarcd/demarcd.conf
++pid_path = /var/run
+
+
+ # Path/filename of logfile
+-logfile = "/usr/local/demarc/log/demarcd_log"
++logfile = "/var/log/demarcd"
+
+ # Path to allowed regenration commands/users list
+-cmdfile = "/usr/local/demarc/conf/regen.cmds"
++cmdfile = "/etc/demarcd/regen.cmds"
+
+
+ ###############
+@@ -68,8 +68,8 @@
+ run_snort_locally = yes
+
+ # Paths to snort related files
+-snort_binary_path = "/usr/local/bin/snort"
+-snort_conf_file = "/usr/local/demarc/conf/snort.conf"
++snort_binary_path = "/usr/sbin/snort"
++snort_conf_file = "/var/state/demarcd/snort.conf"
+
+ # If you have multiple interfaces and want to have snort monitor ONLY one of them,
+ # name the interface you wish to monitor below (ie "eth0")
--- /dev/null
+#!/bin/sh
+#
+# demarcd Network monitoring daemon
+#
+# chkconfig: 345 50 50
+# description: Netowk monitoring daemon which uses snort as NIDS
+#
+
+# Source function library
+. /etc/rc.d/init.d/functions
+
+# Get network config
+. /etc/sysconfig/network
+
+# Get service config
+[ -f /etc/sysconfig/demarcd ] && . /etc/sysconfig/demarcd
+
+# Check that networking is up.
+if is_yes "${NETWORKING}"; then
+ if [ ! -f /var/lock/subsys/network ]; then
+ # nls "ERROR: Networking is down. %s can't be run." <service>
+ msg_network_down demarcd
+ exit 1
+ fi
+else
+ exit 0
+fi
+
+# See how we were called.
+case "$1" in
+ start)
+ # Check if the service is already running?
+ if [ ! -f /var/lock/subsys/demarcd ]; then
+ msg_starting demarcd
+ daemon demarcd
+ RETVAL=$?
+ [ $RETVAL -eq 0 ] && touch /var/lock/subsys/demarcd
+ else
+ msg_Already_Running demarcd
+ exit 1
+ fi
+ ;;
+ stop)
+ # Stop daemons.
+ if [ -f /var/lock/subsys/demarcd ]; then
+ msg_stopping demarcd
+ killproc demarcd -TERM
+ rm -f /var/lock/subsys/demarcd > /dev/null 2>&1
+ else
+ msg_Not_Running demarcd
+ exit 1
+ fi
+ ;;
+ status)
+ status demarcd
+ RETVAL=$?
+ ;;
+ restart|reload)
+ $0 stop
+ $0 start
+ ;;
+ *)
+ msg_Usage "$0 {start|stop|restart|status}"
+ exit 1
+ ;;
+esac
+
+exit $RETVAL
+