GithubHelp home page GithubHelp logo

tengyifei / openshift-cartridge-nginx-hhvm Goto Github PK

View Code? Open in Web Editor NEW
37.0 7.0 31.0 256.12 MB

Cartridge to run HHVM on OpenShift

Home Page: http://goo.gl/4YBNSb

License: Other

Shell 30.14% HTML 49.82% PHP 20.04%

openshift-cartridge-nginx-hhvm's Introduction

OpenShift HHVM Cartridge

Join the chat at https://gitter.im/tengyifei/openshift-cartridge-nginx-hhvm

Nginx 1.10.0 with HHVM 3.13.1. Built with the shiny GCC 5.2.0.

Partly based on pinodex/openshift-nginx-php-fpm.

Usage

Command line

The www root is located in www folder of your code repository, unless index.php or app.php is detected at the root folder of the repository, in which case the www root will be the root folder.

$ rhc app create appname http://cartreflect-claytondev.rhcloud.com/github/tengyifei/openshift-cartridge-nginx-hhvm
$ cd appname
$ echo '<?php echo "Hello HHVM " . HHVM_VERSION; ?>' > www/index.php
$ git add .
$ git commit -m 'Testing'
$ git push

On the Web

![NGINX+HHVM ON OpenShift](http://launch-shifter.rhcloud.com/launch/NGINX+HHVM ON.svg)

OpenShift also offers a web-based application launcher workflow. PHP project maintainers can build their own launch buttons using this cart, with launch-service

Updating Cartridge

Note: from HHVM version 3.5.0 onwards this cartridge uses INI settings instead of the deprecated HDF. You'll still have to do a manual upgrade to pick up this change.

OpenShift Online has made it next to impossible to update web cartridges unintrusively. Previous methods involved removing the cartridge (therefore the entire app!) and reinstalling it to let OpenShift grab the latest version in the repository. This cartridge now comes with a script to update HHVM and Nginx binaries without reinstalls necessary. To update your cartridge binaries, simply SSH into it and run bin/control update from shell:

rhc ssh hhvmtest
# In SSH
cd nginx-hhvm
bin/control update

HHVM

The HHVM packaged with this cartridge is built directly from the newest released version of HHVM source. Different from the official version, it comes with the experimental Zend Compatibility Layer (enabling many Zend extensions e.g. gettext, oauth) and a GeoIP plug-in.

User-defined configuration

Place your nginx .conf files inside config/nginx.d/. It will be include()ed from "http" scope.

You may edit the config.ini inside config/hhvm.d/. This configuration file will be loaded by HHVM.

openshift-cartridge-nginx-hhvm's People

Contributors

coolspring8 avatar gitter-badger avatar ryanj avatar tengyifei avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

openshift-cartridge-nginx-hhvm's Issues

nginx can not include default.conf to nginx.conf

At the end of file nginx.conf have include.conf but it File default.conf is dismissed when restart nginx.
I add everything into file default.conf but it not working.
I only copy code default.conf into file nginx.conf (at line include .../*.conf;) and it work for me.

a problem about the configuration of caching

Hello!
Well,there are two lines in config/nginx.d/default.conf.erb,which are
" # avoid caching by proxies
add_header Cache-Control private;"
As far as I know,this header prevents files(even if they are static) from being cached by both proxies and client browser.It might reduce the chances of some problems,but it also makes the website slower to be loaded.
So,Is it necessary for a production environment?
I removed these lines in my application,and it has been working well so far.
I'd like to thank you for answering me.

Still 502 Bad Gateway

nginx_error.log
2015/03/05 12:10:13 [error] 373279#0: *1 upstream prematurely closed connection while reading response header from upstream, client: 10.143.222.115, server: v-kiz.rhcloud.com, request: "HEAD / HTTP/1.1", upstream: "fastcgi://unix:/var/lib/openshift/54f8888ee0b8cd1031000045/app-root/data/hhvm.sock:", host: "v-kiz.rhcloud.com"
2015/03/05 12:10:13 [error] 373279#0: *3 connect() to unix:/var/lib/openshift/54f8888ee0b8cd1031000045/app-root/data/hhvm.sock failed (111: Connection refused) while connecting to upstream, client: 10.143.222.115, server: v-kiz.rhcloud.com, request: "HEAD / HTTP/1.1", upstream: "fastcgi://unix:/var/lib/openshift/54f8888ee0b8cd1031000045/app-root/data/hhvm.sock:", host: "v-kiz.rhcloud.com"
2015/03/05 13:10:11 [error] 373279#0: *5 connect() to unix:/var/lib/openshift/54f8888ee0b8cd1031000045/app-root/data/hhvm.sock failed (111: Connection refused) while connecting to upstream, client: 10.143.222.115, server: v-kiz.rhcloud.com, request: "HEAD / HTTP/1.1", upstream: "fastcgi://unix:/var/lib/openshift/54f8888ee0b8cd1031000045/app-root/data/hhvm.sock:", host: "v-kiz.rhcloud.com"

我一直在创建新的Application并安装最新版的Cartridge,但它一直提示错误502。望修复,谢谢

Please upgrade php version

I see that the php version coming up installed with this catridge is php 5.3.x. Please upgrade to something new - minimum php 5.4

CLIENT_RESULT: Application is either stopped or inaccessible CLIENT_RESULT?

Hi!
When I update to version 3.8.1
I checked bin/control start "CLIENT_MESSAGE: Version: 3.8.1"
And after I visit my site it's not worked. I don't know why?
My site say 503 Service Temporarily Unavailable
The server is temporarily unable to service your request due to maintenance downtime or capacity problems. Please try again later.

Apache/2.2.15 (Red Hat) Server at ****.rhcloud.com Port 80
I has used command
bin/control status
and I received messenge
CLIENT_RESULT: Application is either stopped or inaccessible
CLIENT_RESULT: curl:

I hope you can fix

Permission denied error while creating app

I'm getting the following error when trying to create an app using this cartridge:

Creating application 'hhvmtest' ... mkdir: cannot create directory '/var/lib/openshift/53b609aa65fe3fde4600001c/nginx-hhvm//usr': Permission denied

Permission errors when scaling app

screenshot from 2015-01-18 22 19 04

To reproduce the issue, create a new scalable app with this cartridge, and scale up the app. I have to do chmod +x .openshift/action_hooks/deploy on my local app repo and then push to temporarily fix the issue.

a trouble in scaling app

Hello,
This may not have to do with this cartridge,but I'd like to thank you if you help me.Yesterday I used this cartridge to create an scalable application and installed WordPress on it. It ran well,but when I tried refreshing the page very quickly today,the local-gear seemed to go down(503,and then 504).
I checked haproxy-status and it seemed like to make another gea up.However,when I visited my site again,the page become the original "Welcome to OpenShift".
I tried restarting the application but it didn't work.Is that means the file and data can't be shared even between the two gears of an application?Or do I need to do anything extra to use an scalable app?(I noticed when I first visited the website,it set a cookie like "Set-Cookie:GEAR=local-1234567890f9337d81012345; path=/".I guess it can ensure the visitor visit a certain gear,but when the local gear goes down,it doesn't seem to help.)
Thanks!

Update HHVM NGINX Both

Hi,

Thanks for this awesome thing.

Please Update HHVM & NGINX Both.

You can actually follow a proper release schedule for this cartridge that can be done easily as you can get the dates of next release of HHVM and NGINX Both.

Curl (SSL) no longer works.

Recently, I am having some issues with getting SSL+CURL to work in HHVM.
HHVM always seems to think that the CAfile is at /home/ec2-user/.linuxbrew/etc/openssl/cert.pem when it is supposed to be at /etc/ssl/certs/ca-bundle.crt. I cannot set an alternate path due to facebook/hhvm#6190

Error Message

LD_LIBRARY_PATH=${OPENSHIFT_PHP_DIR}usr/bin  ${OPENSHIFT_PHP_DIR}usr/bin/hhvm  --config ${OPENSHIFT_REPO_DIR}config/hhvm.d/config.ini composer.phar selfupdate



  [Composer\Downloader\TransportException]                                                                                                                   
  The "https://getcomposer.org/version" file could not be downloaded: Failed to open https://getcomposer.org/version (error setting certificate verify loca  
  tions:                                                                                                                                                     
    CAfile: /home/ec2-user/.linuxbrew/etc/openssl/cert.pem                                                                                                   
    CApath: none)                                                                                                                                            



self-update [-r|--rollback] [--clean-backups] [--no-progress] [--] [<version>]

Is there any temporary workaround that can be done?

using xhp

I managed to get Composer to load Facebook's XHP library with the --ignore-platform-reqs flag, and I added the following line to config/hhvm.d/config.ini.erb

hhvm.enable_xhp = true

However, I still get the following error when I try to use XHP tags:

unknown class x_xhp__composable_element

which appears to mean that XHP is not actually enabled?

Failure to launch ryanj/silex-base

I often use my silex-base repo for testing PHP services on OpenShift.

However, I'm not sure if this cart understands how to handle this newer project layout (ryanj/silex-base).

The app failed to serve the default index page after launching from the CLI:

rhc app create silexhhvm http://cartreflect-claytondev.rhcloud.com/github/tengyifei/openshift-cartridge-nginx-hhvm --from-code=http://github.com/ryanj/silex-base.git

And, had the same result from the web: https://openshift.redhat.com/app/console/application_type/custom?&cartridges[]=http://cartreflect-claytondev.rhcloud.com/github/tengyifei/openshift-cartridge-nginx-hhvm&initial_git_url=http://github.com/ryanj/silex-base&name=hhvm

PHP application maintainers should be able to use your cart as a dependency to launch their service.

Update nginx to 1.9.5 and hhvm to 3.9.0

Is there an update planned for this repo updating these two core components for this cartridge? If not how would I update these on my own with a forked repo?

Guide to compile custom nginx and HHVM into this cartridge

It would be nice if you could write some sort of guide how to compile latest nginx and hhvm and integrate it with this cartridge. For example nginx - there is new version (1.10.1) which fixes CVE and power users will probably love to use latest version if they are able to compile it relatively easily.

Apart from that - somebody might want to compile customized version of nginx which is not possible to have by default.

Thanks

Cartridge shows 502 Error

Filed on behalf of gerdamit [at] gmail.com

==> nginx-hhvm/logs/nginx_error.log <==
2015/01/30 07:41:39 [error] 400040#0: *8 connect() to unix:/var/lib/openshift/{MY_APP_ID}/app-root/data/hhvm.sock failed (111: Connection refused) while connecting to upstream, client: XX.XX.XX.XX, server: {MY_HOST}.rhcloud.com, request: "GET / HTTP/1.1", upstream: "fastcgi://unix:/var/lib/openshift/{MY_APP_ID}/app-root/data/hhvm.sock:", host: "{MY_HOST}.rhcloud.com"
Uncaught exception: 98 failed to bind to async server socket: /var/lib/openshift/{MY_APP_ID}/app-root/data/hhvm.sock: Address already in use

Looks like we need to either delete and recreate the socket upon start up, or use a random socket name.

504 Gateway Time-out, The server didn't respond in time.

Added this in config.ini.erb of hhvm.d to extend time-outs

; Connection timeouts
hhvm.server.connection_timeout_seconds = 600
hhvm.server.request_timeout_seconds = 600

I'm still getting these errors, any idea how I can resolve this?

[Thu May  7 19:57:12 2015] [hphp] [317533:7fe1e79ff700:47:000001] [] \nFatal error: entire web request took longer than 60 seconds and timed out
[Thu May  7 20:17:35 2015] [hphp] [470191:7fce9d9ff700:12:000001] [] Finished singleJitRequest 1
[Thu May  7 20:17:37 2015] [hphp] [470191:7fce9a9ff700:13:000001] [] Finished singleJitRequest 2
[Thu May  7 20:17:40 2015] [hphp] [470191:7fce9d9ff700:13:000001] [] Finished singleJitRequest 3
[Thu May  7 20:17:43 2015] [hphp] [470191:7fce9a9ff700:14:000001] [] Finished singleJitRequest 4
[Thu May  7 20:17:45 2015] [hphp] [470191:7fce9d9ff700:14:000001] [] Finished singleJitRequest 5
[Thu May  7 20:21:38 2015] [hphp] [470191:7fce9a9ff700:27:000001] [] SlowTimer [1142ms] at runtime/ext_mysql: slow query: INSERT INTO `wp_postmeta` (`post_id`, `meta_key`, `meta_value`) VALUES (70, 'header_bg_image', '')
[Thu May  7 20:23:51 2015] [hphp] [470191:7fce9a9ff700:27:000002] [] \nFatal error: entire web request took longer than 300 seconds and timed out

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.