Deploying balanced Nginx web server with       minimal system resources     National Technical University of Ukraine Kyiv ...
Problem statement• Using information technologies for communication  between students and teachers, help with remote  educ...
Compile with minimum modules
<Insert Picture Here>                    THINK about what modules you are needed!Don’t use: mail, mail_ssl_module, http_pe...
KISS concept in /etc/nginx/nginx.confuser www-data;worker_processes 1; # = cpus quantity.worker_rlimit_nofile 65535; # Max...
KISS concept in /etc/nginx/nginx.conf                (part 2)http {       sendfile on; # Enable sendfile(). Makessphinx us...
<Insert Picture Here>   Virtual Host configuringserver {         listen   80;         server_name _;         access_log /v...
PHP• Install php5-cgi php5-cli spawn-fcgi modules• vim /usr/local/bin/php-fastcgi       /usr/bin/spawn-fcgi -s /home/examp...
PHP + Nginxvim etc/nginx/php_host_paramsaccess_log /var/log/nginx/$user.access.log;root /home/$user/web/e/$host;index inde...
Troubles with pictures and not           standart file extensions• types {  •   application/xml xml;  •   image/gif gif;  ...
Conclusions• Creating fast and productive web-server  system, will help students and teacher in  PRODUCTIVE work with web-...
<Insert Picture Here>Contactsmax.ukhanov@gmail.com@ukhanoffhttp://ua.linkedin.com/in/ukhanoff
Deploying nginx with minimal system resources
Upcoming SlideShare
Loading in …5
×

Deploying nginx with minimal system resources

3,392 views

Published on

Published in: Sports
0 Comments
2 Likes
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total views
3,392
On SlideShare
0
From Embeds
0
Number of Embeds
8
Actions
Shares
0
Downloads
17
Comments
0
Likes
2
Embeds 0
No embeds

No notes for slide

Deploying nginx with minimal system resources

  1. 1. Deploying balanced Nginx web server with minimal system resources National Technical University of Ukraine Kyiv Polytechnic Institute Faculty of Informatics and Computer Technology Department of Automated Production Management Systems Max Ukhanov Scientific Advisor Ph.D. Sciences, associate professor Tetyana Kovalyuk
  2. 2. Problem statement• Using information technologies for communication between students and teachers, help with remote education system. One of variants of this system it’s Web Portal. Web Portal could be hosted on some Web-server. And this server should be fast and economical.• So what is the solution? Web-server Nginx!
  3. 3. Compile with minimum modules
  4. 4. <Insert Picture Here> THINK about what modules you are needed!Don’t use: mail, mail_ssl_module, http_perl_module,http_flv_module, http_dav_moduleUse: http_gzip_static_module, http_stub_status_module
  5. 5. KISS concept in /etc/nginx/nginx.confuser www-data;worker_processes 1; # = cpus quantity.worker_rlimit_nofile 65535; # Maximum file descriptorthatcan be opened by worker.timer_resolution 100ms; # The directive allows to decreasenumber gettimeofday() syscalls.events { worker_connections 65535; # worker_processes *worker_connections = maxclients use epoll; #the effective method, used on Linux 2.6+ }
  6. 6. KISS concept in /etc/nginx/nginx.conf (part 2)http { sendfile on; # Enable sendfile(). Makessphinx use less memory. tcp_nopush on; tcp_nodelay on; # it’s on by default. keepalive_timeout 65; # default is 75. types_hash_max_size 2048; # it’s ok client_max_body_size 100m; include /etc/nginx/mime.types; default_type application/octet-stream; # Logging Settings access_log /var/log/nginx/access.log; error_log /var/log/nginx/error.log;
  7. 7. <Insert Picture Here> Virtual Host configuringserver { listen 80; server_name _; access_log /var/log/nginx/localhost.access.log root /usr/share/nginx/www; index index.html; } include /etc/nginx/conf.d/*.conf; include /etc/nginx/sites-enabled/*; }
  8. 8. PHP• Install php5-cgi php5-cli spawn-fcgi modules• vim /usr/local/bin/php-fastcgi /usr/bin/spawn-fcgi -s /home/example/web/php- fcgi.socket -M 0770 -u example -g example -f /usr/bin/php5-cgi• vim /etc/init.d/php-fastcgi adding PHP_SCRIPT=/usr/local/bin/php-fastcgi
  9. 9. PHP + Nginxvim etc/nginx/php_host_paramsaccess_log /var/log/nginx/$user.access.log;root /home/$user/web/e/$host;index index.php index.html;location ~ .php$ { fastcgi_pass unix:/home/$user/web/php-fcgi.socket; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; include fastcgi_params;}
  10. 10. Troubles with pictures and not standart file extensions• types { • application/xml xml; • image/gif gif; • image/jpeg jpg; • image/png png; • image/bmp bmp; • image/x-icon ico; • text/css css; • text/html html; • text/plain bob; • text/plain txt; }
  11. 11. Conclusions• Creating fast and productive web-server system, will help students and teacher in PRODUCTIVE work with web-portal and remote education systems.
  12. 12. <Insert Picture Here>Contactsmax.ukhanov@gmail.com@ukhanoffhttp://ua.linkedin.com/in/ukhanoff

×