{"id":17015,"date":"2015-04-07T09:37:04","date_gmt":"2015-04-07T14:37:04","guid":{"rendered":"https:\/\/secure.rosehosting.com\/blog\/?p=17015"},"modified":"2022-06-03T03:44:26","modified_gmt":"2022-06-03T08:44:26","slug":"install-pagekit-on-a-debian-7-vps-with-nginx-php-fpm-and-mariadb","status":"publish","type":"post","link":"https:\/\/www.rosehosting.com\/blog\/install-pagekit-on-a-debian-7-vps-with-nginx-php-fpm-and-mariadb\/","title":{"rendered":"Install Pagekit on a Debian 7 VPS with Nginx, PHP-FPM and MariaDB"},"content":{"rendered":"
In this blog post we will show you how to install Pagekit on a Debian 7 VPS with Nginx PHP-FPM and MariaDB. Pagekit is a new modern CMS build on top of the Symfony framework which you can use to build your website or blog.This guide should work on other Linux VPS<\/a> systems as well but was tested and written for Debian 7 VPS<\/a>.<\/p>\n <\/p>\n <\/p>\n Add MariaDB to your sources.list<\/p>\n Install MariaDB:<\/p>\n When the installation is complete, run the following command to secure your installation:<\/p>\n Next, we need to create a database for our Pagekit installation.<\/p>\n The latest versions of Nginx and PHP are not available via the default Debian repositories, so we will add the Dotdeb repository. Open the \/etc\/apt\/sources.list file and append the following lines:<\/p>\n Fetch and install the GnuPG key:<\/p>\n Update the system and install Nginx, PHP and all necessary extensions:<\/p>\n Composer is a dependency manager for PHP with which you can install packages. Composer will pull all the required libraries you need for your project.<\/p>\n Create a root directory for your web site and clone the git repository from github using the following commands:<\/p>\n Create a new PHP-FPM pool for your user:<\/p>\n Restart PHP-FPM<\/p>\n Create a new Nginx server block with the following content:<\/p>\n Test the Nginx configuration:<\/p>\n Activate the server block by creating a symbolic link and restart nginx:<\/p>\n Open your browser and type the address of your website That’s it. You have successfully installed your Pagekit. For more information about Pagekit, please refer to the Pagekit<\/a> website.<\/p>\n <\/p>\n Of course you don\u2019t have to do any of this if you use one of our Linux VPS Hosting<\/a> services, in which case you can simply ask our expert Linux admins to setup this for you. They are available 24×7 and will take care of your request immediately.<\/p>\n PS<\/span><\/strong>. If you liked this post please share it with your friends on the social networks using the buttons on the left or simply leave a reply below. Thanks.<\/p>\n","protected":false},"excerpt":{"rendered":" In this blog post we will show you how to install Pagekit on a Debian 7 VPS with Nginx PHP-FPM … <\/p>\nLogin to your VPS via SSH<\/h4>\n
ssh user@vps<\/pre>\n
Update the system and install necessary packages.<\/h4>\n
user@vps:~# sudo apt-get update \r\nuser@vps:~# sudo apt-get -y upgrade\r\nuser@vps:~# sudo apt-get install python-software-properties software-properties-common git vim<\/pre>\n
Install MariaDB 10.0<\/h4>\n
user@vps:~# sudo apt-key adv --recv-keys --keyserver hkp:\/\/keyserver.ubuntu.com:80 0xcbcb082a1bb943db\r\nuser@vps:~# sudo add-apt-repository 'deb http:\/\/ftp.utexas.edu\/mariadb\/repo\/10.0\/debian wheezy main'<\/pre>\n
user@vps:~# sudo apt-get update\r\nuser@vps:~# sudo apt-get install mariadb-server<\/pre>\n
mysql_secure_installation<\/pre>\n
user@vps:~# mysql -uroot -p\r\nMariaDB [(none)]> CREATE DATABASE pagekit;\r\nMariaDB [(none)]> GRANT ALL PRIVILEGES ON pagekit.* TO 'pagekituser'@'localhost' IDENTIFIED BY 'pagekituser_passwd';\r\nMariaDB [(none)]> FLUSH PRIVILEGES;\r\nMariaDB [(none)]> \\q<\/pre>\n
Install PHP and Nginx<\/h4>\n
user@vps:~# sudo vim \/etc\/apt\/sources.list<\/pre>\n
deb http:\/\/packages.dotdeb.org wheezy all\r\ndeb http:\/\/packages.dotdeb.org wheezy-php56 all<\/pre>\n
user@vps:~# wget -qO - http:\/\/www.dotdeb.org\/dotdeb.gpg | sudo apt-key add -<\/pre>\n
user@vps:~# sudo apt-get update\r\nuser@vps:~# sudo apt-get install nginx \r\nuser@vps:~# sudo apt-get install php5-fpm php5-cli php5-json php5-apcu php5-curl<\/pre>\n
Install Composer<\/h4>\n
user@vps:~# curl -sS https:\/\/getcomposer.org\/installer | php\r\nuser@vps:~# sudo mv composer.phar \/usr\/local\/bin\/composer<\/pre>\n
Install Node Gulp and Bower<\/h4>\n
user@vps:~# curl -sL https:\/\/deb.nodesource.com\/setup | sudo bash -\r\nuser@vps:~# sudo apt-get install -y nodejs\r\nuser@vps:~# sudo npm install -g bower\r\nuser@vps:~# sudo npm install -g gulp<\/pre>\n
Clone the git repository<\/h4>\n
user@vps:~# mkdir -p ~\/yourPagekitSite.com\/{public_html,logs}\r\nuser@vps:~# git clone https:\/\/github.com\/pagekit\/pagekit.git ~\/yourPagekitSite.com\/public_html<\/pre>\n
Install all dependencies and buld assets<\/h4>\n
user@vps:~# cd ~\/yourPagekitSite.com\/public_html\r\nuser@vps:~# composer install\r\nuser@vps:~# npm install\r\nuser@vps:~# bower install\r\nuser@vps:~# gulp<\/pre>\n
PHP-FPM configuration<\/h4>\n
user@vps:~# sudo tee \/etc\/php5\/fpm\/pool.d\/$(whoami).conf << EOF\r\n[$(whoami)]\r\nuser = $(whoami) \r\ngroup = $(whoami) \r\nlisten = \/var\/run\/php5-fpm-$(whoami).sock \r\nlisten.owner = $(whoami)\r\nlisten.group = $(whoami) \r\nlisten.mode = 0666 \r\npm = ondemand \r\npm.max_children = 5 \r\npm.process_idle_timeout = 10s; \r\npm.max_requests = 200 \r\nchdir = \/ \r\nEOF<\/pre>\n
user@vps:~# sudo service php5-fpm restart<\/pre>\n
Nginx configuration<\/h4>\n
user@vps:~# sudo tee \/etc\/nginx\/sites-available\/yourPagekitSite.com << EOF\r\nserver {\r\n server_name yourPagekitSite.com;\r\n listen 80;\r\n root $HOME\/yourPagekitSite.com\/public_html;\r\n access_log $HOME\/yourPagekitSite.com\/logs\/access.log;\r\n error_log $HOME\/yourPagekitSite.com\/logs\/error.log;\r\n index index.php;\r\n \r\n location \/ {\r\n try_files \\$uri \\$uri\/ \/index.php?\\$args;\r\n }\r\n \r\n location ~* \\.(?:ico|css|js|gif|jpe?g|png|ttf|woff)\\$ {\r\n access_log off;\r\n expires 30d;\r\n add_header Pragma public;\r\n add_header Cache-Control \"public, mustrevalidate, proxy-revalidate\";\r\n }\r\n \r\n location ~ \\.php\\$ {\r\n fastcgi_split_path_info ^(.+\\.php)(\/.+)\\$;\r\n fastcgi_pass unix:\/var\/run\/php5-fpm-$(whoami).sock;\r\n fastcgi_index index.php;\r\n include fastcgi_params;\r\n fastcgi_param SCRIPT_FILENAME \\$document_root\\$fastcgi_script_name;\r\n fastcgi_intercept_errors off;\r\n fastcgi_buffer_size 16k;\r\n fastcgi_buffers 4 16k;\r\n }\r\n \r\n location ~ \/\\.ht {\r\n deny all;\r\n }\r\n \r\n}\r\nEOF<\/pre>\n
user@vps:~# sudo nginx -t<\/pre>\n
user@vps:~# sudo ln -s \/etc\/nginx\/sites-available\/yourPagekitSite.com \/etc\/nginx\/sites-enabled\/yourPagekitSite.com\r\nuser@vps:~# sudo \/etc\/init.d\/nginx restart<\/pre>\n
Final steps<\/h4>\n
yourPagekitSite.com<\/code>, enter the database information and create your first user.<\/p>\n
\n