Coder Social home page Coder Social logo

openshift-cartridge-nginx's Introduction

Openshift Nginx Cartridge

Welcome to a life where nginx is possible on openshift.

This cartridge allow you to create a scalable nginx application, defaulting to using nginx version 1.9.12. Combine this with the boekkooi PHP cartridge and you have a scalable application using the latest versions.

Just create your app using:

rhc create-app myapp http://cartreflect-claytondev.rhcloud.com/github/boekkooi/openshift-cartridge-nginx

If you want to install a specific nginx version you can add --env OPENSHIFT_NGINX_VERSION=<version> to the command. For example to install nginx 1.8.0 you can use:

rhc create-app myapp --env OPENSHIFT_NGINX_VERSION=1.8.0 http://cartreflect-claytondev.rhcloud.com/github/boekkooi/openshift-cartridge-nginx

Versions

Currently this cartridge has the following versions:

  • 1.11.1
  • 1.10.1
  • 1.9.12
  • 1.9.9
  • 1.8.0
  • 1.7.10
  • 1.6.2

If you need another version you can compile it yourself and submit a PR to get it integrated.

Compiling a new version

To compile a new version you will first need a openshift application.

rhc create-app nginx http://cartreflect-claytondev.rhcloud.com/github/boekkooi/openshift-cartridge-nginx

Now clone the repository and create a nginx folder. Now copy the usr/compile directory from this repository. Now set the versions you need to compile in the nginx/compile/versions file. Commit and push the application repository.

SSH into you app and go to the compile folder (cd ${OPENSHIFT_REPO_DIR}/nginx/compile) and start compiling by running the following command:

./all

Once compiling is done you can download the nginx-{version}.tar.gz from you application. Place the archive into the openshift-cartridge-nginx/usr folder. Last but not least edit the openshift-cartridge-nginx/manifest.yml and add the versions.

(Make sure you have Git LFS installed.) Now commit and push to your openshift-cartridge-nginx repo and create a PR.

To use your own fork make sure you change LFS_ENDPOINT in openshift-cartridge-php/bin/setup and use:

rhc cartridge add -a myapp http://cartreflect-claytondev.rhcloud.com/github/<user>/openshift-cartridge-nginx

openshift-cartridge-nginx's People

Contributors

boekkooi avatar hmarrao avatar rscorer avatar vs0uz4 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  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

openshift-cartridge-nginx's Issues

Issues with Adding SSL

Hello, I am trying to add support for SSL for the past 3 hours. When I add a new server {} to listen on port 80, and redirects to 443, the cartridge won't start up. If I bind the server to any ports other than 8080, it won't start up. Is there any way to listen on a different port? I normally just do the same thing, and it will work. But this doesn't. I am assuming something went wrong with the way it handles ports. Thanks.

Current config:

server {
listen 80;
server_name mydomain.com www.mydomain.com;
return 301 https://www.mydomain.com$request_uri;
}

server {
listen 443 ssl;
root /var/lib/openshift/56a181760fefece89fwcsa25/app-root/runtime/repo//public;
location / {
index index.html index.htm;
}
}

No config files

I am unable to find config files of nginx nor nginx folder anywhere. Everything worked great successfully installed added your php cartirade added mysql from openshift but when adding

pass the PHP scripts to PHP-FPM

location ~ .php$ {
fastcgi_pass unix:<%= ENV['OPENSHIFT_PHP_SOCKET'] %>;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param PATH_INFO $fastcgi_script_name;
include <%= ENV['OPENSHIFT_NGINX_DIR'] %>/usr/nginx-<%= ENV['OPENSHIFT_NGINX_VERSION'] %>/conf/fastcgi_params;
}
I am unable to find config file to add this.

Not able to scale gears.

I have created my application with the following command:

rhc create-app myapp --env OPENSHIFT_NGINX_VERSION=1.7.10 http://cartreflect-claytondev.rhcloud.com/github/boekkooi/openshift-cartridge-nginx -s --env OPENSHIFT_PHP_VERSION=5.5.22 http://cartreflect-claytondev.rhcloud.com/github/boekkooi/openshift-cartridge-php

Application gets created with two cartridges: 1) Nginx and 2) Php

But as soon as I want to scale my app, It throws an error:

Activation of new gears failed: 558335955973ca62cf00003c: Error activating gear: CLIENT_ERROR: Failed to execute: 'control start' for /var/lib/openshift/558335955973ca62cf00003c/php

[18-Jun-2015 17:18:47] NOTICE: [pool www] 'user' directive is ignored when FPM is not running as root

[18-Jun-2015 17:18:47] NOTICE: [pool www] 'group' directive is ignored when FPM is not running as root

[18-Jun-2015 17:18:47] ERROR: An another FPM instance seems to already listen on /var/lib/openshift/558335955973ca62cf00003c/php//run/php.socket

[18-Jun-2015 17:18:47] ERROR: FPM initialization failed

PHP enviroment successfully installed.
Version: 5.5.22
Unable to complete the requested operation due to: An invalid exit code (1) was returned from the server euw-csm-node2.prod.rhcloud.com. This indicates an unexpected problem during the execution of your request.
Reference ID: 600b4751f4988f59a026243685c06e16

scale-fail

Any thoughts why this is happening?

unix domain socket in upstream "unix:"

When I configure nginx

server {
    listen  <%= ENV['OPENSHIFT_NGINX_IP'] %>:<%= ENV['OPENSHIFT_NGINX_PORT'] %>;
    root    <%= ENV['OPENSHIFT_REPO_DIR'] %>/public;

    index index.html index.htm index.php;
    charset utf-8;

    location / {
        try_files \$uri \$uri/ /index.php?\$query_string;
    }
    location = /favicon.ico { access_log off; log_not_found off; }
    location = /robots.txt  { access_log off; log_not_found off; }

    location ~ \.php$ {
      fastcgi_split_path_info ^(.+\.php)(/.+)$;
      fastcgi_pass unix:<%= ENV['OPENSHIFT_PHP_SOCKET'] %>;
      fastcgi_index index.php;
      fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
      fastcgi_param PATH_INFO $fastcgi_script_name;
      include <%= ENV['OPENSHIFT_NGINX_DIR'] %>/usr/nginx-<%= ENV['OPENSHIFT_NGINX_VERSION'] %>/conf/fastcgi_params;
    }

    location ~ /\.ht {
        deny all;
    }
}

I got following error

nginx: [emerg] no path in the unix domain socket in upstream "unix:"
/nginx//conf/nginx_http.conf:44

413 Request Entity Too Large

I get this error when i tryed to upload a file.

I changed in php.ini the variable upload_max_filesize to 10M but the error continues.

Internal port number causes problems

Older nginx setups for OpenShifts suggests using sed to swap the internal IP and port number for the external IP and port number in start-script. Is this approach still valid, or do you have another way? The service I want to setup wants 80 or 443, but 8080 is returned.

cannot execute .php files in docroot

Forgive me if I've missed something obvious.
Created an app, installed your https://github.com/boekkooi/openshift-cartridge-php, and then this one. Then added mysql and I can remotely admin it using phpmyadmin on localhost.

I can run a .php file from the command line, but not served by nginx

example.rhcloud.com runs index.htm fine but
example.rhcloud.com/index.php just downoads index.php

Do I need to add an application type somewhere maybe?

Thanks for any help - it's probably me being dim.

Update: I thought to try to restart the app but when I do I get this:
nginx: [emerg] invalid number of arguments in "fastcgi_pass" directive in /var/lib/openshift/[ openshift id 2 0000c0 ]/nginx//conf/nginx_http.conf:34
nginx: [emerg] invalid number of arguments in "fastcgi_pass" directive in /var/lib/openshift/[ openshift id 2 0000c0 ]/nginx//conf/nginx_http.conf:34
Failed to execute: 'control restart' for /var/lib/openshift/[ openshift id 2 0000c0 ]/nginx

Can't see anything wrong with line 34 - it's exactly as you wrote.
C.

--------------------- here below are some conf files incase that helps ------------------

Here's my top:

top - 16:59:12 up 54 days, 16:51,  0 users,  load average: 1.08, 1.63, 1.93         
Tasks:  19 total,   1 running,  17 sleeping,   1 stopped,   0 zombie            
Cpu(s): 10.1%us,  5.6%sy,  0.1%ni, 83.9%id,  0.0%wa,  0.0%hi,  0.3%si,  0.1%st          
Mem:  15297608k total, 13728328k used,  1569280k free,    40012k buffers            
Swap: 52428792k total, 14858580k used, 37570212k free,  2580820k cached         

   PID USER      PR  NI  VIRT  RES  SHR S %CPU %MEM    TIME+  COMMAND           
183223 4565      20   0 12804 1108  864 R  0.7  0.0   0:03.42 top           
164510 4565      20   0  106m 2772  840 S  0.0  0.0   0:00.03 sshd          
164512 4565      20   0  104m 2224 1440 S  0.0  0.0   0:00.10 bash          
165389 4565      20   0  269m  10m 6520 T  0.0  0.1   0:00.01 php           
166300 4565      20   0  9232  936  932 S  0.0  0.0   0:00.00 bash          
166301 4565      20   0  117m 2136 1708 S  0.0  0.0   0:04.70 logshifter            
166311 4565      20   0 40728 7544 2116 S  0.0  0.0   4:24.25 ruby          
168836 4565      20   0 40468  500  360 S  0.0  0.0   0:00.00 nginx         
168838 4565      20   0 43660 1004  724 S  0.0  0.0   1:41.53 nginx         
168839 4565      20   0 43980 1280  724 S  0.0  0.0   2:07.44 nginx         
245116 4565      20   0  191m 2244 1716 S  0.0  0.0   0:04.60 logshifter            
245117 4565      20   0 15504 1212  984 S  0.0  0.0   3:53.05 haproxy           
318491 4565      20   0  106m 2916  952 S  0.0  0.0   0:00.07 sshd          
318493 4565      20   0 55148 2148 1536 S  0.0  0.0   0:00.24 sftp-server           
406882 4565      20   0  175m 1432  720 S  0.0  0.0   0:31.30 php-fpm           
406887 4565      20   0  175m 1200  516 S  0.0  0.0   0:00.00 php-fpm           
406888 4565      20   0  175m 1196  516 S  0.0  0.0   0:00.00 php-fpm           

I am running the versions anticipated:

nginx -V    
    "nginx version: nginx/1.9.12
built by gcc 4.4.7 20120313 (Red Hat 4.4.7-16) (GCC)
built with OpenSSL 1.0.1e-fips 11 Feb 2013
TLS SNI support enabled
configure arguments: --with-http_ssl_module --with-http_sub_module --with-zlib=/var/lib/openshift/ openshift id 1 0000ee/app-root/repo/usr/compile/tmp/zlib-1.2.8 --with-pcre=/var/lib/openshift/ openshift id 1 0000ee/app-root/repo/usr/compile/tmp/pcre-8.38 --with-http_ssl_module --with-http_realip_module --with-http_gzip_static_module --with-ipv6 --prefix=/var/lib/openshift/ openshift id 1 0000ee/app-root/repo/usr/nginx-1.9.12
"

php -v  
    PHP 5.6.16 (cli) (built: Jan  1 2016 16:48:18)
    Copyright (c) 1997-2015 The PHP Group
    Zend Engine v2.6.0, Copyright (c) 1998-2015 Zend Technologies

my build script is in app-root/runtime/repo/.openshift/action_hooks

#!/bin/bash
set -e

# Build PHP extra's as per https://github.com/boekkooi/openshift-cartridge-php
# Update conf/ini files and install pecl extensions
${OPENSHIFT_PHP_DIR}/bin/control build

My conf files:

nginx.conf in /var/lib/openshift/[ openshift id 2 0000c0 ]/nginx/conf

    error_log  /var/lib/openshift/[ openshift id 2 0000c0 ]/app-root/logs//nginx_error.log; 
    pid        /var/lib/openshift/[ openshift id 2 0000c0 ]/nginx//run/nginx.pid;   

    events {    
      # When you need > 8000 * cpu_cores connections, you start optimizing  
      # your OS, and this is probably the point at where you hire people    
      # who are smarter than you, this is *a lot* of requests.  
      worker_connections  8000; 

      # This sets up some smart queueing for accept(2)'ing requests 
      # Set it to "on" if you have > worker_processes   
      accept_mutex off; 

      # These settings are OS specific, by defualt Nginx uses select(2),    
      # however, for a large number of requests epoll(2) and kqueue(2)  
      # are generally faster than the default (select(2))   
      # use epoll; # enable for Linux 2.6+  
      # use kqueue; # enable for *BSD (FreeBSD, OS X, ..)   
    }   

    http {  
        include /var/lib/openshift/[ openshift id 2 0000c0 ]/nginx//usr/nginx-1.9.12/conf/mime.types;   
        default_type application/octet-stream;  

        client_body_temp_path  /tmp//client_temp;   
        proxy_temp_path        /tmp//proxy_temp;    
        fastcgi_temp_path      /tmp//fastcgi_temp;  
        uwsgi_temp_path        /tmp//uwsgi_temp;    
        scgi_temp_path         /tmp//scgi_temp; 

        # Format for our log files  
        log_format   main '$remote_addr - $remote_user [$time_local]  $status ' 
          '"$request" $body_bytes_sent "$http_referer" '    
          '"$http_user_agent" "$http_x_forwarded_for"'; 

        access_log  /var/lib/openshift/[ openshift id 2 0000c0 ]/app-root/logs//nginx_access.log  main; 

        sendfile on;    
        keepalive_timeout 65;   

        include  /var/lib/openshift/[ openshift id 2 0000c0 ]/nginx//conf/nginx_http.conf;  
    }   


nginx_http_conf in  /var/lib/openshift/[ openshift id 2 0000c0 ]/nginx/conf

    # Enable Gzip   
    gzip  on;   
    gzip_http_version 1.0;  
    gzip_comp_level 2;  
    gzip_min_length 1100;   
    gzip_buffers     4 8k;  
    gzip_proxied any;   
    gzip_types  
      # text/html is always compressed by HttpGzipModule    
      text/css  
      text/javascript   
      text/xml  
      text/plain    
      text/x-component  
      application/javascript    
      application/json  
      application/xml   
      application/rss+xml   
      font/truetype 
      font/opentype 
      application/vnd.ms-fontobject 
      image/svg+xml;    

    gzip_static on; 
    gzip_proxied        expired no-cache no-store private auth; 
    gzip_disable        "MSIE [1-6]\."; 
    gzip_vary           on; 

    server {    
        listen  127.8.234.129:8080; 
        root    /var/lib/openshift/[ openshift id 2 0000c0 ]/app-root/runtime/repo//public; 
        # pass the PHP scripts to PHP-FPM as per https://github.com/boekkooi/openshift-cartridge-php
        location ~ \.php$ {





        }
        location / {    
            index  index.php index.html index.htm;  
        }   
    }   

nginx.conf /var/lib/openshift/[ openshift id 2 0000c0 ]/nginx/usr/nginx-1.9.12/conf

    #user  nobody;  
    worker_processes  1;    

    #error_log  logs/error.log; 
    #error_log  logs/error.log  notice; 
    #error_log  logs/error.log  info;   

    #pid        logs/nginx.pid; 


    events {    
        worker_connections  1024;   
    }   


    http {  
        include       mime.types;   
        default_type  application/octet-stream; 

        #log_format  main  '$remote_addr - $remote_user [$time_local] "$request" '  
        #                  '$status $body_bytes_sent "$http_referer" '  
        #                  '"$http_user_agent" "$http_x_forwarded_for"';    

        #access_log  logs/access.log  main; 

        sendfile        on; 
        #tcp_nopush     on; 

        #keepalive_timeout  0;  
        keepalive_timeout  65;  

        #gzip  on;  

        server {    
            listen       80;    
            server_name  localhost; 

            #charset koi8-r;    

            #access_log  logs/host.access.log  main;    

            location / {    
                root   html;    
                index  index.html index.htm;    
            }   

            #error_page  404              /404.html;    

            # redirect server error pages to the static page /50x.html  
            #   
            error_page   500 502 503 504  /50x.html;    
            location = /50x.html {  
                root   html;    
            }   

            # proxy the PHP scripts to Apache listening on 127.0.0.1:80 
            #   
            #location ~ \.php$ {    
            #    proxy_pass   http://127.0.0.1; 
            #}  

            # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000    
            #   
            #location ~ \.php$ {    
            #    root           html;   
            #    fastcgi_pass   127.0.0.1:9000; 
            #    fastcgi_index  index.php;  
            #    fastcgi_param  SCRIPT_FILENAME  /scripts$fastcgi_script_name;  
            #    include        fastcgi_params; 
            #}  

            # deny access to .htaccess files, if Apache's document root 
            # concurs with nginx's one  
            #   
            #location ~ /\.ht { 
            #    deny  all; 
            #}  
        }   


        # another virtual host using mix of IP-, name-, and port-based configuration    
        #   
        #server {   
        #    listen       8000; 
        #    listen       somename:8080;    
        #    server_name  somename  alias  another.alias;   

        #    location / {   
        #        root   html;   
        #        index  index.html index.htm;   
        #    }  
        #}  


        # HTTPS server  
        #   
        #server {   
        #    listen       443 ssl;  
        #    server_name  localhost;    

        #    ssl_certificate      cert.pem; 
        #    ssl_certificate_key  cert.key; 

        #    ssl_session_cache    shared:SSL:1m;    
        #    ssl_session_timeout  5m;   

        #    ssl_ciphers  HIGH:!aNULL:!MD5; 
        #    ssl_prefer_server_ciphers  on; 

        #    location / {   
        #        root   html;   
        #        index  index.html index.htm;   
        #    }  
        #}  

    }   

my vars

HISTFILESIZE=500
HISTSIZE=500
HOME=/var/lib/openshift/[ openshift id 2 0000c0 ]/
HOSTNAME=ex-std-node571.prod.rhcloud.com
HOSTTYPE=x86_64
IFS=$' \t\n'
INSTANCE_ID=i-b82cdf6a
LANG=en_US.UTF-8
LAST_ACCESS_DIR=/var/lib/openshift/.last_access
LD_LIBRARY_PATH=/var/lib/openshift/[ openshift id 2 0000c0 ]/php//usr/shared/libs/lib:
LINES=24
LOGNAME=[ openshift id 2 0000c0 ]
MACHTYPE=x86_64-redhat-linux-gnu
MAIL=/var/mail/[ openshift id 2 0000c0 ]
MAILCHECK=60
MOVE_TO_COL='echo -en \033[60G'
OO_BASH_SDK=true
OPENSHIFT_APP_DNS=myapp-gqcloud.rhcloud.com
OPENSHIFT_APP_NAME=myapp
OPENSHIFT_APP_SSH_KEY=/var/lib/openshift/[ openshift id 2 0000c0 ]/.openshift_ssh/id_rsa
OPENSHIFT_APP_SSH_PUBLIC_KEY=/var/lib/openshift/[ openshift id 2 0000c0 ]/.openshift_ssh/id_rsa.pub
OPENSHIFT_APP_UUID=[ openshift id 2 0000c0 ]
OPENSHIFT_AUTO_DEPLOY=true
OPENSHIFT_BROKER_HOST=openshift.redhat.com
OPENSHIFT_BUILD_DEPENDENCIES_DIR=/var/lib/openshift/[ openshift id 2 0000c0 ]/app-root/runtime/build-dependencies/
OPENSHIFT_CARTRIDGE_SDK_BASH=/usr/lib/openshift/cartridge_sdk/bash/sdk
OPENSHIFT_CARTRIDGE_SDK_RUBY=/usr/lib/openshift/cartridge_sdk/ruby/sdk.rb
OPENSHIFT_CGROUP_SUBSYSTEMS=cpu,cpuacct,memory,net_cls,freezer,blkio
OPENSHIFT_CLOUD_DOMAIN=rhcloud.com
OPENSHIFT_DATA_DIR=/var/lib/openshift/[ openshift id 2 0000c0 ]/app-root/data/
OPENSHIFT_DEFAULT_SSL_CRT_CHAIN_PATH=/etc/pki/tls/certs/rhcloud.com-chain.crt
OPENSHIFT_DEFAULT_SSL_CRT_PATH=/etc/pki/tls/certs/rhcloud.com.crt
OPENSHIFT_DEFAULT_SSL_KEY_PATH=/etc/pki/tls/private/rhcloud.com.key
OPENSHIFT_DEPENDENCIES_DIR=/var/lib/openshift/[ openshift id 2 0000c0 ]/app-root/runtime/dependencies/
OPENSHIFT_DEPLOYMENTS_DIR=/var/lib/openshift/[ openshift id 2 0000c0 ]/app-deployments/
OPENSHIFT_DEPLOYMENT_BRANCH=master
OPENSHIFT_DEPLOYMENT_TYPE=git
OPENSHIFT_FRONTEND_HTTP_PLUGINS=openshift-origin-frontend-apache-vhost,openshift-origin-frontend-nodejs-websocket,openshift-origin-frontend-haproxy-sni-proxy
OPENSHIFT_GEAR_DNS=myapp-gqcloud.rhcloud.com
OPENSHIFT_GEAR_MEMORY_MB=512
OPENSHIFT_GEAR_NAME=myapp
OPENSHIFT_GEAR_UUID=[ openshift id 2 0000c0 ]
OPENSHIFT_HAPROXY_DIR=/var/lib/openshift/[ openshift id 2 0000c0 ]/haproxy/
OPENSHIFT_HAPROXY_IDENT=redhat:haproxy:1.4:0.0.24
OPENSHIFT_HAPROXY_IP=127.8.234.130
OPENSHIFT_HAPROXY_LOG_DIR=/var/lib/openshift/[ openshift id 2 0000c0 ]/app-root/logs/
OPENSHIFT_HAPROXY_PATH_ELEMENT=/var/lib/openshift/[ openshift id 2 0000c0 ]/haproxy/usr/bin
OPENSHIFT_HAPROXY_PORT=8080
OPENSHIFT_HAPROXY_PROXY_GEAR_TTL=3
OPENSHIFT_HAPROXY_PROXY_PORT=55857
OPENSHIFT_HAPROXY_STATUS_IP=127.8.234.131
OPENSHIFT_HAPROXY_STATUS_PORT=8080
OPENSHIFT_HAPROXY_VERSION=1.4
OPENSHIFT_HOMEDIR=/var/lib/openshift/[ openshift id 2 0000c0 ]/
OPENSHIFT_HTTP_CONF_DIR=/etc/httpd/conf.d/openshift
OPENSHIFT_KEEP_DEPLOYMENTS=1
OPENSHIFT_LOGIN=myemail address
OPENSHIFT_LOG_DIR=/var/lib/openshift/[ openshift id 2 0000c0 ]/app-root/logs/
OPENSHIFT_MYSQL_DB_HOST=570bbc292d5271675a000261-gqcloud.rhcloud.com
OPENSHIFT_MYSQL_DB_PORT=42881
OPENSHIFT_NAMESPACE=gqcloud
OPENSHIFT_NGINX_DIR=/var/lib/openshift/[ openshift id 2 0000c0 ]/nginx/
OPENSHIFT_NGINX_IDENT=boekkooi:nginx:1.9.12:0.0.3
OPENSHIFT_NGINX_IP=127.8.234.129
OPENSHIFT_NGINX_PID=/var/lib/openshift/[ openshift id 2 0000c0 ]/nginx//run/nginx.pid
OPENSHIFT_NGINX_PORT=8080
OPENSHIFT_NGINX_PROXY_PORT=55856
OPENSHIFT_NGINX_VERSION=1.9.12
OPENSHIFT_NGINX_VERSION_DIR=/var/lib/openshift/[ openshift id 2 0000c0 ]/nginx//usr/nginx-1.9.12
OPENSHIFT_NODE_PLUGINS=
OPENSHIFT_PHP_DIR=/var/lib/openshift/[ openshift id 2 0000c0 ]/php/
OPENSHIFT_PHP_EXTENSION_DIR=/var/lib/openshift/[ openshift id 2 0000c0 ]/php//ext
OPENSHIFT_PHP_IDENT=boekkooi:php:5.6.16:0.0.2
OPENSHIFT_PHP_LD_LIBRARY_PATH_ELEMENT=/var/lib/openshift/[ openshift id 2 0000c0 ]/php//usr/shared/libs/lib
OPENSHIFT_PHP_LIBS_DIR=/var/lib/openshift/[ openshift id 2 0000c0 ]/php//usr/shared/libs
OPENSHIFT_PHP_PATH_ELEMENT=/var/lib/openshift/[ openshift id 2 0000c0 ]/php//usr/php-5.6.16/bin:/var/lib/openshift/[ openshift id 2 0000c0 ]/php//composer/bin
OPENSHIFT_PHP_SOCKET=/var/lib/openshift/[ openshift id 2 0000c0 ]/php//socket/php-[ openshift id 2 0000c0 ].socket
OPENSHIFT_PHP_VERSION=5.6.16
OPENSHIFT_PHP_VERSION_DIR=/var/lib/openshift/[ openshift id 2 0000c0 ]/php//usr/php-5.6.16
OPENSHIFT_PRIMARY_CARTRIDGE_DIR=/var/lib/openshift/[ openshift id 2 0000c0 ]/nginx/
OPENSHIFT_PYPI_MIRROR_URL=http://mirror1.ops.rhcloud.com/mirror/python/web/simple
OPENSHIFT_REPO_DIR=/var/lib/openshift/[ openshift id 2 0000c0 ]/app-root/runtime/repo/
OPENSHIFT_RHCSH_IDLE_TIMEOUT=300
OPENSHIFT_SECRET_TOKEN=secret 
OPENSHIFT_TMP_DIR=/tmp/
OPENSHIFT_UMASK=077
OPTERR=1
OPTIND=1
OSTYPE=linux-gnu
PATH=/var/lib/openshift/[ openshift id 2 0000c0 ]/php//usr/php-5.6.16/bin:/var/lib/openshift/[ openshift id 2 0000c0 ]/php//composer/bin:/var/lib/openshift/[ openshift id 2 0000c0 ]/haproxy/usr/bin:/bin:/usr/bin:/usr/sbin
PHPRC=/var/lib/openshift/[ openshift id 2 0000c0 ]/php//conf/php.ini
PHP_INI_SCAN_DIR=/var/lib/openshift/[ openshift id 2 0000c0 ]/php//conf/ext/
PIPESTATUS=([0]="1")
PLATFORM_LOG_CONTEXT_ATTRS=request_id,app_uuid
PLATFORM_LOG_CONTEXT_ENABLED=1
PLATFORM_LOG_FILE=/var/log/openshift/node/platform.log
PLATFORM_LOG_LEVEL=INFO
PLATFORM_SYSLOG_THRESHOLD=LOG_DEBUG
PLATFORM_SYSLOG_TRACE_ENABLED=1
PLATFORM_TRACE_LOG_FILE=/var/log/openshift/node/platform-trace.log
PLATFORM_TRACE_LOG_LEVEL=DEBUG
PPID=512436
PROMPT=yes
PROXY_MIN_PORT_NUM=35531
PROXY_PORTS_PER_GEAR=5
PS1='[myapp-gqcloud.rhcloud.com \W]\> '
PS2='> '
PS4='+ '
PUBLIC_HOSTNAME=ex-std-node571.prod.rhcloud.com
PUBLIC_IP=54.165.202.9
PWD=/var/lib/openshift/[ openshift id 2 0000c0 ]
REPORT_BUILD_ANALYTICS=true
RES_COL=60
SELINUX_LEVEL_REQUESTED=
SELINUX_ROLE_REQUESTED=
SELINUX_USE_CURRENT_RANGE=
SETCOLOR_FAILURE='echo -en \033[0;31m'
SETCOLOR_NORMAL='echo -en \033[0;39m'
SETCOLOR_SUCCESS='echo -en \033[0;32m'
SETCOLOR_WARNING='echo -en \033[0;33m'
SHELL=/bin/bash
SHELLOPTS=braceexpand:emacs:hashall:histexpand:history:interactive-comments:monitor
SHLVL=1
SINGLE=/sbin/sushell
SSH_CLIENT='86.178.88.39 32606 22'
SSH_CONNECTION='86.178.88.39 32606 172.16.1.212 22'
SSH_TTY=/dev/pts/0
TERM=xterm
TEXTDOMAIN=initscripts
TMOUT=300
TMP=/tmp/
TMPDIR=/tmp/
TMP_DIR=/tmp/
TRAFFIC_CONTROL_DEVS='eth0 lo'
UID=4565
USER=[ openshift id 2 0000c0 ]
WATCHMAN_CGROUPS_LOG_FILE=/var/log/openshift/node/cgroups.log
WATCHMAN_CGROUPS_LOG_LEVEL=INFO
WATCHMAN_CGROUPS_TRACE_LOG_FILE=/var/log/openshift/node/cgroups-trace.log
WATCHMAN_CGROUPS_TRACE_LOG_LEVEL=ERROR

Error activating gear: CLIENT_ERROR: Failed to execute action hook 'deploy'

Created scalable app using "boekkooi NGINX cartridge", added "boekkooi PHP cartridge" and "mysql-5.5 cartridge". When trying to deploy https://github.com/openshift/wordpress-example I get Deployment completed with status: failure with above mentioned error. Increasing timeout "rhc app restart --timeout 120" did not help and "rhc tail " does not have anything in logs that I can relate to this error.

$ git push
Counting objects: 4432, done.
Delta compression using up to 2 threads.
Compressing objects: 100% (2568/2568), done.
Writing objects: 100% (4430/4430), 13.13 MiB | 77.00 KiB/s, done.
Total 4430 (delta 1779), reused 4418 (delta 1773)
remote: Nginx instance is stopped
remote: Syncing git content to other proxy gears
remote: Building git ref 'master', commit 6350f2a
remote: Preparing build for deployment
remote: Deployment id is 302453b6
remote: Activating deployment
remote: [30-Mar-2015 15:44:15] NOTICE: [pool www] 'user' directive is ignored wh
en FPM is not running as root
remote: [30-Mar-2015 15:44:15] NOTICE: [pool www] 'group' directive is ignored w
hen FPM is not running as root
remote: HAProxy already running
remote: HAProxy instance is started
remote: Copying WordPress plugins from .openshift/plugins
remote: Copying WordPress themes from .openshift/themes
remote: Copying WordPress languages from .openshift/languages
remote:
remote: Could not find mysql database. Please run:
remote: rhc cartridge add -a -c mysql-5.1
remote: then make a sample commit (add whitespace somewhere) and re-push
remote:
remote: -------------------------
remote: Git Post-Receive Result: failure
remote: Activation status: failure
remote: Activation failed for the following gears:
remote: XXXX9a195973caa4ad00xxxx (Error activating gear: CLIENT_ERROR: Failed to
execute action hook 'deploy' for XXXX9a195973caa4ad00xxxx application
remote: #IO:0x0000000198f390
remote: #IO:0x0000000198f318
remote: )
remote: Deployment completed with status: failure
remote: postreceive failed
To ssh://[email protected]/~/git/.git/
9b2b78f..6350f2a master -> master

Ali@DELL-C521 ~/ (master)
$ rhc tail
DL is deprecated, please use Fiddle
==> app-root/logs/haproxy.log <==
[WARNING] 088/145222 (134964) : Stopping proxy express in 0 ms.
[WARNING] 088/145222 (134964) : Proxy stats stopped (FE: 1 conns, BE: 0 conns).
[WARNING] 088/145222 (134964) : Proxy express stopped (FE: 1 conns, BE: 1 conns)
.
[WARNING] 088/145222 (138205) : config : log format ignored for proxy 'stats' si
nce it has no log address.
[WARNING] 088/145222 (138205) : config : log format ignored for proxy 'express'
since it has no log address.
[WARNING] 088/152631 (138205) : Server express/local-gear is DOWN for maintenanc
e.
[ALERT] 088/152631 (138205) : proxy 'express' has no server available!
[WARNING] 088/152644 (138205) : Server express/local-gear is UP (leaving mainten
ance).
[WARNING] 088/154337 (138205) : Server express/local-gear is DOWN for maintenanc
e.
[ALERT] 088/154337 (138205) : proxy 'express' has no server available!

==> app-root/logs/nginx_error.log <==
2015/03/30 15:16:47 [error] 137377#0: *735 open() "/var/lib/openshift/55199a1959
73caa4ad00010b/app-root/runtime/repo//public/favicon.ico" failed (2: No such fil
e or directory), client: 127.5.205.129, server: , request: "GET /favicon.ico HTT
P/1.1", host: "-domain.rhcloud.com"

==> app-root/logs/nginx_access.log <==
127.5.205.129 - - [30/Mar/2015:15:43:18 -0400] 200 "GET / HTTP/1.0" 41217 "-" "
-" "-"
127.5.205.129 - - [30/Mar/2015:15:43:20 -0400] 200 "GET / HTTP/1.0" 41217 "-" "
-" "-"
127.5.205.129 - - [30/Mar/2015:15:43:22 -0400] 200 "GET / HTTP/1.0" 41217 "-" "
-" "-"
127.5.205.129 - - [30/Mar/2015:15:43:24 -0400] 200 "GET / HTTP/1.0" 41217 "-" "
-" "-"
127.5.205.129 - - [30/Mar/2015:15:43:26 -0400] 200 "GET / HTTP/1.0" 41217 "-" "
-" "-"
127.5.205.129 - - [30/Mar/2015:15:43:28 -0400] 200 "GET / HTTP/1.0" 41217 "-" "
-" "-"
127.5.205.129 - - [30/Mar/2015:15:43:30 -0400] 200 "GET / HTTP/1.0" 41217 "-" "
-" "-"
127.5.205.129 - - [30/Mar/2015:15:43:32 -0400] 200 "GET / HTTP/1.0" 41217 "-" "
-" "-"
127.5.205.129 - - [30/Mar/2015:15:43:34 -0400] 200 "GET / HTTP/1.0" 41217 "-" "
-" "-"
127.5.205.129 - - [30/Mar/2015:15:43:36 -0400] 200 "GET / HTTP/1.0" 41217 "-" "
-" "-"

==> app-root/logs/haproxy_ctld.log <==
I, [2015-03-30T14:52:25.637637 #134978] INFO -- : Starting haproxy_ctld

==> app-root/logs/php-fpm-error.log <==
[30-Mar-2015 15:26:38] NOTICE: [pool www] 'user' directive is ignored when FPM i
s not running as root
[30-Mar-2015 15:26:38] NOTICE: [pool www] 'group' directive is ignored when FPM
is not running as root
[30-Mar-2015 15:26:38] NOTICE: fpm is running, pid 180994
[30-Mar-2015 15:26:38] NOTICE: ready to handle connections
[30-Mar-2015 15:43:38] NOTICE: Terminating ...
[30-Mar-2015 15:43:38] NOTICE: exiting, bye-bye!
[30-Mar-2015 15:44:15] NOTICE: [pool www] 'user' directive is ignored when FPM i
s not running as root
[30-Mar-2015 15:44:15] NOTICE: [pool www] 'group' directive is ignored when FPM
is not running as root
[30-Mar-2015 15:44:15] NOTICE: fpm is running, pid 204457
[30-Mar-2015 15:44:15] NOTICE: ready to handle connections

==> nginx/logs/error.log <==
2015/03/30 15:26:32 [notice] 180851#0: signal process started
2015/03/30 15:43:39 [notice] 203567#0: signal process started

Dynamic scaled gears php-fpm issue.

I am facing another strange issue.

Seems like php-fpm is not picking up changes from:
.openshift\fpm\php-fpm.conf.erb

But only for the dynamically created gears. For local gear its working fine.
New dynamic gear starts with default setting of php-fpm which is:

pm.max_children = 5

But I had it set pm.max_children = 15.

To fix this I have to SSH into that specific gear. Restart that dynamic gear with ctl_all restart

As soon as gear restarts it picks up the my new setting defined in:
.openshift\fpm\php-fpm.conf.erb

I have tried it both build and deploy files in .openshift\action_hooks
With the following contents:

#!/bin/bash
set -e

# Build PHP extra's
# Update conf/ini filesand install pecl extensions

echo Building PHP Extra
${OPENSHIFT_PHP_DIR}/bin/control build

Hope i am able to explain the issue I am facing.

Thanks for setting up this cartridge, Its so easy to work with.

nginx_http.conf is over written after stop/restart with rhc app-xxx -a xxxx

Not sure if this is cartridge problem or OpenShift problem.

When using rhc app-stop -a xxxxx and restarting with app-start -a xxxxx. The config file nginx/conf/nginx_http.conf is over written by the default conf file. Stopping the app with rhc app-stop -a xxxx and restarting the app from the web console does not cause the over write. It only happens when rhc app-start -a xxxx is used.

Openshift deployment failure

I am trying to deploy exisitng ruby on rails app(sqlite3) to Openshift followin

http://www.arubystory.com/2013/12/tutorial-todo-rails-openshift.html

How ever after getting to the point of deployment, I am getting the below error,
remote: = 1.8.7 : gem install rdoc-data; rdoc-data --install
remote: = 1.9.1 : gem install rdoc-data; rdoc-data --install
remote: >= 1.9.2 : nothing to do! Yay!
remote: Preparing build for deployment
remote: Deployment id is bf35ba79
remote: Activating deployment
remote: rake aborted!
remote: Gem::LoadError: Specified 'sqlite3' for database adapter, but the gem is not loaded. Add gem 'sqlite3' to your Gemfile (and ensure its version is at the minimum required by ActiveRecord).
remote: /var/lib/openshift/5677033589f5cfe207000097/app-root/runtime/repo/vendor/bundle/ruby/gems/activerecord-4.1.8/lib/active_record/connection_adapters/connection_specification.rb:190:in rescue in spec' remote: /var/lib/openshift/5677033589f5cfe207000097/app-root/runtime/repo/vendor/bundle/ruby/gems/activerecord-4.1.8/lib/active_record/connection_adapters/connection_specification.rb:187:inspec'
remote: /var/lib/openshift/5677033589f5cfe207000097/app-root/runtime/repo/vendor/bundle/ruby/gems/activerecord-4.1.8/lib/active_record/connection_handling.rb:50:in establish_connection' remote: /var/lib/openshift/5677033589f5cfe207000097/app-root/runtime/repo/vendor/bundle/ruby/gems/activerecord-4.1.8/lib/active_record/railtie.rb:129:inblock (2 levels) in class:Railtie'
remote: /var/lib/openshift/5677033589f5cfe207000097/app-root/runtime/repo/vendor/bundle/ruby/gems/activesupport-4.1.8/lib/active_support/lazy_load_hooks.rb:38:in instance_eval' remote: /var/lib/openshift/5677033589f5cfe207000097/app-root/runtime/repo/vendor/bundle/ruby/gems/activesupport-4.1.8/lib/active_support/lazy_load_hooks.rb:38:inexecute_hook'
remote: /var/lib/openshift/5677033589f5cfe207000097/app-root/runtime/repo/vendor/bundle/ruby/gems/activesupport-4.1.8/lib/active_support/lazy_load_hooks.rb:28:in block in on_load' remote: /var/lib/openshift/5677033589f5cfe207000097/app-root/runtime/repo/vendor/bundle/ruby/gems/activesupport-4.1.8/lib/active_support/lazy_load_hooks.rb:27:ineach'
remote: /var/lib/openshift/5677033589f5cfe207000097/app-root/runtime/repo/vendor/bundle/ruby/gems/activesupport-4.1.8/lib/active_support/lazy_load_hooks.rb:27:in on_load' remote: /var/lib/openshift/5677033589f5cfe207000097/app-root/runtime/repo/vendor/bundle/ruby/gems/activerecord-4.1.8/lib/active_record/railtie.rb:118:inblock in class:Railtie'
remote: /var/lib/openshift/5677033589f5cfe207000097/app-root/runtime/repo/vendor/bundle/ruby/gems/railties-4.1.8/lib/rails/initializable.rb:30:in instance_exec' remote: /var/lib/openshift/5677033589f5cfe207000097/app-root/runtime/repo/vendor/bundle/ruby/gems/railties-4.1.8/lib/rails/initializable.rb:30:inrun'
remote: /var/lib/openshift/5677033589f5cfe207000097/app-root/runtime/repo/vendor/bundle/ruby/gems/railties-4.1.8/lib/rails/initializable.rb:55:in block in run_initializers' remote: /var/lib/openshift/5677033589f5cfe207000097/app-root/runtime/repo/vendor/bundle/ruby/gems/railties-4.1.8/lib/rails/initializable.rb:54:inrun_initializers'
remote: /var/lib/openshift/5677033589f5cfe207000097/app-root/runtime/repo/vendor/bundle/ruby/gems/railties-4.1.8/lib/rails/application.rb:300:in initialize!' remote: /var/lib/openshift/5677033589f5cfe207000097/app-root/runtime/repo/config/environment.rb:5:in<top (required)>'
remote: /var/lib/openshift/5677033589f5cfe207000097/app-root/runtime/repo/vendor/bundle/ruby/gems/activesupport-4.1.8/lib/active_support/dependencies.rb:247:in require' remote: /var/lib/openshift/5677033589f5cfe207000097/app-root/runtime/repo/vendor/bundle/ruby/gems/activesupport-4.1.8/lib/active_support/dependencies.rb:247:inblock in require'
remote: /var/lib/openshift/5677033589f5cfe207000097/app-root/runtime/repo/vendor/bundle/ruby/gems/activesupport-4.1.8/lib/active_support/dependencies.rb:232:in load_dependency' remote: /var/lib/openshift/5677033589f5cfe207000097/app-root/runtime/repo/vendor/bundle/ruby/gems/activesupport-4.1.8/lib/active_support/dependencies.rb:247:inrequire'
remote: /var/lib/openshift/5677033589f5cfe207000097/app-root/runtime/repo/vendor/bundle/ruby/gems/railties-4.1.8/lib/rails/application.rb:276:in require_environment!' remote: /var/lib/openshift/5677033589f5cfe207000097/app-root/runtime/repo/vendor/bundle/ruby/gems/railties-4.1.8/lib/rails/application.rb:389:inblock in run_tasks_blocks'
remote: /var/lib/openshift/5677033589f5cfe207000097/app-root/runtime/repo/vendor/bundle/ruby/gems/sprockets-rails-2.3.3/lib/sprockets/rails/task.rb:64:in `block (2 levels) in define'
remote: Tasks: TOP => environment
remote: (See full trace by running task with --trace)
remote: -------------------------
remote: Git Post-Receive Result: failure
remote: Activation status: failure
remote: Activation failed for the following gears:
remote: 5677033589f5cfe207000097 (Error activating gear: CLIENT_ERROR: Failed to execute: 'control deploy' for /var/lib/openshift/5677033589f5cfe207000097/ruby
remote: #IO:0x00000001981380
remote: #IO:0x00000001981308
remote: )
remote: Deployment completed with status: failure
remote: postreceive failed
To ssh://[email protected]/~/git/efss.git/
dde82df..a01404c master -> master

I validated my gem file it has sqlite3 mentioned and application in openshift still shows as deploying status. i try to stop the server and restart but it shows service unavailable.
even if I ignore and go to ssh in to app it shows the same error.

can someone please help

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.