Support > General Discussions

SBHTTPD

<< < (2/2)

Support:

--- Code: ---
client (
    allowed "127.0.0.1/255.255.255.255"
    allowed "16.94.58.4/0.0.0.0"

    denied "127.0.0.1/0.0.0.0"
    denied "16.192.68.5/255.255.0.0"
    )

--- End code ---



--- Quote from: "Peter Verhas" ---
You can define the client IPs that are allowed and denied to connect to the engine. This is the real client that is connecting to the listener on the socket and trying to get access via HTTP and not the client reported by any proxy header field. You can use this configuration option to allow only the web server machine to connect to the engine via the proxy module and disallow all external connections that may try to connect from external machines. You can also use this option to configure a client application not to be accessed by external computer.

A connection is accepted by the engine if there is at least one allowed configuration line that allows the connection and there is no any denied configuration line that denies the connections.

The string following the keywords allowed or denied should contains the IP number and the MASK separated by a slash. When the client IP is calculated first it is bitwise AND-ed by the MASK and compared to the IP number. Thus

allowed "127.0.0.1/255.255.255.255"

allows only connections from the localhost and

denied "127.0.0.1/0.0.0.0"

denies access for no-one (in other word this line is waste of CPU and text file, but is good as an example). The line

denied "16.192.68.5/255.255.0.0"

disallows all requests that come from an IP number 16.192.*.* that is some internal sub-network of the once existed firm: Digital Equipment Corporation.

--- End quote ---


The ScriptBasic application server gives you the flexibility to extend your reach to other system facilities but gives you the means to protect your site from unwanted external activity. (web and intranet environments)

And finally to answer your original question.


--- Code: ---
' sibawastart.bas
'
' This program is started by the SIBAWA system when the application starts.
'
' This program loads the cache authentication and access control into memory
' and also maintains the session data handling session time outs.

--- End code ---


This feature manages the directory .htaccess authentication and caches it. Peter has included session handling support and a browser based management interface to setup users and access levels.


--- Quote ---If you have information on your web site that is sensitive, or intended for only a small group of people, the techniques in this tutorial will help you make sure that the people that see those pages are the people that you wanted to see them.
--- End quote ---

Apache Authentication, Authorization, and Access Control

(One of the ScriptBasic gifts I haven't opened yet.  :wink: )

btechint:
I was able to get sbhttd working. I had questions about the ip allow-disallow, but your help notes answered them. I was also wondering about the pid.txt. A problem I have now is that the sbhttd will not stop. I have tried
sbhttd stop
sbhttd -stop
I see that I can use kill [-pid (number)]. Not sure yet what that is or how to use it.

Here is what I did. Edited the scriba.conf.lsp file so everything pointed to my dir's. Deleted the sibawa references. Changed the ip list to;
allowed "127.0.0.1/255.255.255.255"
port 80

Made a new scriba.conf using:

scriba -k scriba.conf.lsp

When I enter:

sbhttd -start

The example files load and seem to work.

sbhttp -install

seems to work

Being a complete newb, have some concern about leaving my system open the scrupulous from the net, will have to figure out the IP thing.

Thanks

Support:

--- Quote ---
I was able to get sbhttd working. I had questions about the ip allow-disallow, but your help notes answered them. I was also wondering about the pid.txt. A problem I have now is that the sbhttd will not stop. I have tried
sbhttd stop
sbhttd -stop
I see that I can use kill [-pid (number)]. Not sure yet what that is or how to use it.

--- End quote ---


The pid.txt file contains the main active process ID for sbhttpd. Just cat the file, get the number and kill -9 ####.

You can delete the pid.txt file and sbhttpd will die on it's own. (it may take a minute due to running threads need to finish)

Good to hear you got it going !

John

Support:

--- Quote from: "btechint" ---
note; this is on an windows xp system

--- End quote ---


Sorry about that. Well at least you'll know how to install it on a Linux box when your ready. :)

Here is my local XP / Apache basic.conf file as an example.


--- Code: ---
; ScriptBasic sample configuration file
;
; Note that this configuration file format is from v1.0b19 or later and has to be compiled
; to internal binary format before starting ScriptBasic

; this is the extension of the dynamic load libraries on this system
dll ".dll"

; where the modules are to be loaded from
module "C:/scriptbasic/\\modules\\"

; where to search system and module include files
; trailing / or \ is needed
include "C:/scriptbasic/\\include\\"

; this is where modules should install their documentation
docu "C:/scriptbasic/\\doc\\"

; the maximum number of includes that script basic processes
; this will stop the reading when the programmer makes error
; and includes files recursively. 1000 is the default value
maxinclude 100

;
; define preprocessors
;
preproc (
  internal (
    dbg "C:/scriptbasic/\\modules\\dbg.dll"
    )
  )
;
; LIMIT VALUES TO STOP INIFINITE LOOP
;

; the maximal number of steps allowed for a program to run
; comment it out or set to zero to have no limit
maxstep 0

; the maximal number of steps allowed for a program to run
; inside a function.
; comment it out or set to zero to have no limit
maxlocalstep 0

; the maximal number of recursive function call deepness
; essentially this is the "stack" size
maxlevel 300


; the maximal memory in bytes that a basic program is allowed to use
; for its variables
maxmem 0

;
; This is the directory where we store the compiled code
; to automatically avoid recompilation
;
; cache "C:/scriptbasic/\\cache\\"

cgi (
;
; These are the keys used by the CGI module
;
  debugfile "C:/scriptbasic/\\cgidebug.txt"
  )

;
; MySQL configuration
;
mysql (
  connections (
    ABC (             ; the name of the connection
    host "127.0.0.1"     ; the host for the connection
    db "db_abc"             ; database for the connection
    user "dbadmin"          ; user for the connection
    password "dbpw" ; password for the connection
    port 3306            ; the port to use
    socket ""            ; the name of the socket or ""
    flag 0               ; the client flag
    clients 10           ; how many clients to serve before really closing the connections
    )
  )
 )
;
; Configure the simple ScriptBasic httpd daemon
;
; Note that scripts may change the working directory therefore
; all directories should be specified here full path. For example
; the directory names here do not include the drive c: or e:
; because I develop it on two machines and it was inconvenient
; to alter and recompile the config file each time I moved the
; source to the other machine. When I run a script that changes
; the drive the http daemon stops in a few seconds because the
; guard thread do not find the pid file and therefore tells the
; engine to stop.
;
servers (
  server (
    port 8080
    ip "127.0.0.1"
    protocol "http"
   )
  threads 1024
  listenbacklog 3
  home "C:\\Program Files\\Apache Software Foundation\\Apache2.2\\htdocs\\app\\"
  proxyip 1
  pid (
    file "C:/scriptbasic/\\httpdlog\\pid.txt"
    delay 60
    wait (
      period 10
      length 1
     )
   )
  vdirs (
    dir "/sb/:C:\\Program Files\\Apache Software Foundation\\Apache2.2\\htdocs\\app\\sb\\"
    dir "/fts/:C:\\Program Files\\Apache Software Foundation\\Apache2.2\\htdocs\\app\\fts\\"
    dir "/nwmls/:C:\\Program Files\\Apache Software Foundation\\Apache2.2\\htdocs\\app\\nwmls\\"
    )

  errmsgdest 3
  nolog 1 ; set this true not to use logs or ignore erroneouslog configuration
  log (
    panic ( file "C:/scriptbasic/\\httpdlog\\panic.log" )
    app   ( file "C:/scriptbasic/\\httpdlog\\app.log" )
    err   ( file "C:/scriptbasic/\\httpdlog\\err.log" )
    hit   ( file "C:/scriptbasic/\\httpdlog\\hit.log" )
    stat  ( file "C:/scriptbasic/\\httpdlog\\stat.log" )
    )
  ; the error page when a page is not found
msg404 """
<HTML>
<HEAD>
<TITLE>Error 404 page not found</TITLE>
</HEAD>
<BODY>
<FONT FACE="Verdana" SIZE="2">
<H1>Page not found</H1>
We regretfully inform you that the page you have requested can not be found on this server.
<p>
In case you are sure that this is a server configuration error, please contact
<FONT SIZE="3"><TT>root@localhost</TT></FONT>
</FONT>
</BODY>
</HTML>
 """
  code404 "200 OK" ; the http error code for page not found. The default is 404
  ; the program to run when a page is not found
  ;run404 "C:/scriptbasic/\\source\\examples\\run404.bas"
  )

--- End code ---


John

Navigation

[0] Message Index

[*] Previous page

Go to full version