<commit_before>---
title: 
layout: module
---

# HTTPD web server

    module.exports = []
    module.exports.push 'masson/bootstrap/'

## Configuration

Configure the HTTPD server.

    module.exports.push (ctx) ->
      ctx.config.httpd ?= {}
      ctx.config.httpd.startup ?= '2,3,5'
      ctx.config.httpd.action ?= 'start'

## Install

Install the HTTPD service and declare it as a startup service.

    module.exports.push name: 'HTTPD # Install', timeout: -1, callback: (ctx, next) ->
      {startup, action} = ctx.config.httpd
      ctx.service
        name: 'httpd'
        startup: startup
        action: action
      , (err, serviced) ->
        next err, if serviced then ctx.OK else ctx.PASS


<commit_msg>set https users and groups<commit_after>---
title: 
layout: module
---

# HTTPD web server

    module.exports = []
    module.exports.push 'masson/bootstrap/'

## Configuration

Configure the HTTPD server.

    module.exports.push (ctx) ->
      ctx.config.httpd ?= {}
      # Service
      ctx.config.httpd.startup ?= '235'
      ctx.config.httpd.action ?= 'start'
      # User
      ctx.config.httpd.user = name: ctx.config.httpd.user if typeof ctx.config.httpd.user is 'string'
      ctx.config.httpd.user ?= {}
      ctx.config.httpd.user.name ?= 'apache'
      ctx.config.httpd.user.system ?= true
      ctx.config.httpd.user.gid ?= 'apache'
      ctx.config.httpd.user.comment ?= 'Apache HTTPD User'
      ctx.config.httpd.user.home ?= '/var/www'
      ctx.config.httpd.user.shell ?= false
      # Group
      ctx.config.httpd.group = name: ctx.config.httpd.group if typeof ctx.config.httpd.group is 'string'
      ctx.config.httpd.group ?= {}
      ctx.config.httpd.group.name ?= 'apache'
      ctx.config.httpd.group.system ?= true

## Users & Groups

By default, the "httpd" package create the following entries:

```bash
cat /etc/passwd | grep pig
apache:x:48:48:Apache HTTPD User:/var/www:/sbin/nologin
cat /etc/group | grep hadoop
apache:x:48:
```

    module.exports.push name: 'HTTPD # Users & Groups', callback: (ctx, next) ->
      {group, user} = ctx.config.httpd
      ctx.group group, (err, gmodified) ->
        return next err if err
        ctx.user user, (err, umodified) ->
          next err, if gmodified or umodified then ctx.OK else ctx.PASS

## Install

Install the HTTPD service and declare it as a startup service.

    module.exports.push name: 'HTTPD # Install', timeout: -1, callback: (ctx, next) ->
      {startup, action} = ctx.config.httpd
      ctx.service
        name: 'httpd'
        startup: startup
        action: action
      , (err, serviced) ->
        next err, if serviced then ctx.OK else ctx.PASS



{'fraction_non_alphanumeric': 0.13328341445151629, 'fraction_numerical': 0.005241482590789966, 'mean_word_length': 2.520421607378129, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 12, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2095775', 'n_tokens_mistral': 900, 'n_tokens_neox': 889, 'n_words': 227}