Meza/Directory structure
This is an overview of the directory structure used by a meza server. This does not include every single file, but attempts to list out directories and files used by the meza application.
Info required: which files exist on which server types? Currently this is mostly focused on monolithic installations, where the controller and all applications (MariaDB, Elasticsearch, MediaWiki, etc) are on the same server.
Glossary
[edit]There are several terms in this document which may be described in the [Glossary](Glossary.md).
Major directories
[edit]The five major directories are:
/opt/meza
: The meza application. Only modified when developing for or upgrading meza version/opt/conf-meza
: meza configuration. Modified by sysadmins when making configuration changes./opt/data-meza
: storage of meza information. Modified anytime wiki users do anything on the site./opt/.deploy-meza
: Files deployed by the meza application. Sysadmins don't need to touch this. Instead, modify/opt/meza
or/opt/conf-meza
and re-deploy./opt/htdocs
: The webserver root. Deployed just like/opt/.deploy-meza
.
/opt/meza
[edit]Meza application directory. This should never change except if you upgrade meza (or you're doing development for the meza application itself). This only exists on the controller.
config
core
ansible.cfg
: Ansible config file. Ref: http://docs.ansible.com/ansible/intro_configuration.htmldefaults.yml
: base config vars, able to be overridden in /opt/conf-meza/public/public.ymli18n
: mostly unused attempts to internationalize mezaMezaCoreExtensions.yml
: extensions installed on all meza serverstemplate
ifcfg-enp0s8
: CentOS7 VirtualBox Host-Only network interface template
README.md
: Ref Issue #712: Flatten config/core/ to just config/
CONTRIBUTING.md
: Directions on how to contribute to meza.eslintignore
: Config file for CodeClimate analysis.eslintrc
: Config file for CodeClimate analysis.github
ISSUE_TEMPLATE.md
: Template text for new GitHub issuesPULL_REQUEST_TEMPLATE.md
: Template text for new GitHub pull requests
.gitignore
: Ref: https://git-scm.com/docs/gitignoreLICENSE
: license info for mezamanual
:commands.gif
: GIF for main README showing usage of meza commandpigeon.txt
: ASCII art of pigeon declaring successful install; Ref Issue #676: reincorporate into deploymeza-cmd
:- (files used for help when using meza command, e.g.
meza --help
)
- (files used for help when using meza command, e.g.
- (various files explaining various aspects of meza)
README.md
: meza's main READMEsrc
playbooks
:- (Ansible playbooks. Ref: http://docs.ansible.com/ansible/playbooks.html)
roles
:- (Ansible roles. Ref: http://docs.ansible.com/ansible/playbooks_roles.html)
scripts
- Run on hosts:
create-vm.sh
: Create a Vbox VM; remove whenvagrant up
mature? Or keep for RedHat - Setup dev VMs:
dev-networking.sh
: Setup host-only network on Vbox VM; Remove after Vagrant? Keep for RedHat setup? - Run on controller:
getmeza.sh
: (Used to installmeza
command) - Run on controller:
meza.py
: (Entry point formeza
command) - Consolidate
[1]
:shell-functions
:base.sh
:linux-user.sh
:
- Consolidate
[1]
:ssh-users
:setup-master-user.sh
:setup-minion-user.sh
:transfer-master-key.sh
:
ssl-selftest.sh
: Ref Issue #714: Move to tests/integration/ and use in automated testingunifyUserTables.php
: Ref Issue #672: determine if still functional
- Run on hosts:
tests
:deploys
: Scripts run on controllers which run several commands to test various functionsbackup-to-remote.controller.sh
:import-from-remote.controller.sh
:monolith-from-import.controller.sh
:monolith-from-scratch.controller.sh
:setup-alt-source-backup.yml
: Ansible playbook run on controller to setup a test case. creates a fake non-meza source to import from.
docker
: Scripts run on a Docker hostbackup-to-remote.setup.sh
: generates 2 meza Docker containersimport-from-alt-remote.setup.sh
: generates 2 meza Docker containersimport-from-remote.setup.sh
: generates 2 meza Docker containersinit-container.sh
: generates a generic containerinit-controller.sh
: uses init-container to generate a controller containerinit-minion.sh
: uses init-container to generate a minion containerrun-tests.sh
: Entrypoint script to setup which tests to run. first argument for this script is which test type to run.
integration
:image-check.sh
: finds image URL via JS API, the checks is present on serverserver-check.sh
: several basic tests to verify a meza installation is functioningwiki-check.sh
: checks wiki API, Parsoid, Elasticsearch for a wiki
travis
:git-setup.sh
: shim to handle git checkout funnies in Travis
.travis.yml
: Config file for Travis CI automated testingVagrantfile
: Create VMs with Vagrant. Ref: https://www.vagrantup.com/docs/vagrantfile/
[1]
These are shell scripts used to create users. Ref Issue #713: Consolidate.
/opt/conf-meza
[edit]Location of configuration setup for meza. This is split into secret
and public
config. Secret config is intended for sensitive info like passwords. It also houses your hosts
file which declares which servers have which components installed (e.g. Parsoid is installed on 192.168.56.80
). The hosts
file may or may not be considered sensitive, but it resides in secret
nonetheless. Some non-sensitive items may be more convenient to put in secret
. These include things like enable_wiki_emails
, which you may only want set to true
on your production setup and no others. Since the hosts
file resides in secret
those environment-specific settings may be better to keep in secret
.
Additionally, the user meza-ansible
is used by meza to perform most actions. Some other actions are performed by the alt-meza-ansible
user. However, we don't create these users in /home
due to possible conflicts with other user systems. Ref #727.
public
:MezaLocalExtensions.yml
: Use to define extra extensions for your meza installationpublic.yml
: MAIN CONFIGURATION VARIABLES FILE!postLocalSettings.d/
:- (Any .php files here will be loaded at the end of LocalSettings.php)
preLocalSettings.d/
:- (Any .php files here will be loaded at the beginning of LocalSettings.php)
wikis
:demo
: this "demo" is known as the wiki IDfavicon.ico
: faviconlogo.png
: logopostLocalSettings.d
:- (
.php
files here loaded at end of LocalSettings.php for this wiki only)
- (
preLocalSettings.d
:base.php
:- (
.php
files here loaded at beginning of LocalSettings.php for this wiki only)
- (more wikis with same format as above)
secret
:monolith
:secret.yml
: This is the main secret config file. Encrypted by vault password.hosts
: AKA "Inventory file", listing server roles. See [Glossary](Glossary.md) for more infossl
:meza.crt
: SSL certificate for this environment. Encrypted by vault passwordmeza.key
: Private key for this environment. Encrypted by vault password
- (more environments if you so choose)
users
meza-ansible
:.ssh
:id_rsa
: secret key file on controller only. KEEP SAFE!id_rsa.pub
: public key file. This needs to be put on any minion servers.
.vault-pass-monolith.txt
: vault password file for monolith environment. See /opt/conf-meza above. On controller only.vault-pass-<env>.txt
: (vault password file for other environments)
alt-meza-ansible
: alternate user for some operations to avoid conflicts
/opt/data-meza
[edit]Data storage for meza. This is basically any information generated by using meza, including MariaDB (MySQL) database info, files uploaded by users, logs from meza commands (logs from Apache, HAProxy, system logs, etc are kept in their standard CentOS/RHEL locations), temp files, and backups from running meza backup
command.
backups
: backups directory populated from runningmeza backup <environment>
monolith
: backups for the "monolith" environmentdemo
:20170523123216_wiki.sql
: database backup from specified timestampuploads/
: backup of uploads directory
production
: backups for the "production" environment- (wikis in production)
elasticsearch
: files associated with Elasticsearch datalogs
:jobs_20170525_cron.log
: log from automated job runnerparsoid-restart.log
: log from nightly parsoid restartssearch-index.demo.1495583788.log
: log from this wiki's search index rebuildingsmw-rebuilddata-out.demo.1495583793.log
: log from this wiki's SMW rebuildData.php
mariadb
: many files and directories associated with MariaDB datamysql-bin.000001
: Ref Issue #613: mysql-bin files are not cleaned up by meza currentlymysql-bin.000002
:mysql-bin.......
:mysql-bin.00000N
:
tmp
: temp files which can be deleted. Ref Issue #497: need to keep this directory cleanuploads
:demo
: location where Demo Wiki's uploads/images are kept- (more wikis uploads/ directories)
uploads-gluster
: used instead ofuploads
if multiple app-servers used. File system distributed between app-servers.
/opt/.deploy-meza
[edit]This directory is a hidden directory (e.g. starts with a period) because it really shouldn't be modified directly. When the meza deploy
command is run this directory is set based upon the config set in /opt/conf-meza
.
config.php
: PHP config variable file written based off defaults, secret and public configconfig.sh
: Bash config variable file written based off defaults, secret and public configExtensions.php
: Extensions to load, written based off core and local extensionselastic-build-index.sh
: Rebuild Elasticsearch index for a wiki. Deployed byrole:mediawiki
elastic-rebuild-all.sh
: Wrapper forelastic-build-index.sh
. Deployed byrole:mediawiki
smw-rebuild-all.sh
: Rebuild SMW data for all wikis. Deployed byrole:mediawiki
public
: A copy of /opt/conf-meza/public, but present on all app-servers, as opposed to/opt/conf-meza
which is only present on the controllerMezaLocalExtensions.yml
: present but not used within .deploy-meza (controller only)postLocalSettings.d
: gives app servers access to these filespreLocalSettings.d
: gives app servers access to these filespublic.yml
: present but not used within .deploy-meza (controller only)wikis
:demo
: gives app servers access to these logos and wiki specific PHP
runAllJobs.php
: Used in cron jobs to run jobs
/opt/htdocs
[edit]This directory is similar to /opt/.deploy-meza
in that it is a deployed directory: It is put in place on app servers by the meza application. In fact, it was considered to be placed at /opt/.deploy-meza/htdocs
but due to its larger significance as the web root it seemed like it should have its own directory.
index.php
: entrypoint for landing pagemediawiki
: mediawiki application. many items not shown belowextensions/
: where extensions are installed (by the meza application; sysadmins do not need to touch this)LocalSettings.php
: Settings file generated based on your configLocalSettings.php.17294.2017-05-22@18:59:46~
: Ref Issue #710: backups of LocalSettings.php not requiredLocalSettings.php.22591.2017-05-23@00:36:42~
: (see above)LocalSettings.php.31311.2017-05-23@19:03:29~
: (see above)
ServerPerformance
: logging and performance graphscss
:nv.d3.css
:
index.php
: server performancejs
:d3.js
:jquery-3.1.0.min.js
:nv.d3.js
:server-performance.nvd3.js
:
space.php
: disk space usage
WikiBlender
: landing page repo. Perhaps should be rolled into mezawikis
:demo
: directory that symlinks to deployed config, to make logo/favicon web accessibleconfig
: symlink to/opt/.deploy-meza/public/wikis/demo
(Ref Issue #709: Security implications)
- (more wikis)