GithubHelp home page GithubHelp logo

piannelli / corleymaintenancebundle Goto Github PK

View Code? Open in Web Editor NEW

This project forked from matatirosolutions/corleymaintenancebundle

0.0 2.0 0.0 150 KB

Maintenance web pages (Hard and Soft modes) - Symfony2 Bundle

License: MIT License

PHP 95.76% HTML 4.24%

corleymaintenancebundle's Introduction

Corley Maintenance Bundle

SensioLabsInsight

Just an unified way to put a web application under maintenance mode using web server strategies. The maintenance mode will cut off all requests and it will replies with a static html file and a 503 header (Service Unavailable).

Those conditions will ensure that a load balancer cut an instance off during a maintenance

Build Status

Install

In your composer.json add the requirement

"require": {
    "corley/maintenance-bundle": "0.1.*"
}

Register the bundle in your AppKernel

public function registerBundles()
{
    ...
    $bundles = array(
        ...
        new Corley\MaintenanceBundle\CorleyMaintenanceBundle(),
    );
    ...
    return $bundles;
}

Maintenance mode

When you want to put your web application under maintenance

app/console corley:maintenance:lock on

Restore the application status

app/console corley:maintenance:lock off

Configure your web server

If you use Apache2 you have to add few lines to your .htaccess, in case of nginx just add dedicated lines to web app configuration.

In order to obtain your configuration options just use the console

Apache2

app/console corley:maintenance:apache-dump

Nginx

app/console corley:maintenance:nginx-dump

Configuration

You can configure the bundle in order to change the default behaviour (all options has a default value)

# config.yml
corley_maintenance:
    page: %kernel.root_dir%/../web/maintenance.dist.html
    hard_lock: lock.html
    symlink: false

Options:

  • page is the original maintenance page
  • symlink If you want to use symlinks instead hardcopy strategy
  • hard_lock Is the name used in order to lock the website
  • web public folder (by default web folder)
  • soft_lock Is the name used in order to lock the website (using app layer)
  • whilelist Authorized connections [soft-lock only]
    • paths A list of paths that skip the maintenance lock
    • ips A list of ips that skip the maintenance lock

Soft locking

The soft locking strategy use the php layer in order to lock down the website. This means that the application must works in order to lock down the web site.

The soft lock runs at kernel.request and stop other event propagations.

corleymaintenancebundle's People

Contributors

piannelli avatar wdalmut avatar

Watchers

 avatar  avatar

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.