getupcloud / openshift-nginx-php-fpm

Openshift cartridge for nginx static server with php-fpm support
Other
23 stars 18 forks source link

Update nginx to latest version #13

Open ranib opened 10 years ago

ranib commented 10 years ago

I'm sorry, I know this question is asked many times and you have answered it also. You said it is very simple just You need to fork the repo, re-compile nginx from source (or extract binary from rpm) and overwrite files inside versions/shared/usr/* but I don't know how to compile. I read all the issues including Update nginx #5 in your repo and elsewhere, searched internet all day but did not find guide to update nginx version in my forked repo. Could you be kind enough to explain step by step how to do it in git?

caruccio commented 10 years ago

No problem. In fact that is a simple operation:

1 - Download nginx source and compile following nginx instruction (tip: use your openshift gear to do that) 2 - Copy new binaries into versions/shared/. 3 - Commit and push.

ranib commented 10 years ago

Thanks, but I'm completely lost here. I downloaded nginx 1.7.0 from here http://wiki.nginx.org/Install. It is a zip file in my download folder. How do I compile it? How do I use my gear to do it? I'm sorry I never did this before.

caruccio commented 10 years ago

Maybe you can compile it on your own machine.

First download your repo somewhere. We will use /tmp as the base working directory.

cd /tmp
git clone git@github.com:ranib/openshift-nginx-php-fpm.git

Download and compile nginx:

curl ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/pcre-8.35.tar.gz | tar xzvf -
curl http://nginx.org/download/nginx-1.7.0.tar.gz | tar xzvf -
cd nginx-1.7.0
./configure --with-pcre=../pcre-8.35
make

Now let's copy the binary into your nginx cartridge repo:

cp objs/nginx /tmp/openshift-nginx-php-fpm/versions/shared/usr/sbin/nginx
cd /tmp/openshift-nginx-php-fpm/
git commit -a -m 'Update nginx'
git push

Now you can create your app using you own cartridge :)

rhc app create nginx https://reflector-getupcloud.getup.io/reflect?github=ranib/openshift-nginx-php-fpm

Cheers!

ranib commented 10 years ago

Thank you, now I got this message:

$ ./configure --with-pcre=../pcre-8.35 checking for OS

./configure: error: the HTTP gzip module requires the zlib library. You can either disable the module by using --without-http_gzip_module option, or install the zlib library into the system, or build the zlib library statically from the source with nginx by using --with-zlib= option.

caruccio commented 10 years ago

You must compile it on linux. If you don't have a linux machine, create any app on openshift, run "rhc ssh " and run the second block of commands there (compilation). Download your github repo into yout local machine. Download objs/nginx into your local machine and update your local repo.

On Thu, Jun 19, 2014 at 9:27 PM, ranib notifications@github.com wrote:

Thank you, now I got this message:

$ ./configure --with-pcre=../pcre-8.35 checking for OS

  • MINGW32_NT-6.2 1.0.12(0.46/3/2) i686 checking for MINGW32_NT-6.2 specific features

./configure: error: the HTTP gzip module requires the zlib library. You can either disable the module by using --without-http_gzip_module option, or install the zlib library into the system, or build the zlib library statically from the source with nginx by using --with-zlib= option.

— Reply to this email directly or view it on GitHub https://github.com/getupcloud/openshift-nginx-php-fpm/issues/13#issuecomment-46633311 .

--- Mateus de Oliveira Caruccio --- Old programmers never die. They just branch to another namespace

ranib commented 10 years ago

Unfortunately, when I try to use my newly updated repo to create a new app, it gives me following message:

$ rhc app create phpfpm https://reflector-getupcloud.getup.io/reflect?github=ranib/openshift-nginx-php-fpm DL is deprecated, please use Fiddle The cartridge 'https://reflector-getupcloud.getup.io/reflect?github=ranib/openshift-nginx-php-fpm' will be downloaded and installed

Application Options Domain: mydomain Cartridges: https://reflector-getupcloud.getup.io/reflect?github=ranib/openshift -nginx-php-fpm Gear Size: default Scaling: no

Creating application 'phpfpm' ... Building nginx configuration Building php-fpm configuration Failed to execute: 'control start' for /var/lib/openshift/XXXb25895XXX463341000XXX/nginx-php-fpm

nginx: [emerg] unknown directive "set_real_ip_from" in /var/lib/openshift/XXXb25895XXX463341000XXX/app-root/runtime/repo//config/nginx.d/default.conf:6

ranib commented 10 years ago

I created new fork of your repo, updated nginx to 1.7.0, this time on Korora 20 desktop. Then I try to create an app and received following error: Creating application 'nginx' ... Building nginx configuration Building php-fpm configuration Failed to execute: 'control start' for /var/lib/openshift/53b081de4382ec58b60000c1/nginx-php-fpm

/var/lib/openshift/53b081de4382ec58b60000c1/nginx-php-fpm//usr/sbin/nginx: /lib64/libc.so.6: version `GLIBC_2.14' not found (required by /var/lib/openshift/53b081de4382ec58b60000c1/nginx-php-fpm//usr/sbin/nginx)

Google did not find me much help on this issue.

zhw2101024 commented 10 years ago

Any special reason why you don't compile nginx on openshift just as on your Korora 20? rhc ssh appname, replace appname to yours here. Everything you will need is prepared by openshift

caruccio commented 10 years ago

Openshift has a small timeout when creating your app. Sometimes it fails to create it since nginx takes too long to compile.