{"id":17444,"date":"2016-02-11T15:28:27","date_gmt":"2016-02-11T21:28:27","guid":{"rendered":"https:\/\/secure.rosehosting.com\/blog\/?p=17444"},"modified":"2022-06-03T03:43:48","modified_gmt":"2022-06-03T08:43:48","slug":"install-sylius-on-a-debian-8-vps","status":"publish","type":"post","link":"https:\/\/www.rosehosting.com\/blog\/install-sylius-on-a-debian-8-vps\/","title":{"rendered":"How to install Sylius on Debian 8"},"content":{"rendered":"
In this tutorial, we will explain how to install Sylius on a Debian 8 VPS with MariaDB, PHP-FPM and Nginx. Sylius is a modern e-commerce application build on top of Symfony 2 components. This guide should work on other Linux VPS<\/a> systems as well but was tested and written for an Debian 8 VPS<\/a>. To install the latest MariaDB 10 version, run the following commands:<\/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 Sylius installation.<\/p>\n The latest version of Nginx, version 1.8 is 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:<\/p>\n To install the latest stable version of PHP version 5.6 and all nessesary modules, run:<\/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 The script will ask you several question:<\/p>\n The script above will check if everything is setup to run Sylius properly and ask you few additional questions.<\/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 Activate the server block by creating a symbolic link :<\/p>\n Test the Nginx configuration and restart nginx:<\/p>\n That\u2019s it. You have successfully installed Sylius on your Debian 8 VPS<\/a>. For more information about how to manage your Sylius installation, please refer to the Sylius<\/a> website.<\/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 tutorial, we will explain how to install Sylius on a Debian 8 VPS with MariaDB, PHP-FPM and Nginx. … <\/p>\n
\n<\/p>\nLogin to your VPS via SSH<\/h4>\n
ssh user@vps<\/pre>\n
Update the system and install necessary packages<\/h4>\n
[user]$ sudo apt-get update && sudo apt-get -y upgrade\n[user]$ sudo apt-get install curl<\/pre>\n
Install MariaDB 10.0<\/h4>\n
[user]$ sudo apt-key adv --recv-keys --keyserver keyserver.ubuntu.com 0xcbcb082a1bb943db\n[user]$ sudo add-apt-repository 'deb http:\/\/mirror.jmu.edu\/pub\/mariadb\/repo\/10.0\/debian jessie main'\n[user]$ sudo apt-get update\n[user]$ sudo apt-get install -y mariadb-server<\/pre>\n
[user]$ mysql_secure_installation<\/pre>\n
[user]$ mysql -uroot -p\nMariaDB [(none)]> CREATE DATABASE syliusdb;\nMariaDB [(none)]> GRANT ALL PRIVILEGES ON syliusdb.* TO 'syliusdbuser'@'localhost' IDENTIFIED BY 'syliusdbuserpasswd';\nMariaDB [(none)]> FLUSH PRIVILEGES;\nMariaDB [(none)]> \\q<\/pre>\n
Install Nginx<\/h4>\n
[user]$ sudo vim \/etc\/apt\/sources.list<\/pre>\n
deb http:\/\/packages.dotdeb.org jessie all\ndeb-src http:\/\/packages.dotdeb.org jessie all<\/pre>\n
[user]$ curl -sS http:\/\/www.dotdeb.org\/dotdeb.gpg | sudo apt-key add -<\/pre>\n
[user]$ sudo apt-get update\n[user]$ sudo apt-get -y install nginx<\/pre>\n
Install PHP and required PHP modules<\/h4>\n
[user]$ sudo apt-get -y install php5-fpm php5-cli php5-gd php5-mysqlnd php5-curl php5-intl<\/pre>\n
Install Composer<\/h4>\n
[user]$ curl -sS https:\/\/getcomposer.org\/installer | php\n[user]$ sudo mv composer.phar \/usr\/local\/bin\/composer<\/pre>\n
Install Sylius<\/h4>\n
[user]$ cd ~\/\n[user]$ composer create-project sylius\/sylius:v0.14.0<\/pre>\n
Creating the \"app\/config\/parameters.yml\" file\nSome parameters are missing. Please provide them.\nsylius.database.driver (pdo_mysql):\nsylius.database.host (127.0.0.1):\nsylius.database.port (null):\nsylius.database.name (sylius): syliusdb\nsylius.database.path (null):\nsylius.database.user (root): syliusdbuser\nsylius.database.password (null): syliusdbuserpasswd<\/pre>\n
[user]$ cd sylius\n[user]$ php app\/console sylius:install --env prod<\/pre>\n
PHP-FPM configuration<\/h4>\n
[user]$ cat << EOF | sudo tee \/etc\/php5\/fpm\/pool.d\/$(whoami).conf\n[$(whoami)]\nuser = $(whoami) \ngroup = $(whoami) \nlisten = \/var\/run\/php5-fpm-$(whoami).sock \nlisten.owner = $(whoami)\nlisten.group = $(whoami) \nlisten.mode = 0666 \npm = ondemand \npm.max_children = 5 \npm.process_idle_timeout = 10s; \npm.max_requests = 200 \nchdir = \/\nEOF<\/pre>\n
[user]$ sudo service php5-fpm restart<\/pre>\n
Nginx configuration<\/h4>\n
[user]$ cat << EOF | sudo tee \/etc\/nginx\/sites-available\/mySylius.com\nserver {\n server_name mySylius.com;\n listen 80;\n root $HOME\/sylius\/web;\n\n access_log \/var\/log\/nginx\/sylius-access.log;\n error_log \/var\/log\/nginx\/sylius-error.log;\n\n location \/ {\n try_files \\$uri \/app.php\\$is_args\\$args;\n }\n\n location ~ ^\/app\\.php(\/|\\$) {\n fastcgi_pass unix:\/var\/run\/php5-fpm-$(whoami).sock;\n fastcgi_split_path_info ^(.+\\.php)(\/.*)\\$;\n include fastcgi_params;\n fastcgi_param SCRIPT_FILENAME \\$document_root\\$fastcgi_script_name;\n fastcgi_intercept_errors off;\n fastcgi_buffer_size 16k;\n fastcgi_buffers 4 16k;\n }\n\n location ~ \/\\.ht {\n deny all;\n } \n}\nEOF<\/pre>\n
[user]$ sudo ln -s \/etc\/nginx\/sites-available\/mySylius.com \/etc\/nginx\/sites-enabled\/mySylius.com<\/pre>\n
[user]$ sudo nginx -t\n[user]$ sudo service nginx restart<\/pre>\n
\n