Mendix Hosting Enviroment project structure and commands

3 minutes to read Download PDF Edit

Description

This section describes the commands and the project structure you can use while working on the Mendix ‘Custom Cloud’ Hosting Environment.

Instructions

Application folder

The application folder is located at /srv/mxinstances/ followed by the user name you logged in with. For this example the username ‘mendix’ will be used. This will mean that the application folder is /srv/mxinstances/mendix. This folder looks as follows:

.
├── data
│   ├── database
│   ├── files
│   ├── model-upload
│   └── tmp
├── model
└── web

The model and web folders will contain your application model and static content like styling and forms. These two locations are automatically managed, you never need to alter anything directly here.

The data folder contains all kind of data that is private to this application environment only.

  • in model-upload, you can upload a ‘deployment-archive’ file that is generated by the Mendix Modeler
  • database is used for reading and writing database dump files (in postgresql .backup format) and logs of database structure validation commands that are executed
  • files will contain uploaded files of the application. You should never need to take any manual action regarding this location
  • tmp can be used as location for temporary disposable files

Helper tools for starting and stopping the application process

To unpack a deployment archive, start, stop and manage the application, a little tool called m2ee is provided on the server system. You can start this utility by simply typing m2ee at the command line:

example@example.mendix.net:~ 1-$ m2ee
WARNING: /srv/mendix/example/model/model.mdp is not a file!
INFO: Application Name: Some Example Application
INFO: The application process is not running.
m2ee(example):

Using help or ? you can show available commands:

m2ee(example): ?
Welcome to m2ee, the Mendix Runtime helper tools.

Available commands:
 unpack - unpack an uploaded Mendix Deployment Archive from data/model-upload
 start - try starting the application using the unpacked deployment files
 stop - stop the application
 restart - restart the application
 status - display Mendix Runtime status (is the application running?)
 check_health - manually execute health check
 create_admin_user - create first user when starting with an empty database
 update_admin_user - reset the password of an application user
 who, w - show currently logged in users
 log - follow live logging from the application
 loglevel - view and configure loglevels
 profiler - start the profiler (experimental)
 about - show Mendix Runtime version information
 exit, quit, <ctrl>-d - exit m2ee

When using PostgreSQL, you can also use:
 psql - start the postgresql shell
 dumpdb - create a database dump into the data/database folder
 emptydb - drop all tables and sequences from the database
 restoredb - restore a database dump from the data/database folder

[...]

Hint: use tab auto completion for commands!

Application configuration

All configuration that is specific to the application environment you’re logged in to is contained in a configuration file, that is named m2ee.yaml, located in the .m2ee folder in the home directory of the server account. When your user account is example, this means the location of the file on the server file system is probably /home/example/.m2ee/m2ee.yaml. This file is a text file in YAML format, and has a fair amount of inline documentation.

The file can be edited using a text editor like vim or nano, the latter being more friendly for new users. To e.g. edit the file using nano, first exit the m2ee program if it’s running, and type nano ~/.m2ee/m2ee.yaml. After editing and saving the file, start m2ee again, which will use the altered configuration.

Don’t hesitate to ask for help on the Mendix Forum at https://forum.mendix.com/ or file a support ticket for your application environment at https://support.mendix.com/ if you have trouble editing this file or understanding details of the configuration.

Copyright © Mendix. All rights reserved. | Mendix.com | Terms of Use | Privacy Policy