Previous | Contents | Index |
Sheerpower Internet Services (SPINS) Webserver comes bundled with Sheerpower. The SPINS webserver allows anyone to make web-based applications, even on their own local computers not connected to the Internet, without having to purchase a webserver license. And, of course, the SPINS webserver is very easy to install and use.
SPINS webserver also supports CORS. Click here to read more about CORS support.
For more documentation on writing network and web-based applications with Sheerpower, see Section 18.3, Webserver CGI Interface.
By default, the SPINS webserver (spins_webserver.exe) is installed to the following directory:
Example 17-1 SPINS Location |
---|
\sheerpower\sphandlers\ |
This will assume that the root folder is:
\sheerpower\sphandlers\wwwroot\ |
SPINS_webserver expects the directory structure to be:
[wherever SPINS_webserver.exe is] | [wwwroot]--> things like INDEX.HTML | | [images] [scripts] |
If you are replacing IIS with the SPINS_webserver, you would execute the following command inside the Command Prompt program:
Example 17-2 Replacing IIS with SPINS |
---|
c:> \sheerpower\sphandlers\spins_webserver.exe -wwwroot "c:\inetpub\wwwroot" |
The -wwwroot option tells the SPINS webserver where
the root folder is.
17.1.1 Stop Microsoft IIS Webserver
To run SPINS webserver, the Microsoft IIS webserver must be stopped or a different port specified for either webserver. Before running SPINS webserver for the first time:
Attempting stop... Internet services successfully stopped Attempting start... Internet services successfully restarted |
To specify a different port number for SPINS to use, see Section 17.1.3, Specify a Different Port Number.
To test SPINS webserver:
http://localhost |
This will open up the .HTML file located in:
sheerpower/sphandlers/wwwroot/index.html |
To tell the SPINS webserver to use a different port number from the default port 80, start it from the Command Prompt program or with a PASS NOWAIT statement within your program using the following syntax:
Example 17-3 Syntax to Change Port Number Used |
---|
spins_webserver -port nn |
For example, to change from the default port 80 to port 8080:
spins_webserver -port 8080 |
If you need to utilize some of the IIS facility, you can set the IIS webserver to use port 8080 and the SPINS websever to use port 80 (or the other way around). Both webservers can co-exist this way. |
If a request comes in to SPINS webserver on port 4, it must be from the localhost (current computer). Any other requests on port 4 are ignored. This can be used to ensure that certain requests are only processed from the local computer and not from the Internet.
To run web-based applications on multiple ports, the following syntax is used:
Example 17-4 Syntax to Specify Multiple Ports |
---|
spins_webserver -port 80 -wwwroot c:\root1 -port 8080 -wwwroot c:\root2 |
Each -port nn lets you specify a port. In the above example, we are listening on TWO ports:
80 and 8080 |
You can tell the SPINS webserver to use a specific root folder by performing the following command inside the Command Prompt program:
Example 17-5 Specify SPINS webserver root folder |
---|
spins_handler -wwwroot "c:\inetpub\wwwroot" |
Another example would be:
SPINS_webserver -wwwroot "c:\myplace\stuff\" |
This would mean than the INDEX.HTML file would be in:
c:\myplace\stuff\index.html |
For a list of options (like specifying the wwwroot folder), type the following command inside the Command Prompt program:
Example 17-6 SPINS Webserver Options Command |
---|
C:\sheerpower\sphandlers> spins_webserver -? |
The command will return the following options (subject to change):
c:\Sheerpower\sphandlers>spins_webserver -? SheerPower InterNet Services Web Server SPINS_WEBSERVER V7.01 Copyright (c) 2005-2015 Touch Technologies, Inc. - Thu, 04 Jun 2015 15:16:29 spins_webserver [-option value] [-nextoption value] ... -? or -help FOR this display -ipaddr xxx.xxx.xxx.xxx TO specify AP address to listen on -port ## TO specify port to listen on -https ## TO specify port to listen on -hosts filespec TO specify the HOSTS file to open -container filespec TO specify the CONTAINER File to open -urltrans filespec TO specify the URL Translation file to open -cafile filespec FOR Certificate Authority File -certfile filespec FOR Certificate File -clientcert never FOR Do not use Client Certificates -clientcert allowed FOR Use Client Certificates if available -clientcert required FOR ALWAYS Use Client Certificates -keyfile filespec FOR Private Key File (default = certfile) -keypass password FOR Private Key File Password -recvbuf_def ### TO specify receive buffersize -recvbuf_max ### TO specify MAXIMUM receive buffersize -sendbuf_def ### TO specify send buffersize -threads ## TO specify number of threads to use -virtual hostname pathname TO specify a virtual host and wwwroot -wwwroot pathname TO specify the wwwroot directory -flags [NOEXCLUSIVE][:DISPLAY_GET][:DISPLAY_PUT] [:DISPLAY_RECV][:DISPLAY_SEND][:DISPLAY_TCPIP][:STATUS_CONN] [:SSL_ERRORS][:DEBUG][:MISC_DEBUG] -handler handlername TO specify handler to log requests for -oldreqs ### TO log requests older than ### msecs |
Any parameters before a -port or -https will become the global defaults. Those parameters after the -port or -https will be specific to that port. |
Previous | Next | Contents | Index |