This is an old revision of the document!
NethServer comes with the most used parameters set as variables in its internal configuration databases. These variables are used to store values to be used in the final configuration files. Please, read the Database howto, the template howto and the event howto to understand the template and database process.
These variables are useful to configure your system more easily, as you do not need to modify configuration files directly for most common cases. It also makes it possible to administer the server through its server-manager as the database variables are used to set and change configuration parameters. After editing, the configuration files must be regenerated and affected services need to be restarted.
For example, suppose you need to increase “memory-limit” in php.
You would simply execute these commands at the server console:
db configuration setprop php MemoryLimit 64 signal-event nethserver-php-save
The first line changes the value for the memory limit of PHP, the second line regenerates the configuration file and the last line will reload Apache (and subsequently also PHP as this is configured as a module of Apache).
Database parameters are case sensitive so take great care when typing at the server shell because no error messages are given should you make a typo.
The database system is based on a flat file system, but you should never edit them directly. Instead you should use the db command. More details on using the database system can be found in the Developer Manual
Use of 'config' is a shorthand version for 'db configuration' and therefore only works with the configuration database
the generic command is :
db dbfile set key type [prop1 val1] [prop2 val2] ...
dbfile : choose the database in /home/e-smith/db key : the name of key type : generally 'service' or 'configuration' but it can be other things as webbapps or url or ...
If you want to create a keys called 'plop' in the configuration database with a type as 'configuration you can do like this
db configuration set plop configuration Name wordpress PublicAccess private status enabled DbName wordpress DbUser wordpress WpLang en
you can see the result
config show plop
or
db configuration show plop
plop=configuration DbName=wordpress DbUser=wordpress Name=wordpress PublicAccess=private WpLang=en status=enabled
The generic command line is
db dbfile setprop key prop1 val1 [prop2 val2] [prop3 val3] ... dbfile : choose the database in /home/e-smith/db key : the name of key
Then if you want to modify some values of our example above
db configuration setprop plop PublicAccess public WpLang fr
or
config setprop plop PublicAccess public WpLang fr
We want to verify
config show plop
or
db configuration show plop
plop=configuration DbName=wordpress DbUser=wordpress Name=wordpress PublicAccess=public <----------Here WpLang=fr <----------Here status=enabled
Same as above, really not difficult
db configuration setprop plop PlopTheWorld YES
or
config setprop plop PlopTheWorld YES
and to display modification
db configuration show plop
or
config show plop
plop=configuration DbName=wordpress DbUser=wordpress Name=wordpress PlopTheWorld=YES <----------Here PublicAccess=public WpLang=fr status=enabled
Use of 'config' is a shorthand version for 'db configuration' and therefore only works with the configuration database
Any db variable that has a default value can be reset to the default by deleting the variable entirely, then re-initializing the default database values as follows: config delprop <key> <prop> /etc/e-smith/events/actions/initialize-default-databases
for example
db configuration delprop plop WPlang /etc/e-smith/events/actions/initialize-default-databases
or
config delprop plop WpLang /etc/e-smith/events/actions/initialize-default-databases
To delete the property
db dbfile delprop <key> <prop>
for example
db configuration delprop plop WpLang
or
config delprop plop WpLang
To delete the Key
db dbfile delete <key>
for example
db configuration delete plop
or
config delete plop
To reset to an empty value db dbfile setprop <key> <prop> ''
for example
db configuration setprop plop WpLang <nowiki>''</nowiki>
or
config setprop plop WpLang <nowiki>''</nowiki>
Database parameters are case sensitive so take great care when typing at the server shell because no error messages are given should you make a mistake.