GithubHelp home page GithubHelp logo

dottobr83 / openshift-diy-nginx-php Goto Github PK

View Code? Open in Web Editor NEW

This project forked from boekkooi/openshift-diy-nginx-php

0.0 2.0 0.0 10.13 MB

Openshift Do-It-Yourself with nginx and php 5.5/5.4

Shell 99.92% PHP 0.08%

openshift-diy-nginx-php's Introduction

boekkooi/openshift-nginx-php

This is a sample repository to get nginx + php fpm running on openshift.

More information about openshift: https://openshift.redhat.com/

If you are using openshift online you may want to take a look at the special nginx and php catridge

What's inside

The .openshift/action_hooks scripts:

  • build:
    • Build the versions of nginx, php and nodejs that are needed
  • build_*
    • The functions used for checking the versions and installing
  • deploy
    • This will render copy the nginx and php conf files
    • Copy the .bash_profile if there is none
  • common
    • A common include script for the action hooks (just setting some path's)
  • start
    • Starts Nginx and php-fpm
  • stop
    • Stops Nginx and php-fpm

The .openshift/tmpl templates:

Here are the templates used by the build and deploy scripts. Just customize away.

The web/ nginx web folder:

The web folder currently used. You can change this in .openshift/tmpl/nginx.conf.tmpl.

Usage

To get PHP 5.6 working at OpenShift, you have to do the following:

  1. Create a new Openshift "Do-It-Yourself" application
  2. Clone this repository
  3. Add a new remote "openshift" (You can find the URL to your git repository on the Openshift application page)
  4. Run git push --force "openshift" master:master
  5. SSH into your gear
  6. Wait for build to finish (This may take at least an hour)
  7. Open http://appname-namespace.rhcloud.com/ to verify

Extra's

Nodejs

Support for NodeJS is availible! Just uncomment NODE_VERSION in .openshift/action_hooks/build and commit/push the file.

Phalcon Framework

Support for Phalcon is availible! Just uncomment PHALCON_VERSION in .openshift/action_hooks/build and commit/push the file.

Known issues

PHP 5.4 won't build

To get PHP 5.4 to build open .openshift/action_hooks/build_php and remove --enable-opcache(line: 68).

Only index.php works in root dir

Currently the .openshift/tmpl/nginx.conf.tmpl configuration template for nginx only redirects to the web/index.php file. You can change this by editing the template file. Also see http://wiki.nginx.org/Symfony for some extra information.

The hooks are not executing

This probably happens because they are not executable. Just do git update-index --chmod=+x -- $(git ls-files .openshift/action_hooks/*) in your project root and commit/push.

Openshift disconnects on build

This seems to be a problem within openshift (see https://www.openshift.com/forums/openshift/openshift-build-timeout).

To resume the build, first make an arbitary change to your local repo (e.g. add some text to README.md), commit that change and then do another git push --force "openshift" master:master.

Other

Maybe have a look at stackoverflow and if you end up empty-handed just create a issue.

Thanks

Thanks to the following people:

Reading material

Some articles that mention how you can use this repo and other related articles:

If you wrote a article about openshit and nginx+php please let me know so I can add it to the list.

openshift-diy-nginx-php's People

Contributors

boekkooi avatar unisys12 avatar giftymalik avatar pitekantrop avatar

Watchers

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.