Introduction
Lattenoir is an application server and can be used in the following ways:
- Running as a standalone server, processing requests on port 80 (not recommended in a production environment)
- In conjunction with apache/nginx/... via the CGI or FastCGI protocol
- Console launch (for example, generating pages or running scheduled tasks)
Example website configuration file
exports.site={
code:"teajs.org", // site name
names: ["teajs.org","www.teajs.org"], // host names to which site answer to
//domains: ["teajs2.org"], // domains to which site answer to
title: " - teajs.org", // title to be appended at the end of page <title></title>
EXPORTNAME:"teajs",//
adminpanel_title: "teajs.org",// adminpanel title
log_sql_queries: false, // dump sql queries statistics
database: {
login:"teajs_org_login",
database:"teajs_org_database",
password:"111111"
},
auth: {
prompt_login:1, // if anonymous user tries to access a resource requiring authentication, should he be prompted for login or just denied
},
custom_rewriter: function(rr) {
// any custom rewrites
},
load: [
"controllers/Example.js",// controllers, functions and models to forcibly load (lazy autoloading also works)
"controllers/Download.js",
"controllers/Articles1.js",
],
paths: {
basepath: "/www/sites/teajs.org/",// base path (should contain code/controllers/, code/models/, code/views/, code/functions, html/ folders)
uploads_subfolder: "f/",// subfolder to where any files uploaded through admin panel or generic file handling functions are saved
},
previews: [// preview sizes
[24,24], //0
[48,48], //1
[128,128],//2
[400,300],//3
[640,480],//4
[800,600],//5
[220,150],//6
[200,300],//7
[75,75], //8
[500,500], // 9
[200,400], // 10
[1024,1024],//11
],
default_l10n_id:1,// default language (for database)
language: "en",// default language (for i18n files)
show_errors: 1,// should errors be displayed or hidden
};
Example standalone webserver launch
TODO
Example apache configuration file
<VirtualHost *:443>
ServerName www.teajs.org
ServerAlias teajs.org
ServerAdmin webmaster@localhost
DocumentRoot /www/sites/teajs.org/html
<Directory />
Options +FollowSymLinks +Includes
RewriteEngine On
RewriteBase /
#RewriteRule /$ /cgi-bin/app-fcgijs.fcgi
RewriteRule /$ /cgi-bin/app.js
</Directory>
Alias /shared/ /opt/lattenoir/html/shared/
ScriptAlias /cgi-bin/ /opt/lattenoir/
<Directory "/opt/lattenoir/">
AllowOverride None
Options +ExecCGI -MultiViews +FollowSymLinks
Order allow,deny
Allow from all
#SetHandler fcgid-script
</Directory>
ErrorDocument 404 /cgi-bin/app.js
ErrorDocument 500 /shared/error500.html
ErrorLog /www/sites/teajs.org/logs/error.log
LogLevel warn
CustomLog /www/sites/teajs.org/logs/access.log combined
ServerSignature On
SSLCertificateFile /etc/letsencrypt/live/teajs.org-0001/fullchain.pem
SSLCertificateKeyFile /etc/letsencrypt/live/teajs.org-0001/privkey.pem
</VirtualHost>
Example console launch
vahvarh@germany:/opt/lattenoir$ ./app.js
LATTE NOIR framework, console mode
Usage:
/opt/lattenoir/app.js --mode url --site mysite.name [--uid X] --page / [--cnt 1] [--with_headers 1] --ARG-foo hello --ARG-bar world
/opt/lattenoir/app.js --mode function --site mysite.name [--uid X] --function MySection.function_name --ARG-0 hello --ARG-1 world
vahvarh@pronetcom:/opt/lattenoir$ ./app.js --mode function --site teajs.org --function Views.preview --ARG-1 /hello/world.jpg --ARG-0 2C
/hello/world-preview2C.jpg