Giter Site home page Giter Site logo

chrishultin / php-app-clouddb Goto Github PK

View Code? Open in Web Editor NEW

This project forked from rackspace-orchestration-templates/php-app-clouddb

0.0 3.0 0.0 1.19 MB

Load Balanced PHP servers with a backend Cloud Database

License: Apache License 2.0

Ruby 52.86% Perl 0.07% Shell 2.13% HTML 44.80% Python 0.13%

php-app-clouddb's Introduction

Circle CI Description

This is a template for deploying a PHP application from a git repo under mod_php on multiple Linux servers with OpenStack Heat on the Rackspace Cloud, with a Cloud Database back end. This template is leveraging chef-solo to set up the server.

Requirements

  • A Heat provider that supports the Rackspace OS::Heat::ChefSolo plugin.
  • An OpenStack username, password, and tenant id.
  • python-heatclient >= v0.2.8:
pip install python-heatclient

We recommend installing the client within a Python virtual environment.

Example Usage

Here is an example of how to deploy this template using the python-heatclient:

heat --os-username <OS-USERNAME> --os-password <OS-PASSWORD> --os-tenant-id \
  <TENANT-ID> --os-auth-url https://identity.api.rackspacecloud.com/v2.0/ \
  stack-create myphpapp -f php_app_multi.yaml \
  -P repo=https://github.com/MyUser/MyApp.git -P url=http://myapp.org \
  -P db_user=username -P db_pass=wxtRSvbx
  • For UK customers, use https://lon.identity.api.rackspacecloud.com/v2.0/ as the --os-auth-url.

Optionally, set environment variables to avoid needing to provide these values every time a call is made:

export OS_USERNAME=<USERNAME>
export OS_PASSWORD=<PASSWORD>
export OS_TENANT_ID=<TENANT-ID>
export OS_AUTH_URL=<AUTH-URL>

Parameters

Parameters can be replaced with your own values when standing up a stack. Use the -P flag to specify a custom parameter.

  • load_balancer_hostname: Hostname to give the Cloud Load Balancer (Default: PHP-Load-Balancer)
  • server_hostname: Hostname to give the Cloud Servers (Default: php)
  • server_count: Number of Cloud Servers to deploy (Default: 2)
  • image: Operating system to use (Default: Ubuntu 12.04 LTS (Precise Pangolin))
  • flavor: Server size to use (Default: 4 GB Performance)
  • db_flavor: Amount of memory for the Cloud Database to use (Default: 1GB Instance)
  • db_user: User name to associate with the Cloud Database (Default: db_user)
  • db_pass: Password to associate with the Cloud Database (Default: none)
  • db_size: Disk size, in GB, for the Cloud Database (Default: 10)
  • ssh_keypair_name: Name of the SSH key pair to register with nova (Default: none)
  • revision: Git tag or commit hash that should be deployed (Deafult: HEAD)
  • packages: Comma delimited list of additional system packages to install (Default: none)
  • repo: Specifies a git URL from which to reploy the app (Default: none)
  • url: Vase url for your application (Default: http://example.com)
  • deploy_key: Private key to deploy from a private git repo.
  • destination: Directory into which the application will be installed. (Default: /var/www/vhosts/application)
  • public: URL path on which the application is accessed (Default: /)
  • http_port: Port where http connections are accepted (Default: 80)
  • https_port: Port where https connections are accepted (Default: 443)
  • memcached_size: Amount of memory, in MB, for memcached to use (Default: 128)

Outputs

Once a stack comes online, use heat output-list to see all available outputs. Use heat output-show <OUTPUT NAME> to get the value fo a specific output.

  • private_key: SSH private that can be used to login as root to the servers.
  • load_balancer_ip: IP of the Load Balancer created with this deployment.
  • database_id: UUID of the Cloud Database created.
  • database_hostname: Hostname for the Cloud Databases instance.
  • server_public_ips: Public IP addresses of the Cloud Servers created.
  • server_private_ips: Private IP addresses of the Cloud Servers created.

For multi-line values, the response will come in an escaped form. To get rid of the escapes, use echo -e '<STRING>' > file.txt. For vim users, a substitution can be done within a file using %s/\\n/\r/g.

Stack Details

By default the application will be deployed under /var/www/application

Contributing

There are substantial changes still happening within the OpenStack Heat project. Template contribution guidelines will be drafted in the near future.

License

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

php-app-clouddb's People

Contributors

jasonboyles avatar brint avatar jasondunsmore avatar pratikmallya avatar linuturk avatar

Watchers

Christopher Hultin avatar James Cloos 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.