[[#wd Lookup TitleRecipe40 ]]

Overview

In fact: COAST is allready a http-server! Youd don't need any Apache, Internet Information Server or other http-server. This example show you the different parameters for configuring a http(s)-server.

Preconditions

Steps to do:

  1. Define on which ports the server is listening.
    Server.any:
    [[#wd DisplayAnythingRenderer {
    	/AnythingInfo {
    		"/ListenerPool {					# this server listens on 2 ports"
    		"	HTTP HTTPS"
    		"}"
    	}
    }]]
    
  2. Define the port number and security-files. For the https service you have to define a certification and a key file. You can produce them by using the tools from OpenSSL (http://www.openssl.org).
    Config.any:
    [[#wd DisplayAnythingRenderer {
    	/AnythingInfo {
    		"/HTTP {      # defines http listener"
    		"	/Port 8895"
    		"}"
    		"/HTTPS {     # defines https listener"
    		"	/Port 8896"
    		"	#--- SSL configuration needs certificate and private key files"
    		"	/CertFile  "recipes_cert.pem""
    		"	/KeyFile   "recipes_key.pem""
    		"}"
    	}
    }]]
    
  3. For resolving a valid BaseAddress you have to enter the HostName.
    Server.any:
    [[#wd DisplayAnythingRenderer {
    	/AnythingInfo {
    		"/UseBaseURL   0      # switches use of base URL on/off"
    		"/HostName     "marvin.itopia.loc""
    		"/BaseAddress {"
    		"	/Condition {"
    		"		/ContextCondition { header.HTTPS }"
    		"		/True   { "https://" {/Lookup HostName} ":" {/Lookup HTTPS.Port} "/" }"
    		"		/False  { "http://" {/Lookup HostName} ":" {/Lookup HTTP.Port} "/" }"
    		"	}"
    		"}"
    	}
    }]]
    

Remarks

Glossary

Related Topics