Usage and extending papache_conf_generator.py

  1. Usage

    For creating config we have to perform:

    $  ./scripts/papache_conf_generator.py -n %server_name% -o %config_file_output% -f %site_catalog% -e %error_log_name%

    -n  Host name (for example localhost, geomongo) Mandatory parameter

    -o  Name of output config (by default output.conf) it will be saved in directory config/

    -f  Name of the catalog where the website will be hosted (by default geomongo)

    -e  Name of log where apache errors will be written (by default error)

    Example:

    $  ./scripts/papache_conf_generator.py -n localhost -o 000-default.conf -f geomongo

    It will create a config config/000-default.conf with server name localhost which is located in /var/www/geomongo.

  2. Structure template.conf

    config/template.conf is the template of config where instead of parameters the keys are %template_key% which will be replaced by script.

    Example:

    WSGIScriptAlias / /var/www/%geomongo_path%/geomongo.wsgi
    DocumentRoot /var/www/%geomongo_path%

    where %geomongo_path% is the path to the website scripts.

  3. Extension methods

    For adding new parameters we need to add it to template.conf and to add parameters of command line to the script. Also we have to extend method generate adding to it the needed argument.

    Example:

def generate(...., value): 
  ...... 
 .replace("%template_key%", value)
 ......
ShareShare on FacebookShare on Google+Tweet about this on TwitterShare on LinkedInShare on VKEmail this to someone