Compiling and running the nginx web server on AIX 6.1/7.1
Using default prefix, GCC 4.7
Variables should be set or replaced by actual values :) Note that everything can be changed later.
CC=gcc CFLAGS=-O3 \./configure \--error-log-path=${logdir}/error.log \--http-log-path=${logdir}/access.log \--with-http_ssl_module \--pid-path=${pidfile} \--without-http_scgi_module \--without-http_uwsgi_module \--with-cpu-opt=ppc64Configuration summary + using system PCRE library + using system OpenSSL library + md5: using OpenSSL library + sha1: using OpenSSL library + using system zlib library nginx path prefix: "/usr/local/nginx" nginx binary file: "/usr/local/nginx/sbin/nginx" nginx configuration prefix: "/usr/local/nginx/conf" nginx configuration file: "/usr/local/nginx/conf/nginx.conf" nginx pid file: "${pidfile}" nginx error log file: "${logdir}/error.log" nginx http access log file: "${logdir}/access.log" nginx http client request body temporary files: "client_body_temp" nginx http proxy temporary files: "proxy_temp" nginx http fastcgi temporary files: "fastcgi_temp"Variables
Don't forget to replace them in your commands and config files with the selected values :D
confdir=
datadir=
datagrp=
logdir=
loguser=
pidfile=
Filesystem for www content
...or follow your preferred convention
mklv -y wwwlv -t jfs2 rootvg 2crfs -d wwwlv -m ${datadir} -Ay -v jfs2mount ${datadir}chfs -a size=1G ${datadir}Create application directory structure
...not just for web content
Data might be a separate filesystem, but config and scripts are not supposed to grow (so they may be in the same FS)
Create group and user
using nginx.nginx here
mkgroup nginx # add preferred GID with id=mkuser pgrp=ngnix home=/var/empty rlogin=false login=false su=false nginx # add preferred UID with id=Group which can modify content and adjust datadir
mkgroup ${datagrp}chgrpmem -m + <user for managing content> ${datagrp}chown -R root.wwwdata ${datadir}chmod 0770 ${datadir}Logs
mkdir ${logdir}chown nginx.nginx ${logdir}chmod 0750 ${logdir}chgrpmem -m + ${loguser} nginxCopy necessary files from the source default, /usr/local/nginx to the application FS - we are going to modify and run them there
cp /usr/local/nginx/conf/nginx.conf ${confdir}cp /usr/local/nginx/conf/fastcgi.conf ${confdir}cp /usr/local/nginx/conf/mime.types ${confdir}Modify config as necessary
vi ${confdir}/nginx.confThe following lines are pointing to parameters to be changed:
user nginx;pid ${pidfile};access_log ${logdir}/access.log;error_log ${logdir}/error.log;root ${datadir};location = /404.html { root ${datadir}/errorpages/;error_page 500 502 503 504 /50x.html;location = /50x.html { root ${datadir}/errorpages/;Testing the configuration syntax
/usr/local/nginx/sbin/nginx -t -c ${confdir}/nginx.confNote that include directives are relative to the config file's path.
Remove default configuration and log directory
rm /usr/local/nginx/conf/fastcgi.conf /usr/local/nginx/conf/fastcgi_params /usr/local/nginx/conf/mime.types /usr/local/nginx/conf/nginx.conf /usr/local/nginx/conf/scgi_params /usr/local/nginx/conf/uwsgi_paramsrm -rf /usr/local/nginx/logsManaging the server
/usr/local/nginx/sbin/nginx -s [ stop | quit | reopen | reload ]Version
/usr/local/nginx/sbin/nginx -vnginx version: nginx/1.3.7TODO :)