Mostrando entradas con la etiqueta nginx. Mostrar todas las entradas
Mostrando entradas con la etiqueta nginx. Mostrar todas las entradas

jueves, 30 de abril de 2020

[EN] DevOps roadmap

Hello!

Today I come with a roadmap that someone sent me a few days ago. It is a roadmap of what (according to how it is understood by who has drew it) a DevOps should know.



You can more or less agree with what is in it, but it has helped me to get to know some new technologies that could be very interesting to me.

What about you? What do you think? One thing amazing is that you can suggest your changes, but I am not sure they would take them into account. Anyway, I have at least two suggestions, that are
  • HOW COME Debian is not in purple???
  • I know there is no Load Balancing section but they should include it somehow


Source: roadmap.sh
You have a few more interesting roadmaps in that page

viernes, 1 de septiembre de 2017

Compilar y configurar PHP-FPM 5.6.30 para que escuche en un puerto sobre Debian 8

Aprovecho que he tenido que compilar de nuevo PHP para poder utilizarlo con nGinx, y os dejo mi receta


> mkdir /opt/source
> mkdir -p /opt/php-5.6
> cd /opt/source # Bajo y descomprimo el código fuente en este directorio
> get http://es1.php.net/get/php-5.6.30.tar.gz
> tar -xzvf php-5.6.30.tar.gz
> apt-get install build-essential
> apt-get install libcurl4-openssl-dev pkg-config
> apt-get install libbz2-dev
> apt-get install libjpeg62 libjpeg62-dev
> apt-get install libpng12-dev
> apt-get install libfreetype6-dev
> apt-get update && apt-get install -y libc-client-dev libkrb5-dev
> mkdir /usr/lib64/
> ln -s /usr/lib/libc-client.a /usr/lib64/libc-client.a
> apt-get install make
> cd php-5.6.30
> ./configure \
--prefix=/opt/php-5.6 \
--with-zlib-dir \
--with-freetype-dir \
--enable-mbstring \
--with-libxml-dir=/usr \
--enable-soap \
--enable-calendar \
--with-curl \
--with-mcrypt \
--with-zlib \
--with-gd \
--disable-rpath \
--enable-inline-optimization \
--with-bz2 \
--with-zlib \
--enable-sockets \
--enable-sysvsem \
--enable-sysvshm \
--enable-pcntl \
--enable-mbregex \
--with-mhash \
--enable-zip \
--with-pcre-regex \
--with-mysql \
--with-pdo-mysql \
--with-mysqli \
--with-png-dir=/usr \
--enable-gd-native-ttf \
--with-openssl \
--with-libdir=lib64 \
--enable-ftp \
--with-imap \
--with-imap-ssl \
--with-kerberos \
--with-gettext \
--with-gd \
--with-jpeg-dir=/usr/lib/ \
--enable-fpm \
--with-fpm-user=www-data \
--with-fpm-group=www-data \
--enable-intl \
--with-xsl \
--with-pear
> make
> make install

# Configuro PHP-fpm

> cp /opt/php-5.6/etc/php-fpm.conf.default /opt/php-5.6/etc/php-fpm.conf
> cp /opt/source/php-5.6.30/php.ini-production /opt/php-5.6/lib/php.ini
> vi /opt/php-5.6/etc/php-fpm.conf
[...]
pid = run/php-fpm.pid
[...]
user = www-data
group = www-data
[...]
listen = 127.0.0.1:9001
[...]
#include=/opt/php-5.6/etc/pool.d/*.conf
[...]
[www-PHP56]
> cp /opt/source/php-5.6.30/sapi/fpm/init.d.php-fpm /etc/init.d/php5.6-fpm
> chmod 755 /etc/init.d/php5.6-fpm
> /etc/init.d/php5.6-fpm start

Solo faltaría configurar nGinx para que envíe las peticiones PHP a este puerto. También se podría configurar por socket.

jueves, 31 de mayo de 2012

Error "Too many open files" en nGinx

Cuando en los logs del nGinx tenemos el error

Too many open files

significa que hay demasiadas peticiones y que el nGinx no las puede gestionar.

Para solucionarlo de manera puntual (una vez pasada la punta es recomendable volver al estado normal, o al menos ajustarlo a las características del servidor, en caso de que sea necesario dejarlo porque haya aumentado la carga del servidor), añadimos:

ulimit -n 65535

en la siguiente línea después del '#! /bin/sh' en el

/etc/init.d/nginx

Después, editamos el

/etc/nginx/nginx.conf

y modificamos la línea

worker_connections  1024;

y modificamos el valor a

20480

y añadimos la entrada

worker_rlimit_nofile 20480;

justo debajo del parámetro 'worker_processes'

Reiniciamos el nGinx y durante un rato es recomendable monitorizar el servidor y controlar los parámetros básico de sistema para comprobar que estas modificaciones no tiran el servidor. En caso de que el servidor se hunda, habrá que ir bajando el número de conexiones en el

/etc/nginx/nginx.conf

Ambos parámetros modicados (worker_rlimit_nofile y worker_connections) deben ser iguales.