GithubHelp home page GithubHelp logo

rex-apache's Introduction

Simple Apache Module

This is an example Apache module for Rex.

This module consist of 1 task (setup) and 2 resources (vhost and module). This module works with CentOS 7.

TASKS

  • setup

With this task you can setup the apache webserver and configure it.

use Rex -feature => ['0.54'];

use Apache;

group frontends => "fe[01..10]";

task "setup", sub {
  Apache::setup;
};

The setup task has some parameters you can define:

  • package - the package name to install
  • service - the service name to use
  • listen - on which port the apache server should listen on
  • user - the user for the daemon
  • group - the group for the daemon
  • server_admin - the ServerAdmin configuration option
  • document_root - the base DocumentRoot configuration option
  • error_log - the error.log file
  • log_level - the log level
  • cgi_bin - the path to your cgi scripts
  • default_charset - the default charset Apache should use
  • httpd_conf_template - if you want to use a custom template
task "setup", sub {
  Apache::setup {
    listen        => 8080,
    document_root => "/srv/www/htdocs",
  };
};

RESOURCES

  • module

With this resource you can manage which module the Apache webserver should load.

task "setup", sub {
  Apache::setup;

  Apache::module "rewrite",
    ensure => "present";
};

If you need to define the load order, you can also set the order parameter.

task "setup", sub {
  Apache::setup;

  Apache::module "rewrite",
    order  => '04',
    ensure => "present";
};
  • vhost

With this resource you can manage the virtual hosts.

task "setup", sub {
  Apache::setup;

  Apache::vhost "www.somedomain.tld",
    ensure => "present";
};

There are several options you can define here:

  • order - the load order
  • ip - the ip to use. default: *
  • server_admin - the ServerAdmin configuration option
  • document_root - the DocumentRoot for this virtual host
  • error_log - the error.log file for this virtual host
  • access_log - the access.log file for this virtual host
  • access_log_format - the log format for this virtual host
  • template - if you want to use a custom tempate
task "setup", sub {
  Apache::setup;

  Apache::vhost "www.somedomain.tld",
    order  => '01',
    ip     => '127.0.0.1',
    ensure => "present";
};

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.