{"result":{"depiction_url":null,"edges":{"references":{"objects":[{"created":"2020-05-30T05:48:06Z","object_id":{"id":1728,"is_a":["text","documentation","reference"],"name":"doc_developerguide_configuration_site_configuration","title":"Site configuration","uri":"https:\/\/zotonic.com\/id\/1728"},"seq":1000000},{"created":"2020-05-30T05:48:06Z","object_id":{"id":1546,"is_a":["text","documentation","developerguide"],"name":"doc_developerguide_testing","title":{"_type":"trans","tr":{"en":"Choose checks for a change"}},"uri":"https:\/\/zotonic.com\/id\/1546"},"seq":1000000}],"predicate":{"id":332,"is_a":["meta","predicate"],"name":"references","title":{"_type":"trans","tr":{"en":"References"}},"uri":"https:\/\/zotonic.com\/id\/references"}}},"id":1454,"is_a":["text","documentation","reference"],"links":[{"rel":"self","target":"https:\/\/zotonic.com\/.zotonic\/websub\/topic\/1454"},{"rel":"hub","target":"https:\/\/zotonic.com\/.zotonic\/websub"}],"medium":null,"medium_url":null,"name":"doc_developerguide_configuration_zotonic_configuration","page_url":{"en":"https:\/\/zotonic.com\/docs\/1454\/global-configuration","x-default":"https:\/\/zotonic.com\/docs\/1454\/global-configuration"},"preview_url":null,"resource":{"body":"<div>\n            \n  <div class=\"section\">\n\n<p>This section describes the location and contents of Zotonic’s global\nconfiguration files <code class=\"docutils literal notranslate\"><span class=\"pre\">erlang.config<\/span><\/code> and <code class=\"docutils literal notranslate\"><span class=\"pre\">zotonic.config<\/span><\/code>. There’s also\n<a class=\"reference internal\" href=\"\/id\/doc_developerguide_configuration_site_configuration#ref-site-configuration\"><span class=\"std std-ref\">site-specific configuration<\/span><\/a>.<\/p>\n<div class=\"section\">\n<h2>Config file locations<\/h2>\n<p>Zotonic depends on two global config files, called <code class=\"docutils literal notranslate\"><span class=\"pre\">zotonic.config<\/span><\/code>\nand <code class=\"docutils literal notranslate\"><span class=\"pre\">erlang.config<\/span><\/code>. On startup, Zotonic looks in the following\nplaces for these files:<\/p>\n\n<p><ul class=\"simple\">\n<li>The init argument <code class=\"docutils literal notranslate\"><span class=\"pre\">zotonic_config_dir<\/span><\/code><\/li>\n<li>The environment variable <code class=\"docutils literal notranslate\"><span class=\"pre\">ZOTONIC_CONFIG_DIR<\/span><\/code><\/li>\n<li>The directory <code class=\"file docutils literal notranslate\"><span class=\"pre\">$HOME\/.zotonic<\/span><\/code><\/li>\n<li>The directory <code class=\"file docutils literal notranslate\"><span class=\"pre\">\/etc\/zotonic<\/span><\/code> (only on Unix)<\/li>\n<li>The OS specific directory for application config files<\/li>\n<\/ul>\n<\/p>\n<p>The OS specific directories are:<\/p>\n\n<p><ul class=\"simple\">\n<li>On Unix: <code class=\"file docutils literal notranslate\"><span class=\"pre\">~\/.config\/zotonic\/config\/<\/span><\/code><\/li>\n<li>On macOS: <code class=\"file docutils literal notranslate\"><span class=\"pre\">~\/Library\/Application<\/span> <span class=\"pre\">Support\/zotonic\/config\/<\/span><\/code><\/li>\n<\/ul>\n<\/p>\n<p>In those directories the system searches for a <code class=\"docutils literal notranslate\"><span class=\"pre\">zotonic*<\/span><\/code> file in the following subdirectories (assuming the version of Zotonic is 1.2.3 and the node is called <code class=\"docutils literal notranslate\"><span class=\"pre\">zotonic001@foobar<\/span><\/code>):<\/p>\n\n<p><ul class=\"simple\">\n<li><code class=\"docutils literal notranslate\"><span class=\"pre\">zotonic001@foobar\/<\/span><\/code><\/li>\n<li><code class=\"docutils literal notranslate\"><span class=\"pre\">zotonic001\/<\/span><\/code><\/li>\n<li><code class=\"docutils literal notranslate\"><span class=\"pre\">1.2.3\/<\/span><\/code><\/li>\n<li><code class=\"docutils literal notranslate\"><span class=\"pre\">1.2\/<\/span><\/code><\/li>\n<li><code class=\"docutils literal notranslate\"><span class=\"pre\">1\/<\/span><\/code><\/li>\n<li><code class=\"docutils literal notranslate\"><span class=\"pre\">.<\/span><\/code><\/li>\n<\/ul>\n<\/p>\n<p>The default is the OS specific directory, with as subdirectory the major version number of Zotonic (in this case <code class=\"docutils literal notranslate\"><span class=\"pre\">1<\/span><\/code>).\nFor Linux this would be <code class=\"file docutils literal notranslate\"><span class=\"pre\">~\/.config\/zotonic\/config\/1\/<\/span><\/code><\/p>\n<p>The nodename is the name of the Zotonic Erlang node, which\ndefaults to <code class=\"docutils literal notranslate\"><span class=\"pre\">zotonic001<\/span><\/code> (and can be set with <code class=\"docutils literal notranslate\"><span class=\"pre\">$SNAME<\/span><\/code> or <code class=\"docutils literal notranslate\"><span class=\"pre\">$LNAME<\/span><\/code>\nenvironment variable). Using the node name in the configuration path comes in\nhandy when you want to run multiple Zotonic instances simultaneously.<\/p>\n<p>By checking for <em>version<\/em> you can have separate configuration files for different versions of Zotonic\nwhich are running simultaneously.<\/p>\n<p>If the Zotonic startup script finds a <code class=\"docutils literal notranslate\"><span class=\"pre\">zotonic*<\/span><\/code> file in one of the\ndirectories, it stops looking, so files in the other directories are\nignored.<\/p>\n<p>Zotonic will also load all configuration files in the <code class=\"docutils literal notranslate\"><span class=\"pre\">config.d<\/span><\/code> directory inside the Zotonic directory.<\/p>\n<p>In the course of Zotonic starting up, it will print the locations of\nthe global config files that it is using:<\/p>\n<div class=\"highlight-none notranslate\"><div class=\"highlight\"><pre><span><\/span>12:42:17.351 [info] zotonic_launcher_sup:36 ================\n12:42:17.351 [info] zotonic_launcher_sup:37 Zotonic starting\n12:42:17.351 [info] zotonic_launcher_sup:38 ================\n12:42:17.351 [info] zotonic_launcher_sup:39 Init files used:\n12:42:17.356 [info] zotonic_launcher_sup:40 - \/home\/user\/.config\/zotonic\/config\/1\/erlang.config\n12:42:17.356 [info] zotonic_launcher_sup:41 Config files used:\n12:42:17.357 [info] zotonic_launcher_sup:43 - \/home\/user\/.config\/zotonic\/config\/1\/zotonic.config\n12:42:17.357 [info] zotonic_launcher_sup:44 ================\n<\/pre><\/div>\n<\/div>\n<p>The used configuration files can be listed with <code class=\"docutils literal notranslate\"><span class=\"pre\">bin\/zotonic<\/span> <span class=\"pre\">configfiles<\/span><\/code>:<\/p>\n<div class=\"highlight-none notranslate\"><div class=\"highlight\"><pre><span><\/span>user$ bin\/zotonic configfiles\nZotonic config files for zotonic001@foobar:\n- \/home\/user\/.config\/zotonic\/config\/1.0\/erlang.config\n- \/home\/user\/.config\/zotonic\/config\/1.0\/zotonic.config\n<\/pre><\/div>\n<\/div>\n<\/div>\n<div class=\"section\">\n<h2>The <code class=\"docutils literal notranslate\"><span class=\"pre\">zotonic.config<\/span><\/code> file<\/h2>\n<p>After installed for the first time, the <code class=\"docutils literal notranslate\"><span class=\"pre\">~\/.zotonic\/1\/zotonic.config<\/span><\/code> file is well\nannotated with comments about what each setting does. When in doubt, consult the\nstock <code class=\"docutils literal notranslate\"><span class=\"pre\">apps\/zotonic_launcher\/priv\/config\/zotonic.config.in<\/span><\/code> file for explanation\nabout all config settings.<\/p>\n<p>In the <code class=\"docutils literal notranslate\"><span class=\"pre\">zotonic.config<\/span><\/code> file you will find the password for the\n<code class=\"docutils literal notranslate\"><span class=\"pre\">zotonic_status<\/span><\/code> site where you can manage the server.<\/p>\n<p>Zotonic configurations can also be fetched in the Erlang shell.\nFor example, view the <code class=\"docutils literal notranslate\"><span class=\"pre\">zotonic_status<\/span><\/code> password:<\/p>\n<div class=\"highlight-erlang notranslate\"><div class=\"highlight\"><pre><span><\/span><span class=\"nn\">z_config<\/span><span class=\"p\">:<\/span><span class=\"nb\">get<\/span><span class=\"p\">(<\/span><span class=\"n\">password<\/span><span class=\"p\">).<\/span>\n<\/pre><\/div>\n<\/div>\n<p>The Zotonic configuration files are read by the <code class=\"docutils literal notranslate\"><span class=\"pre\">zotonic_launcher<\/span><\/code> application before\nstarting the core zotonic applications and all sites.<\/p>\n<p>The zotonic configuration van be viewed with <code class=\"docutils literal notranslate\"><span class=\"pre\">bin\/zotonic<\/span> <span class=\"pre\">config<\/span><\/code>:<\/p>\n<div class=\"highlight-none notranslate\"><div class=\"highlight\"><pre><span><\/span>Zotonic config for zotonic001@aloha:\n====================================\n\nzotonic:\n    environment: production\n    zotonic_apps: \/home\/user\/zotonic\/apps_user\n    security_dir: \/home\/user\/.config\/zotonic\/security\n    password: Bthj3ruGbmgJxfmc\n    timezone: UTC\n    listen_ip: any\n    listen_ip6: any\n    listen_port: 8000\n    ssl_listen_port: 8443\n    port: 80\n    ssl_port: 443\n    max_connections: 20000\n    ...\n<\/pre><\/div>\n<\/div>\n<\/div>\n<div class=\"section\">\n<a name=\"erlang-config\"><\/a><h2>The <cite>erlang.config<\/cite> file<\/h2>\n<p>The <code class=\"docutils literal notranslate\"><span class=\"pre\">erlang.config<\/span><\/code> file contains application environment variables\nfor the Erlang applications that Zotonic depends on. Here you can\nconfigure for instance the paths for the <a class=\"reference internal\" href=\"\/id\/doc_developerguide_testing#dev-testing\"><span class=\"std std-ref\">log files<\/span><\/a> (in\nthe <code class=\"docutils literal notranslate\"><span class=\"pre\">kernel<\/span><\/code> section), emqtt ports, et cetera.<\/p>\n<p>This file is included as an <em>init<\/em> configuration option when starting <code class=\"docutils literal notranslate\"><span class=\"pre\">erl<\/span><\/code>\nvia the command line script in <code class=\"docutils literal notranslate\"><span class=\"pre\">bin\/zotonic<\/span><\/code>.<\/p>\n<p>The erlang configuration van be viewed with <code class=\"docutils literal notranslate\"><span class=\"pre\">bin\/zotonic<\/span> <span class=\"pre\">config<\/span> <span class=\"pre\">erlang<\/span><\/code>:<\/p>\n<div class=\"highlight-none notranslate\"><div class=\"highlight\"><pre><span><\/span>Erlang init for zotonic001@aloha:\n=================================\n\nexometer:\n    predefined:\n      - {[erlang,memory],{function,erlang,memory,[],value,[]},[]}\n      - {[erlang,system_info],\n         {function,erlang,system_info,[&#39;$dp&#39;],value,[process_count]},\n         []}\n      - {[erlang,statistics],\n         {function,erlang,statistics,[&#39;$dp&#39;],value,[run_queue]},\n         []}\n      - {[erlang,io],\n         {function,erlang,statistics,[io],match,{{&#39;_&#39;,input},{&#39;_&#39;,output}}},\n         []}\nfilezcache:\n    data_dir: priv\/filezcache\/data\n    journal_dir: priv\/filezcache\/journal\nkernel:\n...\n<\/pre><\/div>\n<\/div>\n<\/div>\n<\/div>\n\n\n           <\/div>","category_id":{"id":319,"is_a":["meta","category"],"name":"reference","title":"Reference","uri":"https:\/\/zotonic.com\/id\/reference"},"content_group_id":{"id":339,"is_a":["meta","content_group"],"name":"default_content_group","title":{"_type":"trans","tr":{"en":"Default Content Group"}},"uri":"https:\/\/zotonic.com\/id\/default_content_group"},"created":"2020-05-30T05:47:22Z","creator_id":{"id":336,"is_a":["person","robot"],"name":"gitbot","title":"Git","uri":"https:\/\/zotonic.com\/id\/336"},"github_url":"https:\/\/github.com\/zotonic\/zotonic\/tree\/master\/doc\/ref\/configuration\/zotonic-configuration.rst","is_authoritative":true,"is_dependent":false,"is_featured":false,"is_protected":false,"is_published":true,"is_unfindable":false,"language":["en"],"modified":"2023-06-24T08:17:44Z","modifier_id":{"id":336,"is_a":["person","robot"],"name":"gitbot","title":"Git","uri":"https:\/\/zotonic.com\/id\/336"},"name":"doc_developerguide_configuration_zotonic_configuration","pivot_geocode":null,"pivot_location_lat":null,"pivot_location_lng":null,"privacy":0,"publication_end":"9999-06-01T00:00:00Z","publication_start":"2023-06-24T08:17:44Z","slug":"global-configuration","title":"Global configuration","title_slug":"global-configuration","tz":"UTC","uri":null,"version":3946,"visible_for":0},"uri":"https:\/\/zotonic.com\/id\/1454","uri_template":"https:\/\/zotonic.com\/id\/:id","websub":{"hub":"https:\/\/zotonic.com\/.zotonic\/websub","topic":"https:\/\/zotonic.com\/.zotonic\/websub\/topic\/1454"}},"status":"ok"}