Previous | Up | Next |
Installing SWS | Introduction | The framework |
SWS is pretty configurable. This section attempts to document the various configuration options and where to place them.
Normally, all of SWS searches for its configuration files in swsroot/etc. This is where the main configuration file sws and the database parameter files residing in the subdirectory db should be placed.
In the most common case, SWS will be used for one host only. But it is possible to share one SWS installation with multiple virtual hosts (either IP or name-based, but SWS will distinguish by name). To define multiple virtual hosts, edit the hosts variable in the main configuration file to define other hosts. Virtual hosts have their own configuration files in swsroot/etc/vhosts/*.
For each virtual host, one or more subsites can be defined (in addition to the so-called main site which is located at the host's document root) by adding the path to each site in the subsites parameter. For these subsites, SWS also reads the site configuration file siteroot/.sws/config. Some of the options of the main host configuration file (swsroot/etc/sws in case of the default virtual host) can be overridden here. When serving a user request, SWS treats the user's public HTML directory as a subsite, so users can override the site configuration by creating userdir/.sws/config (in the default Apache setup, this would be $HOME/public_html/.sws/config).
Subsites can also redefine database parameters, by creating a subdirectory db inside their site configuration directory siteroot/.sws, and storing the database parameter files in there.
In the above examples the default value of the parameter siteconfigdirs is assumed, which is .sws. However this is also overrideable per virtual host; in this way sites can be addressable by multiple hostnames and have a different configuration for each virtual host. In most cases however, the default of .sws will suffice.
The main configuration file, which is located at swsroot/etc/sws, contains the global SWS options. Most are well-documented in the example configuration file swsroot/etc/sws.example.
The first two parameters specify the root of the SWS installation directory, and the corresponding URL in the webserver's namespace. These must be set if the default themes, boxes or extensions are used.
You can define zero or more virtual hosts by setting the hosts parameter to a comma-separated list of host tags (made up by the administrator). SWS will then check for the corresponding host configuration file for document requests matching the hostname defined in that file. For requests not matching any of the hostnames in the hosts files, the default parameters are used.
The rest of the configuration file contains the same parameters as the per-host configuration file. The values defined in this file will provide the default values for any requests that do not match a virtual host.
Virtual host configuration files define the parameters for each virtual host.
The most important parameter to set is the docroot parameter. This parameter defines the root directory for the default site for this host.
You can define zero or more subsites by setting the subsites parameter to a comma-separated list of filesystem paths. SWS will then check for the corresponding site configuration file for document requests matching the specified path.
If your server does not speak https
,
you should set the https parameter to
0
. If you want to use the login features
of SWS without encryption, you also need to set the
allow_insecure_login to 1
,
otherwise the framework will prevent anyone from getting
a login form (through which secure information like passwords
would be transmitted over http
).
The main configuration file also sets the theme that is used by default, in the parameter defaulttheme.
Another default that is set in this configuration file is
the value of the debug parameter. If set
to a non-zero value, SWS sets the PHP parameter
error_reporting to E_ALL
,
and SWS will output various errors such as database errors
to the browser.
The two parameters defaulttheme and debug are overrideable in the site configuration file.
The database parameters files contain the parameters for accessing databases using SWS. The name of the files in this directory are the names that you need to pass on to the SWS database functions.
Every file needs to contain the following parameters:
type, the type of database to
connect to. SWS supports the types mysql
and postgresql
.
host, the name of the host on which the database runs.
user, the username that we need to connect as.
password, the password that is needed to access the database.
. Note that this is not encrypted, so anyone that can read the configuration file can also access the database. You should decide on the correct permissions as appropriate for your host.name, the name of the database that we want to access.
An example database parameter file is located at swsroot/etc/db.example.
The site configuration files contain site specific parameters. Site configuration files are located in the site configuration subdirectory (by default .sws) located in the site root directory. The file must be named config. An example of a site configuration file is located at swsroot/etc/site.example.
There is one mandatory parameter for every site, the
baseurl parameter. You should set this
to be the base URL that is used to access the site (without
the http://host
part). So if you want to make the site
http://example.org/subsite/
, you must enter
/subsite
as your baseurl
parameter.
Previous | Up | Next |
Installing SWS | Introduction | The framework |
Documentation generated on Fri, 30 Jun 2006 10:31:36 +0200 by phpDocumentor 1.3.0RC3