Git Product home page Git Product logo

layer-apache-php's Introduction

Overview

This is a runtime layer that is intended to be built upon by other charm layers. It provides Apache2 and modphp5, and manages sites based on an apache.yaml defined in the charm layer that uses this.

Usage

In your charm layer's composer.yaml, you will need to include this layer, e.g.:

includes: ['layers:apache-php']

Then, you will need to include an apache.yaml file which can specify additional packages to install, and one or more sites to install and manage. Each site definition should include an install_from section whose keys are arguments to install_remote and should at a minimum include a source value. It can also include an options value, to be used for the Options directive, and a server_name value, to be used for the ServerName directive and which can reference config options via {config["<key>"]} interpolation. An example apache.yaml might look like:

packages:
    - 'php5-mysql'
    - 'php5-gd'
sites:
    vanilla:
        server_name: '{config["hostname"]}'
        options: 'Indexes FollowSymLinks MultiViews'
        install_from:
            source: https://github.com/vanillaforums/Garden/archive/Vanilla_2.0.18.8.tar.gz
            checksum: acf61a7ffca9359c1e1d721777182e51637be59744925935291801ccc8e8fd55
            hash_type: sha256

Your site will be installed in to /var/www/<site> where <site> is the name of your site entry (vanilla in the example above).

Finally, your charm layer will need to interact with this layer via reactive states. This layer will set the apache.available state once your apache.yaml has been processed and all sites installed, at which point your charm layer should perform any additional setup (such as creating site config files, opening the appropriate ports, etc) and then set the apache.start state.

layer-apache-php's People

Contributors

johnsca avatar nobuto-m avatar token47 avatar

Watchers

 avatar  avatar

layer-apache-php's Issues

no php5 in xenial

In xenial, php5 modules are not available. It would be nice if this layer could be capable for multiple Ubuntu releases. Since xenial, meta packages without php version are available as php-cgi, libapache2-mod-php, php-mysql, php-gd, etc.

[reactive/apache.py]

packages = ['apache2', 'php5-cgi', 'libapache2-mod-php5']

[README.md]

    packages:
        - 'php5-mysql'
        - 'php5-gd'

Missing layer.yaml breaks install

When building charms with "charm build" that includes apace-php layer.

It looks like the composer.yaml file from the apache-php layer interferes with the charm build process:

https://github.com/juju-solutions/layer-apache-php/blob/0b1cb60/composer.yaml
https://github.com/juju/charm-tools/blob/6724b74/charmtools/build/builder.py#L127

The resulting "layer.yaml" is not correct in that case and install will fail.

Renaming the composer.yaml file tolayer.yaml in the included layer-apache-php before a build seems to fix it.

See also: canonical/layer-basic#192

For a related issue coming from layer-basic.

Support parsing of config options

At the current time, if you want to set a value from the config.yaml file, there is no way to do it. You should be able to pass on a config variable (e.g. download link, hash for that link).

Fix readme reference to php5

In the README.

Please update so that the packages refer to

apache.yaml

packages:
  - 'php7.0-mysql'
  - 'php7.0-gd'

Instead of php5, which is not available in xenial or perhaps even reference some alternative approach.

Following the README today just breaks things for anything newer....

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.