Warning: preg_match(): Unknown modifier '-' in /home/akl1986/public_html/support/wp-content/plugins/redux-framework/redux-core/inc/extensions/metaboxes/class-redux-extension-metaboxes.php on line 783

Warning: preg_match(): Unknown modifier '-' in /home/akl1986/public_html/support/wp-content/plugins/redux-framework/redux-core/inc/extensions/metaboxes/class-redux-extension-metaboxes.php on line 783

Warning: preg_match(): Unknown modifier '-' in /home/akl1986/public_html/support/wp-content/plugins/redux-framework/redux-core/inc/extensions/metaboxes/class-redux-extension-metaboxes.php on line 783

Warning: preg_match(): Unknown modifier '-' in /home/akl1986/public_html/support/wp-content/plugins/redux-framework/redux-core/inc/extensions/metaboxes/class-redux-extension-metaboxes.php on line 783

Warning: preg_match(): Unknown modifier '-' in /home/akl1986/public_html/support/wp-content/plugins/redux-framework/redux-core/inc/extensions/metaboxes/class-redux-extension-metaboxes.php on line 783

Warning: preg_match(): Unknown modifier '-' in /home/akl1986/public_html/support/wp-content/plugins/redux-framework/redux-core/inc/extensions/metaboxes/class-redux-extension-metaboxes.php on line 783

Warning: preg_match(): Unknown modifier '-' in /home/akl1986/public_html/support/wp-content/plugins/redux-framework/redux-core/inc/extensions/metaboxes/class-redux-extension-metaboxes.php on line 783

Warning: preg_match(): Unknown modifier '-' in /home/akl1986/public_html/support/wp-content/plugins/redux-framework/redux-core/inc/extensions/metaboxes/class-redux-extension-metaboxes.php on line 783

Warning: Cannot modify header information - headers already sent by (output started at /home/akl1986/public_html/support/wp-content/plugins/redux-framework/redux-core/inc/extensions/metaboxes/class-redux-extension-metaboxes.php:783) in /home/akl1986/public_html/support/wp-includes/rest-api/class-wp-rest-server.php on line 1794

Warning: Cannot modify header information - headers already sent by (output started at /home/akl1986/public_html/support/wp-content/plugins/redux-framework/redux-core/inc/extensions/metaboxes/class-redux-extension-metaboxes.php:783) in /home/akl1986/public_html/support/wp-includes/rest-api/class-wp-rest-server.php on line 1794

Warning: Cannot modify header information - headers already sent by (output started at /home/akl1986/public_html/support/wp-content/plugins/redux-framework/redux-core/inc/extensions/metaboxes/class-redux-extension-metaboxes.php:783) in /home/akl1986/public_html/support/wp-includes/rest-api/class-wp-rest-server.php on line 1794

Warning: Cannot modify header information - headers already sent by (output started at /home/akl1986/public_html/support/wp-content/plugins/redux-framework/redux-core/inc/extensions/metaboxes/class-redux-extension-metaboxes.php:783) in /home/akl1986/public_html/support/wp-includes/rest-api/class-wp-rest-server.php on line 1794

Warning: Cannot modify header information - headers already sent by (output started at /home/akl1986/public_html/support/wp-content/plugins/redux-framework/redux-core/inc/extensions/metaboxes/class-redux-extension-metaboxes.php:783) in /home/akl1986/public_html/support/wp-includes/rest-api/class-wp-rest-server.php on line 1794

Warning: Cannot modify header information - headers already sent by (output started at /home/akl1986/public_html/support/wp-content/plugins/redux-framework/redux-core/inc/extensions/metaboxes/class-redux-extension-metaboxes.php:783) in /home/akl1986/public_html/support/wp-includes/rest-api/class-wp-rest-server.php on line 1794

Warning: Cannot modify header information - headers already sent by (output started at /home/akl1986/public_html/support/wp-content/plugins/redux-framework/redux-core/inc/extensions/metaboxes/class-redux-extension-metaboxes.php:783) in /home/akl1986/public_html/support/wp-includes/rest-api/class-wp-rest-server.php on line 1794

Warning: Cannot modify header information - headers already sent by (output started at /home/akl1986/public_html/support/wp-content/plugins/redux-framework/redux-core/inc/extensions/metaboxes/class-redux-extension-metaboxes.php:783) in /home/akl1986/public_html/support/wp-includes/rest-api/class-wp-rest-server.php on line 1794
{"id":2590,"date":"2019-12-06T15:02:04","date_gmt":"2019-12-06T15:02:04","guid":{"rendered":"https:\/\/support.aklwebhost.com\/?post_type=manual_kb&p=2590"},"modified":"2019-12-06T18:54:38","modified_gmt":"2019-12-06T18:54:38","slug":"install-nginx-php-fpm-caching-mysql-on-ubuntu-12-04","status":"publish","type":"manual_kb","link":"https:\/\/support.aklwebhost.com\/knowledgebase\/install-nginx-php-fpm-caching-mysql-on-ubuntu-12-04\/","title":{"rendered":"Install Nginx + PHP FPM + Caching + MySQL on Ubuntu 12.04"},"content":{"rendered":"
\n
\n

Archived content<\/p><\/blockquote>\n

Ubuntu 12.04 has reached end-of-life. The steps and commands used in this guide may no longer be relevant to newer versions of Ubuntu.<\/strong><\/p>\n<\/div>\n<\/div>\n

\n

Probably a lot of people are going to use their AKLWEB HOST VPSes as webservers, a good choice would be Nginx as a webserver. In this topic I’m going to describe on how to install Nginx, PHP FPM and MySQL. Also we’re going to look at Nginx’s caching feature. In this topic we’re using Ubuntu 12.04, I do not know if this will also work on CentOS or Debian.<\/p>\n

First steps<\/strong><\/p>\n

Make sure your server is up to date:<\/p>\n

apt-get update\r\n<\/code><\/pre>\n

Install Nginx and PHP FPM<\/strong><\/p>\n

apt-get install -y nginx php5-fpm\r\n<\/code><\/pre>\n

Install MySQL<\/strong><\/p>\n

apt-get install -y php5-mysql mysql\r\n<\/code><\/pre>\n

When prompted enter a password. This is the root password which you will need to create databases and users.<\/p>\n

Now that we’re installed all the programs we need, we’ll configure our so called vhosts. A vhost is the configuration file for a domain, this means you can attach multiple domain to your server.<\/p>\n

The configuration file can be found here: https:\/\/gist.github.com\/GiovanniK\/11194798<\/p>\n

To begin we’ll remove the default vhost for nginx:<\/p>\n

rm -rf \/etc\/nginx\/sites-enabled\/default\r\n<\/code><\/pre>\n

We’ll now create a new one with the contents of the vhost I gave you.<\/p>\n

nano \/etc\/nginx\/sites-enabled\/DOMAIN\r\n<\/code><\/pre>\n

Now that we’ve created our vhost and we’ve pasted the contents we’ll have to edit some things.<\/p>\n

Below the old values:<\/p>\n

Line 1: fastcgi_cache_path \/etc\/nginx\/cache levels=1:2 keys_zone=Nginx:100m inactive=60m;\r\nLine 6: server_name nginx.dev;\r\nLine 9: root \/var\/www\/nginx.dev\/public\/;\r\nLine 26: fastcgi_cache Nginx;\r\nLine 27: fastcgi_cache_valid 200 5m;\r\n<\/code><\/pre>\n

And the new values:<\/p>\n

Line 1: fastcgi_cache_path \/etc\/nginx\/cache levels=1:2 keys_zone=DOMAIN:100m inactive=60m;\r\nLine 6: server_name DOMAIN;\r\nLine 9: root \/var\/www\/DOMAIN\/public\/;\r\nLine 26: fastcgi_cache DOMAIN;\r\nLine 27: fastcgi_cache_valid 200 TIME_TO_CACHE;\r\n<\/code><\/pre>\n

If you don’t want caching, remove\/comment the following lines:<\/p>\n

Line 1 & 2\r\nLine 12 - 16\r\nLine 26 - 31\r\nLine 34 - 37\r\n<\/code><\/pre>\n

Now that our configuration is complete and we’ve setup all our services, we can restart Nginx.<\/p>\n

service nginx restart\r\n<\/code><\/pre>\n

We’re done! If you go to the domainname you’ve pointed to your server, you should see the new document root and you should be able to put content on it.<\/p>\n

Enjoy!<\/p>\n<\/div>\n","protected":false},"author":1,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"open","ping_status":"closed","template":"","format":"standard","manualknowledgebasecat":[109,110,242,247],"manual_kb_tag":[362],"_links":{"self":[{"href":"https:\/\/support.aklwebhost.com\/wp-json\/wp\/v2\/manual_kb\/2590"}],"collection":[{"href":"https:\/\/support.aklwebhost.com\/wp-json\/wp\/v2\/manual_kb"}],"about":[{"href":"https:\/\/support.aklwebhost.com\/wp-json\/wp\/v2\/types\/manual_kb"}],"author":[{"embeddable":true,"href":"https:\/\/support.aklwebhost.com\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/support.aklwebhost.com\/wp-json\/wp\/v2\/comments?post=2590"}],"version-history":[{"count":4,"href":"https:\/\/support.aklwebhost.com\/wp-json\/wp\/v2\/manual_kb\/2590\/revisions"}],"predecessor-version":[{"id":2619,"href":"https:\/\/support.aklwebhost.com\/wp-json\/wp\/v2\/manual_kb\/2590\/revisions\/2619"}],"wp:attachment":[{"href":"https:\/\/support.aklwebhost.com\/wp-json\/wp\/v2\/media?parent=2590"}],"wp:term":[{"taxonomy":"manualknowledgebasecat","embeddable":true,"href":"https:\/\/support.aklwebhost.com\/wp-json\/wp\/v2\/manualknowledgebasecat?post=2590"},{"taxonomy":"manual_kb_tag","embeddable":true,"href":"https:\/\/support.aklwebhost.com\/wp-json\/wp\/v2\/manual_kb_tag?post=2590"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}