NaviServer - programmable web server

[ Main Table Of Contents | Table Of Contents | Keyword Index ]

admin-install(n) 4.99.19 manual "NaviServer Manual"

Name

admin-install - NaviServer Installation Guide

Table Of Contents

Description

NaviServer is distributed in source form.

Getting Started

NaviServer is reasonably portable and known to compile and run on the following platforms:

It's likely NaviServer can compile on other systems and/or higher or lower numbered versions but this has not been extensively tested. The primary development platforms for NaviServer is Linux.

You will need a C compiler. The best one to use is GNU GCC from http://www.gnu.org and its mirrors or clang. NaviServer (and the included Tcl libraries) are written entirely in ANSI standard C.

GNU make is also required. It is also available from the GNU web site.

Downloading

Released versions are available from SourceForge Download area

Latest development version is available from Mercurial repository

hg clone http://bitbucket.org/naviserver/naviserver
cd naviserver
./autogen.sh
make install

Building

We've tried to make building NaviServer as simple as possible. On the supported platforms, simply type:

./configure
make

Some modules use third-party libraries. If the library is missing, the NaviServer build will continue without error -- it just will not build the offending module.

Note: If you have any problems building, the two files include/Makefile.global and include/Makefile.module have all the information you need to change settings throughout the NaviServer environment.

Two options to configure.sh script worth noting:

  1. --enable-symbols to enable debugging information to be compiled in for easy debugging, otherwise it will be compiled with optimization enabled and that will prevent from effective troubleshooting in case of server crash

Installing

Type "make install" to make a production server. This will create an installation directory at /usr/local/ns/, populate the directories with various startup files and configuration files, copy the binaries to the /usr/local/ns/bin directory, and finish. To install confidence tests, type "make install-tests" and they will appear in the tests/ directory of your server's pageroot. The default location for installations can be overridden by typing "gmake install PREFIX=/your/directory/".

Downloading and Installing Modules

To download and install additional modules:

  hg clone http://bitbucket.org/naviserver/modulename
  cd modulename
  make install

The steps above assume, that NaviServer is installed at the standard place at /usr/local/ns/. If this is not the case in your installation, please provide the location to make via parameter NAVISERVER.

  make NAVISERVER=PATH_TO_LOCATION install

At this moment the following modules are available:

nsaccess nsclamav nsdbi nsdbmysql nsdhcpd nsicmp nsmemcache nssip nsstats nsvfs nsaspell nsconf nsdbilite nsdbpg nsdns nsimap nsphp nssmtpd nssyslogd nszlib nsauthpam nsconfigrw nsdbimy nsdbsqlite nsexpat nsldapd nsradiusd nssnmp nstftpd nschartdir nsdbbdb nsdbipg nsdbtds nsgdchart nsloopctl nsrtsp nsssl nsoracle nsudp

To check what modules are available go to http://bitbucket.org/naviserver/.

Some of the modules have external dependencies such as include directories or paths to libraries, so please look into module's README file for any additional information.

Configuring

The installation directory contains several configuration files under /usr/local/ns/conf installation directory. A simple configuration to start with is nsd-config.tcl, which is used below. A more complete reference of the available parameter is sample-config, a very short configuration file is simple-config.tcl. The most basic configuration parameters are the port and listening addresses, which are set in nsd-config.tcl as follows:

  1. Listen for HTTP connections on your computer's primary interface at port 8080. To use another port and/or select interfaces, you can set the port and address parameters. For details how to configure the networking setup of NaviServer, see nssock (for HTTP) and nsssl (for HTTPS).

  2. Check security settings for nscp (Control Port module) and listen on localhost:4080 if they are set.

Note: Some modules can be disabled in the sample nsd.tcl for security reasons. They are nscp and nsperm. These modules can be disables by e.g. commenting out the respective lines in the "ns/server/default/modules" section. These modules are not required to run a server unless you want to use the Control Port and/or the Permissions module, respectively. Before using them in a production environment, change the passwords and default permissions by following the instructions in the NaviServer documentation.

Although you must be root to start NaviServer on port 80, the server itself must change to a regular user shortly after initialization. You either need to start the server as a non-root user (in which case you will not be able to listen for connections on privileged ports such as port 80) or you must include a -u user command line flag to which the server will setuid(2) after startup. We assume in the following sections that a user nsadmin and a group nsadmin were already created on the system, where NaviServer is installed.

If NaviServer was installed with default nsd.tcl config file, just type

  /usr/local/ns/bin/nsd

and it will be started in the background listening on port 8080.

You may either specify a Unix username or numeric uid, e.g.:

  bin/nsd -t conf/nsd-config.tcl -u nsadmin

For the mode of operation, there are four choices: Foreground, Background, Background with watchdog and Inittab.

Note: While running NaviServer on some Unix platforms (e.g., Linux, SGI), you'll notice multiple nsd processes. This is normal and represents the individual threads. The main process id can be determined by checking the log/nsd.pid file or looking at the last few entries of the server log (per default "logs/error.log", each of which will include the process id and thread id in the form [pid.tid]. You can also telnet to the control port and type "ns_info pid".

See Also

admin-maintenance

Keywords

command-line-options, nscp, nsd, nssock, nsssl