Home > Articles > Data

  • Print
  • + Share This

Start AOLserver

Congratulations! You have finished your configuration chores! Now all you'll need to do is start AOLserver and verify that everything is working. First, log in as the user aolserver, run the following command, and hit Ctrl+C to terminate it:

[aolserver@goshawk aolserver]$ bin/nsd -ikt acs-pg.tcl
[23/Apr/2000:15:27:08][629.1024][-t1024-] Notice: nsd.tcl: starting to read config file...
[23/Apr/2000:15:27:08][629.1024][-t1024-] Warning: nsd.tcl: nscp not loaded because
 user/password is not set.
[23/Apr/2000:15:27:08][629.1024][-t1024-] Notice: nsd.tcl: finished reading config file.
[aolserver@goshawk aolserver]$ 

Ignore the warning that nscp was not loaded.

By default, AOLserver will create a log file named log/server.log. Carefully read this log file and look for errors. One common error is forgetting to compile nspostgres.c, the driver for PostgreSQL, or copying the resulting shared object to AOLserver's bin directory and therefore causing the server to fail when it tries to load the driver.

After the server has successfully initialized itself, the example initialization file (included with this article) causes it to load and start OpenACS. The software will try to interrogate a public Web site that lists known Web-crawling and similar robots, and will stuff information about them into a database table in order to refuse their access to portions of your site. If the computer on which you've installed this program isn't connected to the Internet, this will trigger errors that you can safely ignore.

If you have errors and cannot figure out their cause, try the Installation and Configuration help forum at the OpenACS Web site. The experienced users who frequent the site can help you figure out any problems you experience while trying to get this software up and running.

Now that you've inspected the log file and are satisfied that everything is working properly, start AOLserver again and point your browser at port 8000 to the IP you specified when you configured the software. If everything is working correctly, a login page will appear, and you'll be ready to customize your site. This process is described in the second article of this series.

Code Listing 3

# $Header: /cvsroot/aolserver/aolserver3/scripts/nsd.tcl,v 1.12 2000/04/12 15:52:37 kriston Exp $
#
# nsd.tcl --  The AOLserver Startup Script
#
#      This is a Tcl script that is sourced when AOLserver starts up.
#      A detailed reference is in "doc/config.txt".
#

ns_log notice "nsd.tcl: starting to read config file..."


#
# Set some Tcl variables that are commonly used throughout this file.
#

set httpport               8000
set httpsport              8443

set hostname               192.168.1.5
set address                192.168.1.5

set servername             "acspg"
set serverdesc             "OpenACS Test Server"

set homedir                [file dirname [ns_info config]]
set bindir                 [file dirname [ns_info nsd]]

set pageroot               /home/acs/acspg/www
set directoryfile          index.adp,index.html,index.htm,index.tcl

ns_section "ns/db/drivers"
ns_param    postgres       "nspostgres.so"

ns_section "ns/db/driver/postgres"
ns_param   datestyle       "iso"

ns_section "ns/db/pool/main"
ns_param   Driver          "postgres"
ns_param   Connections     4
ns_param   MaxOpen         1000000000
ns_param   MaxIdle         1000000000
ns_param   User            "acs"
ns_param   Verbose         "On"
ns_param   LogSQLErrors    "On"
ns_param   DataSource      "localhost::acs"

ns_section "ns/db/pool/subquery"
ns_param   Driver          "postgres"
ns_param   Connections     4
ns_param   MaxOpen         1000000000
ns_param   MaxIdle         1000000000
ns_param   User            "acs"
ns_param   Verbose         "On"
ns_param   LogSQLErrors    "On"
ns_param   DataSource      "localhost::acs"

ns_section "ns/db/pool/log"
ns_param   Driver          "postgres"
ns_param   Connections     4
ns_param   MaxOpen         1000000000
ns_param   MaxIdle         1000000000
ns_param   User            "acs"
ns_param   Verbose         "On"
ns_param   LogSQLErrors    "On"
ns_param   DataSource      "localhost::acs"

ns_section "ns/db/pools"
ns_param   main            "main"
ns_param   subquery        "subquery"
ns_param   log             "log"

ns_section                 "ns/parameters"

# nsssl: Only loads if keyfile.pem and certfile.pem exist.
#set sslkeyfile             ${homedir}/servers/${servername}/modules/nsssl/keyfile.pem
#set sslcertfile            ${homedir}/servers/${servername}/modules/nsssl/certfile.pem

# nscp: Uncomment the sample password and log in with "nsadmin", password "x",
#       type "ns_crypt newpassword salt" and put the new encrypted string below.
set nscp_user ""
#set nscp_user              "nsadmin:t2GqvvaiIUbF2:" ;# sample user="nsadmin", pw="x"


#
# Global server parameters
#
ns_section "ns/parameters"
ns_param   home            $homedir
ns_param   debug           false
ns_param   mailhost        "smtp.pacifier.com"


#
# Thread library (nsthread) parameters
#
ns_section "ns/threads"
ns_param   mutexmeter      true      ;# measure lock contention
#ns_param   stacksize [expr 128*1024] ;# Per-thread stack size for hungry C modules.

#
# MIME types.
#
#  Note: AOLserver already has an exhaustive list of MIME types, but in
#  case something is missing, you can add it here.
#
ns_section "ns/mimetypes"
ns_param   default         "*/*"     ;# MIME type for unknown extension
ns_param   noextension     "*/*"     ;# MIME type for missing extension
#ns_param   ".xls"          "application/vnd.ms-excel"


############################################################
#
# Server-level configuration
#
#  There is only one server in AOLserver, but this is helpful when multiple
#  servers share the same configuration file.  This file assumes that only
#  one server is in use, so it is set at the top in the "server" Tcl variable.
#  Other host-specific values are set up above as Tcl variables, too.
#

ns_section "ns/servers"
ns_param   $servername     $serverdesc


#
# Server parameters
#
ns_section "ns/server/${servername}"
ns_param   directoryfile   $directoryfile
ns_param   pageroot        $pageroot
ns_param   globalstats     true      ;# Enable built-in statistics
ns_param   urlstats        true      ;# Enable URL statistics
ns_param   maxurlstats     1000      ;# Max number of URLs to do stats on
ns_param   enabletclpages  true      ;# Parse tcl files in pageroot (dangerous)

# Directory listings -- use an ADP or a Tcl proc to generate them.
#ns_param   directoryadp    $pageroot/dirlist.adp ;# Choose one or the other
#ns_param   directoryproc   _ns_dirlist           ;#  ...but not both!
#ns_param   directorylisting simple               ;# Can be simple or fancy

# Database configuration
ns_section "ns/server/${servername}/db"
ns_param   pools           "*"  
ns_param   defaultpool     "main"

# Private library
ns_section "ns/server/${servername}/tcl"
ns_param   library         "/home/acs/acspg/tcl"

#
# ADP (AOLserver Dynamic Page) configuration
#
ns_section "ns/server/${servername}/adp"
ns_param   map             "/*.adp"  ;# Extensions to parse as ADPs
#ns_param   map             "/*.html" ;# Any extension can be mapped
ns_param   enableexpire    false     ;# Set "Expires: now" on all ADPs
ns_param   enabledebug     false     ;# Allow Tclpro debugging with "?debug"

# ADP special pages
#ns_param   errorpage      ${pageroot}/errorpage.adp ;# Pretty-print ADP scripting errors


#
# ADP custom parsers -- see adp.c
#
ns_section "ns/server/${servername}/adp/parsers"
ns_param   adp             ".adp"


#
# Socket driver module (HTTP)  -- nssock
#
ns_section "ns/server/${servername}/module/nssock"
ns_param   port            $httpport
ns_param   hostname        $hostname
ns_param   address         $address


#
# Socket driver module (HTTPS) -- nsssl
#
#  nsssl does not load unless sslkeyfile/sslcertfile exist (above).
#
#ns_section "ns/server/${servername}/module/nsssl"
#ns_param   port            $httpsport
#ns_param   hostname        $hostname
#ns_param   address         $address
#ns_param   keyfile         $sslkeyfile
#ns_param   certfile        $sslcertfile


#
# Control port -- nscp
#
#  nscp does not load unless nscp_user is a valid user.
#
ns_section "ns/server/${servername}/module/nscp"
ns_param   port            9999
ns_param   address         "127.0.0.1" ;# LOCALHOST IS RECOMMENDED

ns_section "ns/server/${servername}/module/nscp/users"
ns_param   user            $nscp_user


#
# Access log -- nslog
#
ns_section "ns/server/${servername}/module/nslog"
ns_param   rolllog         true      ;# Should we roll log?
ns_param   rollonsignal    true      ;# Roll log on SIGNUP
ns_param   rollhour        0         ;# Time to roll log
ns_param   maxbackup       5         ;# Max number to keep around when rolling


#
# CGI interface -- nscgi
#
# Access log -- nslog
#
ns_section "ns/server/${servername}/module/nslog"
ns_param   rolllog         true      ;# Should we roll log?
ns_param   rollonsignal    true      ;# Roll log on SIGNUP
ns_param   rollhour        0         ;# Time to roll log
ns_param   maxbackup       5         ;# Max number to keep around when rolling


#
# CGI interface -- nscgi
#
ns_section "ns/server/${servername}/module/nscgi"
#ns_param   map "GET  /cgi /usr/local/cgi"
#ns_param   map "POST /cgi /usr/local/cgi"


#
# Modules to load
#
ns_section "ns/server/${servername}/modules"
ns_param   nssock          ${bindir}/nssock.so
ns_param   nslog           ${bindir}/nslog.so
ns_param   nscgi           ${bindir}/nscgi.so
#ns_param   nsperm         ${bindir}/nsperm.so

## nsssl: loads only if requisite files already exist (see top of this file).
#if { [file exists $sslcertfile] && [file exists $sslkeyfile] } {
#    ns_param nsssl ${bindir}/nsssle.so
#} else {
#    ns_log warning "nsd.tcl: nsssl not loaded because key/cert files do not exist."
#}

# nscp: loads only if nscp_user is set (see top of this file).
if { $nscp_user != "" } {
    ns_param nscp ${bindir}/nscp.so
} else {
    ns_log warning "nsd.tcl: nscp not loaded because user/password is not set."
}

source "/home/acs/acspg/parameters/acspg-parameters.tcl"

ns_log notice "nsd.tcl: finished reading config file."
  • + Share This
  • 🔖 Save To Your Account

Related Resources

There are currently no related titles. Please check back later.