<?xml version="1.0"?>
<yxorpconfig>
 
<!--

    This sample yxorp configuration file is shipped with the
    release. It is intended as an example, not for real use.
    Read the documentation that came with the release.

-->

<!-- Main yxorp configuration file -->


<!-- where the log files go -->

<log accesslog="/var/log/yxorpaccess" errorlog="/var/log/yxorperror" />


<!-- This is the tcp port the xml listener will run on -->

<configlistener port="7780" ipaddress="127.0.0.1" />


<!-- rule definitions -->


<!-- request rule that will check and modify a request -->

<rule id="rule1" type="request">
<![CDATA[

if (Host: ~/^[a-z\.]+$/) {
   Host: = "yxorp.sourceforge.net";
} else if (Host: ~/^[0-9\.]+$/) {
   reject("You are not allowed access through the IP address of this server");
} else {
  Host: = "yxorp.sourceforge.net";
}

]]>
</rule>


<!-- the reject rule will be executed if something is wrong with the request -->

<rule id="rule3" type="reject">
<![CDATA[

errorhtml="<html>
<head>
<title>Nicht Touchen, U only watchen das Blinkenlights!</title>
</head>
<body>
<h1>Error ";
errorhtml=concat(errorhtml, errorcode, " - ", rejectreason);
errorhtml=concat(errorhtml, "</h1></body></html>");

Server: = "yxorp-x.x";

]]>
</rule>


<!-- the definitions for the listeners -->

<listener
   id="test1"
   ipaddress="0.0.0.0"
   port="80"
   rule="rule1"
   rejrule="rule3"
/>


<server id="yxorp.sourceforge.net" virtualserver="group1" />

<virtualserver id="group1" schedule="lru">
   <real id="sf" />
</virtualserver>

<realserver id="sf" ip="dns" inservice="yes" />


</yxorpconfig>
