From 3fb2433cc7de9354b3759c35309ad69b1cad1e10 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?C=C3=A9dric=20de=20Saint=20Martin?= <cedric.dsm@tiolive.com>
Date: Thu, 10 May 2012 13:51:34 +0200
Subject: [PATCH] Documentation about Apache Frontend

---
 slapos/recipe/README.apache_frontend.txt      | 36 --------
 .../README.apache_frontend.txt                | 85 +++++++++++++++++++
 2 files changed, 85 insertions(+), 36 deletions(-)
 delete mode 100644 slapos/recipe/README.apache_frontend.txt
 create mode 100644 software/apache-frontend/README.apache_frontend.txt

diff --git a/slapos/recipe/README.apache_frontend.txt b/slapos/recipe/README.apache_frontend.txt
deleted file mode 100644
index 89da1b88f..000000000
--- a/slapos/recipe/README.apache_frontend.txt
+++ /dev/null
@@ -1,36 +0,0 @@
-apache_frontend
-==========
-
-Frontend using Apache, allowing to rewrite and proxy URLs like
-myinstance.myfrontenddomainname.com to real IP/URL of myinstance.
-
-apache_frontend works using the master instance / slave instance design.
-It means that a single main instance of Apache will be used to act as frontend
-for many slaves.
-
-
-How to use
-========
-First, you will need to request a "master" instance of Apache Frontend with
-"domain" parameter, like : 
-<?xml version='1.0' encoding='utf-8'?>
-<instance>
- <parameter id="domain">moulefrite.com</parameter>
- <parameter id="port">443</parameter>
-</instance>
-
-Then, it is possible to request many slave instances
-(currently only from slapconsole, UI doesn't work yet)
-of Apache Frontend, like : 
-instance = request(
-       software_release=apache_frontend,
-       partition_reference='frontend2',
-       shared=True,
-       partition_parameter_kw={"url":"https://[1:2:3:4]:1234/someresource"}
-     )
-Those slave instances will be redirected to the "master" instance,
-and you will see on the "master" instance the associated RewriteRules of
-all slave instances.
-
-Finally, the slave instance will be accessible from :
-https://someidentifier.moulefrite.com.
diff --git a/software/apache-frontend/README.apache_frontend.txt b/software/apache-frontend/README.apache_frontend.txt
new file mode 100644
index 000000000..49a11dee3
--- /dev/null
+++ b/software/apache-frontend/README.apache_frontend.txt
@@ -0,0 +1,85 @@
+apache_frontend
+===============
+
+Frontend system using Apache, allowing to rewrite and proxy URLs like
+myinstance.myfrontenddomainname.com to real IP/URL of myinstance.
+
+apache_frontend works using the master instance / slave instance design.
+It means that a single main instance of Apache will be used to act as frontend
+for many slaves.
+
+
+How to use
+==========
+
+First, you will need to request a "master" instance of Apache Frontend with
+"domain" parameter, like : 
+<?xml version='1.0' encoding='utf-8'?>
+<instance>
+ <parameter id="domain">moulefrite.com</parameter>
+ <parameter id="port">443</parameter>
+</instance>
+
+Then, it is possible to request many slave instances
+(currently only from slapconsole, UI doesn't work yet)
+of Apache Frontend, like : 
+instance = request(
+       software_release=apache_frontend,
+       partition_reference='frontend2',
+       shared=True,
+       partition_parameter_kw={"url":"https://[1:2:3:4]:1234/someresource"}
+     )
+Those slave instances will be redirected to the "master" instance,
+and you will see on the "master" instance the associated RewriteRules of
+all slave instances.
+
+Finally, the slave instance will be accessible from :
+https://someidentifier.moulefrite.com.
+
+Instance Parameters
+===================
+
+Master Instance Parameters
+--------------------------
+
+domain
+~~~~~~
+name of the domain to be used (example: mydomain.com). Subdomains of this domain will be used for the slave instances (example: instance12345.mydomain.com). It is then recommended to add a wildcard in DNS for the subdomains of the chosen domain like::
+  *.mydomain.com. IN A 123.123.123.123
+Using the IP given by the Master Instance.
+
+"domain" is a mandatory Parameter.
+
+port
+~~~~
+Port used by Apache. Optional parameter, defaults to 443.
+
+
+Slave Instance Parameters
+-------------------------
+
+url
+~~~
+url of backend to use.
+"url" is a mandatory parameter.
+Example : http://mybackend.com/myresource
+
+cache
+~~~~~
+Specify if slave instance should use a varnish / stunnel to connect to backend.
+Possible values : "true", "false".
+"cache" is an optional parameter. Defaults to "false". 
+Example : true
+
+zope
+~~~~
+Specify if slave instance will redirect to a zope backend. If specified, Apache RewriteRule will use Zope's Virtual Host Daemon.
+Possible values : "true", "false".
+"zope" is an optional parameter. Defaults to "false". 
+Example : true
+
+custom_domain
+~~~~~~~~~~~~~
+Domain name to use as frontend. The frontend will be accessible from this domain.
+"custom_domain" is an optional parameter. Defaults to [instancereference].[masterdomain]. 
+Example : www.mycustomdomain.com
-- 
2.30.9