Support > General Discussions

SBHTTPD

(1/2) > >>

btechint:
When I:

SBHTTPD -start

After a short while this error:

d:\sb\source\examples\sibawa\sibawastart.bas(0): error &H44:The file can not be read.

------------

This is on a clean-new install, winxp. I installed at: d:\sb

There are no directories in the source dir.

\examples is:
 sb\examples

there is no \sibawa
there is no
sibawastart.bas

----------

My guess is that the config file in the bin dir has info error?

My main area of learning is in trying to get the http engine working, and then getting a server working with the http engine. I need to run cgi perl scripts locally to build database files.

thanks, John

note; this is on an windows xp system

Support:
Hi John,

The sibawastart.bas program I believe is part of the authorization extension to Apache and isn't needed to get the application server (sbhttpd) running. Just remove those startup lines in the basic.conf file.

I have three separate sbhttpd servers running on the scriptbasic.net server that work great.

Feel free to send me your basic.conf to have a peek at if you like.

support@scriptbasic.org

John

Support:
To install ScriptBasic (scriba & sbhttpd) on a CentOS 5 (Red Hat recompile), place the Linux files in the following directories.

--- Code: ---
/usr/bin
-rwxr-xr-x 1 root root 508070 Jan 25 21:30 sbhttpd
-rwxr-xr-x 1 root root 482077 Jan 24 19:21 scriba

/usr/lib/scriba
-rwxr-xr-x 1 root root   43894 May 11  2006 cgi.so
-rwxr-xr-x 1 root root 2016573 May 16  2006 curl.so
-rwxr-xr-x 1 root root   18328 May 11  2006 dbg.so
-rwxr-xr-x 1 root root  738419 May 11  2006 gd.so
-rwxr-xr-x 1 root root   11024 May 11  2006 hash.so
-rwxr-xr-x 1 root root   22367 Jul 24  2007 mt.so
-rwxr-xr-x 1 root root   21646 Jan 17 23:18 mysql.so
-rwxr-xr-x 1 root root  454982 May 11  2006 odbc.so
-rwxr-xr-x 1 root root   31223 May 16  2006 pgsql.so
-rwxr-xr-x 1 root root  358109 May 11  2006 psql.so
-rwxr-xr-x 1 root root   51669 May 11  2006 re.so
-rwxr-xr-x 1 root root   10581 May 11  2006 t.so
-rwxr-xr-x 1 root root    2772 May 11  2006 ux.so
-rwxr-xr-x 1 root root  595207 May 11  2006 zlib.so

/usr/include/scriba
-rw-r--r-- 1 root root 5438 May 11  2006 cgi.bas
-rw-r--r-- 1 root root  731 May 16  2006 curl.bas
-rw-r--r-- 1 root root  721 May 11  2006 dbg.bas
-rw-r--r-- 1 root root 8331 May 11  2006 error.bas
-rw-r--r-- 1 root root 2274 May 11  2006 gd.bas
-rw-r--r-- 1 root root 2028 May 11  2006 hash.bas
-rw-r--r-- 1 root root  214 May 11  2006 heb.bas
-rw-r--r-- 1 root root 9968 May 11  2006 modinst.bas
-rw-r--r-- 1 root root 1178 Jul 24  2007 mt.bas
-rw-r--r-- 1 root root   10 May 11  2006 my.bas
-rw-r--r-- 1 root root 1709 May 11  2006 mysql.bas
-rw-r--r-- 1 root root  590 May 11  2006 odbc.bas
-rw-r--r-- 1 root root 1592 May 16  2006 pgsql.bas
-rw-r--r-- 1 root root 2119 May 11  2006 re.bas
-rw-r--r-- 1 root root  945 May 11  2006 t.bas
-rw-r--r-- 1 root root  578 May 11  2006 time.bas
-rw-r--r-- 1 root root  551 May 11  2006 ux.bas
-rw-r--r-- 1 root root  997 May 11  2006 zlib.bas

/etc/scriba
-rw-r--r-- 1 root root 1682 Jan 25 20:37 basic.conf
-rw-r--r-- 1 root root 1102 Jan 25 20:35 basic.conf.txt

/var/log/scriba
-rw-r--r-- 1 root root 1626 Jan 25 21:32 app.log
-rw-r--r-- 1 root root    0 Jan 25 20:34 err.log
-rw-r--r-- 1 root root  976 Jan 25 21:33 hit.log
-rw-r--r-- 1 root root    0 Jan 25 20:30 panic.log
-rw-r--r-- 1 root root    5 Jan 25 21:32 pid.txt
-rw-r--r-- 1 root root    0 Jan 25 20:34 start.log

Note: Create empty log files to get started.

--- End code ---


Here is a 'bare bones' basic.conf file for both scriba and sbhttp under CentOS 5.

--- Code: ---
dll ".so"
module "/usr/lib/scriba/"
include "/usr/include/scriba/"
preproc (
  internal (
    dbg "/usr/lib/scriba/dbg.so"
   )
 )
maxstep 0
maxlocalstep 0
maxlevel 55440
maxmem 0
servers (
  server (
    port 8080
    ip "127.0.0.1"
    protocol "http"
   )
  threads 1024
  listenbacklog 3
  home "/var/www/html/app-bin/"
  proxyip 1
  pid (
    file "/var/log/scriba/pid.txt"
    delay 10
    wait (
      period 10
      length 1
     )
   )
  errmsgdest 3
  nolog 0
  log (
    panic (
      file "/var/log/scriba/panic.log"
     )
    app (
      file "/var/log/scriba/app.log"
     )
    err (
      file "/var/log/scriba/err.log"
     )
    hit (
      file "/var/log/scriba/hit.log"
     )
    stat (
      file "/var/log/scriba/stat.log"
     )
   )
  msg404 """

Error 404 page not found

Page not found
We regretfully inform you that the page you have requested can not be found
on this server.

In case you are sure that this is a server configuration error, please
contact the site administrator.

"""
  code404 "200 OK"
 )

--- End code ---


The ScriptBasic interpreter and application server both use the same compiled configuration file. Maintain your basic.conf.txt file in a text editor. Next convert it to the binary format ScriptBasic uses by typing the following command at a console prompt in the /etc/scriba directory.

scriba -k basic.conf.txt


At a minimal, make sure these proxy modules are enabled.

--- Code: ---
LoadModule proxy_module modules/mod_proxy.so
LoadModule proxy_http_module modules/mod_proxy_http.so

--- End code ---


Here is what I added to the end of Apache's httpd.conf file.

--- Code: ---
# ScriptBasic Application Server
ProxyPass /app-bin/ http://127.0.0.1:8080/
ProxyPassreverse /app-bin/ http://127.0.0.1:8080/

--- End code ---


You can optionally set the SCRIBACONF environment variable to the full path and filename of where your basic.conf file is located and named. (/etc/scriba/basic.conf is the default location and name if the ScriptBasic environment variable isn't set)

After restarting Apache for the proxy addition, enter the following at a console prompt.

sbhttpd -start

All requests to the /app-bin directory are sent to the ScriptBasic application server to be process.

To stop the server, kill -9 the process ID # in the pid.txt file.

John

Support:
You can expand your application directory structure and hide it's files behind the web root directory. The "/var/www/html/app-bin" directory is the interface between Apache and sbhttpd. It doesn't have to contain any files if you use the ScriptBasic "vdirs" feature.

--- Code: ---
  vdirs (
    dir "/client/:/var/www/private/"
   )

--- End code ---


http://sb.dev/app-bin/echo.bas   <-- this will run echo.bas in the webroot /app-bin (if you prefer, the 'home' directory can be defined below webroot , another drive, ... which allows for virtual mapping of your script resources.)

http://sb.dev/app-bin/client/echo.bas  <-- this runs the client version of the program located below the webroot in the private directory

--- Code: ---
Partial echo.bas output:

ServerSoftware  = ScriptBasic Application Server 2.1.1
ServerName      = undef
GatewayInterface= CGI/1.1
ServerProtocol  = HTTP/1.1
ServerPort      = 80
RequestMethod   = POST
PathInfo        = undef
PathTranslated  = /var/www/private/echo.bas
ScriptName      = echo.bas
QueryString     =
RemoteHost      = 192.168.1.101
RemoteAddress   = 192.168.1.101
AuthType        = undef
RemoteUser      =
RemoteIdent     = undef
ContentType     = application/x-www-form-urlencoded
ContentLength   = 44
UserAgent       = Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.11) Gecko/20071127 Firefox/2.0.0.11
Cookie          = cookie1=1; cookie2=2; cookie3=3
Referer         = http://sb.dev/app-bin/client/echo.bas
Password        =
Full auth string= undef

--- End code ---


--- Code: ---
/var/www/
drwxr-xr-x  4 root      root 4096 Jan 15 17:36 cgi-bin
drwxr-xr-x  3 root      root 4096 Jan 25 02:47 error
drwxr-xr-x  3 root      root 4096 Jan 25 20:13 html
drwxr-xr-x  3 root      root 4096 Jan 25 02:47 icons
drwxr-xr-x 14 root      root 4096 Jan 25 02:47 manual
drwxr-xr-x  2 root      root 4096 Jan 26 18:20 private
drwxr-xr-x  2 webalizer root 4096 Jan 25 02:47 usage

/var/www/html/
drwxr-xr-x 2 root root 4096 Jan 26 18:20 app-bin

/var/www/html/app-bin/
-rw-r--r-- 1 root root 4068 Jan 26 01:33 echo.bas

/var/www/private/
-rw-r--r-- 1 root root 4068 Jan 26 06:32 echo.bas

--- End code ---


John

Support:
If you prefer not to expose your database host, login, password and db_name with the mysql::RealConnect() function, you can define this in the basic.conf file and use the mysql::Connect("accounting") function instead.

--- Code: ---
;
; MySQL configuration
;
mysql (
  connections (
    accounting (  ; the name of the connection
    host "127.0.0.1"  ; the host for the connection
    db "acct"  ; database for the connection
    user "db_user_id"  ; user for the connection
    password "db_password"  ; 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
    )
  )
 )

--- End code ---



John

Navigation

[0] Message Index

[#] Next page

Go to full version