MAX2PLAY on nginx

Tagged: 

Viewing 5 posts - 1 through 5 (of 5 total)
  • 18. Oktober 2015 at 20:58 #16422

    Is it possible to install MAX2PLAY on NGINX instead of APACHE2.

    Nginx is faster at serving static files and consumes much less memory for concurrent requests.

    Regards Silver

    20. Oktober 2015 at 16:55 #16444

    Hi L-J Silver,
    With Max2Play, the requests and workload of apache is marginal. Thus we have not yet considered using another server software. However, NGINX should work with Max2Play without any problems. We will investigate its merits and report whether or not an implementation or an option for the software would be feasible.

    20. Oktober 2015 at 18:00 #16446

    Hi Silver,

    you may test nginx by installing it with

    apt-get install php5-fpm nginx -y

    using this config file for Max2Play:

    server {
    	listen   81; ## listen for ipv4; this line is default and implied
    	#listen   [::]:80 default_server ipv6only=on; ## listen for ipv6
    
    	root /var/www/max2play/public;
    	index index.php;
    
    	location / {
            error_page  404 = /index.php?q=$uri;
            log_not_found  off;
        }
    	
    	location ~* ^.+.(jpg|jpeg|gif|css|png|js|ico|xml)$ {
            access_log off;
            expires 30d;
            root /var/www/max2play/public;
        }        
    
    	# Rewrite rule
        if (!-e $request_filename) {
            rewrite ^(.*)$ /index.php?page=$1 last;
        }
    
    	# pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
        location ~ \.php$ {
    		fastcgi_pass   unix:/var/run/php5-fpm.sock;
            fastcgi_index  index.php;
            fastcgi_param  SCRIPT_FILENAME  /var/www/max2play/public$fastcgi_script_name;
    		include fastcgi_params;
        }
    
    	# deny access to .htaccess files, if Apache's document root
    	# concurs with nginx's one
    	location ~ /\.ht {
    		deny all;
    	}
    }

    Open the web interface with http://max2play:81 – the original apache web server is still running on Port 80. We did not test this yet – there may be some problems on nginx…

    • This reply was modified 8 years, 6 months ago by flysurfer.
    21. März 2019 at 15:39 #44843

    hello gang
    can you please update config files
    php5-fpm is not available anymore
    thanks you

    27. März 2019 at 15:53 #44908

    # Stop Apache First if running
    /etc/init.d/apache2 stop
    # Install NGINX and Packages for PHP 7
    apt-get install php-fpm php-simplexml nginx -y

    # Use Upgraded NGINX Max2Play File with new PHP 7 Socket

    
    server {
    	listen   81; ## listen for ipv4; this line is default and implied
    	#listen   [::]:80 default_server ipv6only=on; ## listen for ipv6
    
    	root /var/www/max2play/public;
    	index index.php;
    
    	location / {
            error_page  404 = /index.php?q=$uri;
            log_not_found  off;
        }
    	
    	location ~* ^.+.(jpg|jpeg|gif|css|png|js|ico|xml)$ {
            access_log off;
            expires 30d;
            root /var/www/max2play/public;
        }        
    
    	# Rewrite rule
        if (!-e $request_filename) {
            rewrite ^(.*)$ /index.php?page=$1 last;
        }
    
    	# pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
        location ~ \.php$ {
    		fastcgi_pass   unix:/var/run/php/php7.0-fpm.sock;
            fastcgi_index  index.php;
            fastcgi_param  SCRIPT_FILENAME  /var/www/max2play/public$fastcgi_script_name;
    		include fastcgi_params;
        }
    
    	# deny access to .htaccess files, if Apache's document root
    	# concurs with nginx's one
    	location ~ /\.ht {
    		deny all;
    	}
    }
    

    Have Fun!

Viewing 5 posts - 1 through 5 (of 5 total)

You must be logged in to reply to this topic.

Register here