The ScaleOut StateServer REST API service can be run as a FastCGI application behind any web server that supports fixed TCP ports, UNIX-style sockets, or standard I/O file descriptors.
Note | |
---|---|
Microsoft Internet Information Services (IIS) is currently not supported. |
To use TCP ports, the service executable should be run with the "-tcp" command line argument. E.g., /usr/local/soss/soss_svc_web -tcp
. The service will accept FastCGI requests passed to the TCP port specified by Port
in the configuration file. See the section on Configuration for more detail on this configuration parameter.
To use named UNIX sockets, the service executable should be run with the "-unix" command line argument, specifying the filesystem
pathname to the named socket. E.g., /usr/local/soss/soss_svc_web -unix=/tmp/myprogram.sock
. The service will accept FastCGI requests passed to the named socket.
To use standard I/O (stdin and stdout), the service executable should be run without any command line arguments. E.g., /usr/local/soss/soss_svc_web
. The service will accept FastCGI requests passed to the standard input and output file descriptors.
Note | |
---|---|
The below samples are provided as a quick start for reference only. Proper configuration of web servers can be complex. If in doubt, consult the product documentation for the web server software. |
To configure the Nginx web server to forward HTTP requests to the ScaleOut StateServer REST API service as a FastCGI module, a sample virtual host configuration entry may look like the following:
Sample Nginx Configuration.
server { listen 80; server_name _; root /var/www; index index.html; location ~ / { include fastcgi.conf; # FastCGI passthru to TCP port 4001 on localhost fastcgi_pass 127.0.0.1:4001; # Alternatively, to passthru to a UNIX socket at /tmp/nginx4001.socket # Uncomment the following line (and comment the above fastcgi_pass directive): #fastcgi_pass unix:/tmp/nginx4001.socket; } try_files $uri $uri.html =404; }
Note | |
---|---|
Nginx does not automatically launch the FastCGI process if the process is not running. Typically, this results in a 502 Bad Gateway error. |
Configuring the Apache HTTP web server to support FastCGI requires the use of a FastCGI module, such as mod_fastcgi or mod_fcgid.
To configure the Apache HTTP web server to forward HTTP requests to the ScaleOut StateServer REST API service as a FastCGI module, a sample configuration might look like the following:
Sample Apache Configuration.
# Redirect requests from / to the FCGI application ScriptAlias / /usr/local/soss/soss_svc_web # Configuration for mod_fastcgi, if enabled <IfModule mod_fastcgi.c> # Assumes the below directory is writeable by the Apache user! FastCgiIpcDir /tmp/fcgi FastCgiServer /usr/local/soss/soss_svc_web <Directory /usr/local/soss/soss_svc_web> SetHandler fastcgi-script </Directory> </IfModule> # Alternative configuration for mod_fcgid, if enabled <IfModule mod_fcgid.c> # Assumes the below directory is writeable by the Apache user! FcgidIPCDir /tmp/fcgi FcgidWrapper /usr/local/soss/soss_svc_web <Directory /usr/local/soss/soss_svc_web> SetHandler fcgid-script </Directory> </IfModule>
Note | |
---|---|
There are many ways to configure FCGI applications. Check the Apache and mod_fastcgi/mod_fcgid documentation for alternatives. |