Deploying nginx with minimal system resources
Upcoming SlideShare
Loading in...5
×

Like this? Share it with your network

Share

Deploying nginx with minimal system resources

  • 2,591 views
Uploaded on

 

More in: Sports
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Be the first to comment
No Downloads

Views

Total Views
2,591
On Slideshare
2,591
From Embeds
0
Number of Embeds
0

Actions

Shares
Downloads
16
Comments
0
Likes
2

Embeds 0

No embeds

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
    No notes for slide

Transcript

  • 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. 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. Compile with minimum modules
  • 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. 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. 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. <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. 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. 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. 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. Conclusions• Creating fast and productive web-server system, will help students and teacher in PRODUCTIVE work with web-portal and remote education systems.
  • 12. <Insert Picture Here>Contactsmax.ukhanov@gmail.com@ukhanoffhttp://ua.linkedin.com/in/ukhanoff