External Web Server Configuration

Top  Previous  Next

CirrusPrint by default is configured to run a private instance of Apache on the server where it is installed.  Most standard Linux Apache or Nginx configurations are recognized and automatically set up, and on Windows, Nginx is bundled with CirrusPrint.  However, there may be sites, such as those with multiple tenants on a public server, that prefer to configure their own web server with name-based or IP-based virtual hosts, so that clients connecting to a particular domain name or IP address and port can be assigned explicitly to a particular company/group.

 

The main goal of configuration of an external web server is to create an SCGI proxy configuration for /run/, and also a directory configuration for web and bins paths to the web and bins subdirectories under the CirrusPrint server.  Note that the server must support either Apache or Nginx methods of forwarding a file specified by the SCGI service.  This is specified by one of two headers: X-Sendfile, which points to a full path as supported by Apache, or X-Accel-Redirect, which points to a /temp/ configured file.  See the apache.tpl or nginx.tpl templates for examples.

 

If you wish to create namespace-based company/tenant configurations, CirrusPrint can build Apache configuration files for you.  To do this, set a namespace path in the configuration page.  As you save companies, CirrusPrint will build files in the apache subdirectory that are compatible with Apache 2.2 or higher, and you can simply add an Include command in to that directory (i.e. Include /opt/cp20/apache/*.conf) and restart Apache whenever the CirrusPrint company or site configuration changes.

 

Apache Configuration Samples

 

A file apache.sample.txt is provided with three example configurations for an Apache server.  The file is self documenting.  Note that when restarting the CirrusPrint server, if there were configuration changes affecting external web server integration, such as the SCGI port, the external web server may also require restarting..

 

# Sample file for setting up an Apache Web Server <VirtualHost> to a CirrusPrint server.

# An experienced web server administrator can use these examples to define configuration

# sections or include files for an Apache web server.  The examples assume the CirrusPrint

# server is installed in /u0/cp20, the SCGI server is listening on the default 8484

# port, and the systems LAN address is 192.168.10.

 

# Configuring an external web server to work with CirrusPrint offers these benefits:

# - Support multi-tenancy without requiring a Company ID for authentication

# - Enable access through standard HTTP/HTTPS ports

 

# As these facilities are configured, companies in CirrusPrint can be configured to

# match the URLs defined.  A matching URL enforces a company ID.

 

 

# NAME BASED VIRTUAL HOST

# This setup uses a name-based virtual host.  The key is the matching of ServerName

# to the http domain used by a browser user.  Using name-based virtual hosting allows

# multiple domains to be served.  Each company can be configured to match to a given

# host name.

#Listen 8080

<VirtualHost 192.168.1.10:80>

 ServerName inhouse.local

 DocumentRoot /u0/cp20/web

 Alias /bins/ /u0/cp20/bins/

 ProxyPass /run/ scgi://127.0.0.1:8484/

 ProxySCGISendfile On

 DirectoryIndex index.html

 <Directory /u0/cp20/web>

       Options FollowSymLinks ExecCGI

 </Directory>

 AddType text/cache-manifest .appcache

 ExpiresActive On

 ExpiresByType text/cache-manifest A30

</VirtualHost>

 

# PORT-BASED VIRTUAL HOST

# In this example, a different port is assigned for each virtual host, and it is bound

# to a particular IP address.

Listen 192.168.1.10:8888

<VirtualHost 192.168.1.10:8888>

 DocumentRoot /u0/cp20/web

 Alias /bins/ /u0/cp20/bins/

 ProxyPass /run/ scgi://127.0.0.1:8484/

 ProxySCGISendfile On

 DirectoryIndex index.html

 <Directory /u0/cp20/web>

       Options FollowSymLinks ExecCGI

 </Directory>

 AddType text/cache-manifest .appcache

 ExpiresActive On

 ExpiresByType text/cache-manifest A30

</VirtualHost>

 

# NAMESPACE HOSTS

# Rather than separate hostnames or ports, you can configure multiple prefixes to work

# with the CirrusPrint server.  In this example, the prefix /cp/acme is used, and the

# Acme company could be configure to match http://myhost.com/cp/acme.  These definitions

# could go inside a <VirtualHost> section, or reside in the main configuration.

 

# NOTE: this type of configuration can be automatically set up by specifying a namespace prefix

# in site configuration.  CirrusPrint then creates company namespace configuration files in the

# apache subdirectory, which can then be included in an external Apache server with the Include

# directive, such as Include /u0/cp20/apache/*.conf.

 

Alias /cp/acme/bins /u0/cp20/bins

Alias /cp/acme /u0/cp20/web

ProxyPass /cp/acme/run/ scgi://127.0.0.1:8484/

ProxySCGISendfile On

AddType text/cache-manifest .appcache

ExpiresActive On

ExpiresByType text/cache-manifest A30