JINX LNMP high performance platform

JINX - a black magic to have your web server rock,
no obese apaches inside.

includes:
1) nginx (stable release) by Igor Sysoev
2) php 5.3 with FPM-CGI (with suhosin patch and extension, 3 opcode caches to choose from: apc, eaccelerator and xcache)
3) compat libraries, to eliminate the need of installing dependencies for php
-----------------------------------------------------------------

Hardware requirements: an x86 processor with SSE2 ,
an older CPU is not supported by compiling runtime,
however you can compile yourself and run same software
on any computer with >32 Mb RAM

Software requirements: Linux x86 with kernel 2.6.8 and greater,
2.6.18+ recommended. Glibc 2.7+ ( 2.11.2 was used at compile time)
System libpam.so.0 recommended over those which is included in jinx-libs,
use it as stub only (i.e. on slackware, where is no native libpam)

Installation:

unpack n-jinx, base and libs into /usr/local:

cd /usr/local
tar -xvf /path/to/n-jinx-$VERSION.tgz
tar -xvf /path/to/jinx-sbase_$DATE.tgz
tar -xvf /path/to/jinx-libs_$DATE.tgz

if upgrading - unpack somewhere else and replace bin/ lib/ and include/ directories

configuration:
look in /usr/local/jinx/etc

1) nginx.conf - this is a config for web server
documentation at Nginx Wiki
pay attention to:

user USER GROUP;
- set to uid and gid you want static webserver to use

If you have any nasty problem with eventfd - add
use poll;
to events { } section, another possible values - epoll select

this minimal config will do: (document root is in /var/www/localhost/htdocs)
( please note - this is a bad example, you should use try_files with fastcgi_pass,
to make sure that script does really exists, otherwise its a security risk , see more about it )


user httpd httpd; # uid gid
worker_processes 1; # use as many as many cpu cores you have
worker_priority 1; # process prio, from -20 (highest) to 20 (lowest)
working_directory /usr/local/jinx/html; # error pages html are here
events { worker_connections 1000 ; use epoll; } # max connections, eventfd
http {
include mime.types;
default_type application/octet-stream;
log_format '$remote_addr - $remote_user [$time_local] '
'"$request" $status $bytes_sent '
'"$http_referer" "$http_user_agent"';
access_log logs/access.log;
sendfile on;
tcp_nopush on;
tcp_nodelay on;
server {
listen 80;
#server_name localhost;
charset utf-8;
location ~ /\.ht { deny all; } # safeguard apache-only files
# execute PHP
location ~ \.php$ {
root /var/www/localhost/htdocs;
fastcgi_pass unix:/tmp/fastcgi.socket; # must match path in php-fpm.ini
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME /var/www/localhost/htdocs$fastcgi_script_name;
include fastcgi_params;}
# root
location / { root /var/www/localhost/htdocs; index index.php index.html; }
} # server
} # http

2) Configure PHP, look inside /usr/local/jinx/etc/fpm
Revise php.ini , nothing special to pay attention here comparing to apache-case
edit php-fpm.conf , syntax is pretty self explaining

or this one example will do:

[global]
pid = run/php-fpm.pid
error_log = log/php-fpm.log
;log_level = notice
;emergency_restart_threshold = 0
;emergency_restart_interval = 0
;process_control_timeout = 0
daemonize = yes
[www-data]
; listen on tcp
;listen = 127.0.0.1:9119
;listen.allowed_clients = 127.0.0.1
; or use unix socket
listen = /tmp/fastcgi.socket
; socket owner (nginx user!)
listen.owner = httpd
listen.group = httpd
listen.mode = 0600
; this is uid and gid that PHP scripts runs from
user = www-data
group = www-data
; this is minimal config
pm = dynamic
pm.max_children = 2
pm.start_servers = 1
pm.min_spare_servers = 1
pm.max_spare_servers = 1
pm.max_requests = 32
;chroot =
chdir = /var/empty

Thats all, run nginx and php-fpm as root (binaries are in /usr/local/nginx/bin )
if your config is correct - it will work, else look in logs
To autostart use your init scripts ( may be /etc/rc.local will do )

If you'll like to use lighttpd instead of nginx, you can get lity package as n-jinx replacement.
And if you need MySQL(equiv) - you can use MariaDB package.

THIS IS A PROOF OF CONCEPT PACKAGES, ALL NAMES AND TRADEMARKS ARE PROPERTY OF THEIR RESPECTIVE OWNERS
ALL SOFTWARE ARE COPYRIGHT ( OR COPYLEFT ) BY THEIR AUTHORS, IT IS FREE SOFTWARE AND CAN BE DISTRIBUTED
IN SOURCE AND BINARY FORMS FREE OF CHARGE, FOR LICENSING TERMS PLEASE VISIT RESPECTIVE SITES.
THIS PACKAGE DOES NOT CONTAIN ANY DOCS, MANPAGES OR OTHER NOTICES, HOWEVER YOU CAN FIND ANYTHING
ON THE NET. ENJOY. THERE IS NO WARRANTY FOR ANYTHING.

I'd like to get some feedback, but if you seriously want something to be done - please do that youself
or find someone who will do, thank you.

(*) LNMP is abbreviation for Linux Nginx MySQL(equiv) PHP, just like LAMP

Lulu

AttachmentSize
jinx-sbase_110228.tgz5.48 MB
n-jinx-0.8.54.tgz246.57 KB
lity-1.4.28.tgz259.37 KB
jinx-libs_110310.tgz5.28 MB
mariadb-5.2.5-inity.tar_.lzma4.9 MB
config-example-fastndirty.tgz2.26 KB