{"id":17237,"date":"2015-06-11T15:25:05","date_gmt":"2015-06-11T20:25:05","guid":{"rendered":"https:\/\/secure.rosehosting.com\/blog\/?p=17237"},"modified":"2022-06-03T03:44:19","modified_gmt":"2022-06-03T08:44:19","slug":"install-symphony-cms-on-an-ubuntu-vps","status":"publish","type":"post","link":"https:\/\/www.rosehosting.com\/blog\/install-symphony-cms-on-an-ubuntu-vps\/","title":{"rendered":"Install Symphony CMS on an Ubuntu VPS"},"content":{"rendered":"
In this tutorial, we will explain how to install Symphony CMS on an Ubuntu 14.04 VPS with MariaDB, PHP-FPM and Nginx. Symphony CMS is a XSLT-powered open source content management system which enables users to create and manage websites and web applications. This guide should work on other Linux VPS<\/a> systems as well but was tested and written for an Ubuntu 14.04 VPS<\/a>. When the installation is complete, run the following command to secure your installation:<\/p>\n Next, we need to create a database for our Symphony installation.<\/p>\n Installing PHP and Nginx is pretty easy, just run the following command:<\/p>\n Create a root directory for your web site and clone the git repository from github using the following commands:<\/p>\n If you want to add the optional extensions run:<\/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 Open http:\/\/yourSymphonySite.com\/install in your favorite web browser and you should see the Symphony install screen. Provide the database and user information and click on the “Install Symphony” button.<\/p>\n After the installation is complete, do not forget to remove <\/span>the installer files:<\/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 Symphony CMS on an Ubuntu 14.04 VPS with MariaDB, PHP-FPM and … <\/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\r\n[user]$ sudo apt-get install software-properties-common git<\/pre>\n
Install MariaDB 10.0<\/h4>\n
[user]$ sudo apt-key adv --recv-keys --keyserver hkp:\/\/keyserver.ubuntu.com:80 0xcbcb082a1bb943db\r\n[user]$ sudo add-apt-repository 'deb http:\/\/ftp.osuosl.org\/pub\/mariadb\/repo\/10.0\/ubuntu trusty main'\r\n[user]$ sudo apt-get install mariadb-server<\/pre>\n
[user]$ mysql_secure_installation<\/pre>\n
[user]$ mysql -uroot -p\r\nMariaDB [(none)]> CREATE DATABASE symphony;\r\nMariaDB [(none)]> GRANT ALL PRIVILEGES ON symphony.* TO 'symphonyuser'@'localhost' IDENTIFIED BY 'symphonyuser_passwd';\r\nMariaDB [(none)]> FLUSH PRIVILEGES;\r\nMariaDB [(none)]> \\q<\/pre>\n
Install PHP-FPM and Nginx<\/h4>\n
[user]$ sudo apt-get install nginx php5-fpm php5-cli php5-xsl php5-xmlrpc php5-gd php5-mysqlnd<\/pre>\n
Clone the Symphony CMS git repository<\/h4>\n
[user]$ mkdir -p ~\/yourSymphonySite.com\/{public_html,logs}\r\n[user]$ git clone git:\/\/github.com\/symphonycms\/symphony-2.git ~\/yourSymphonySite.com\/public_html<\/pre>\n
[user]$ cd ~\/yourSymphonySite.com\/public_html\r\n[user]$ git checkout --track origin\/bundle\r\n[user]$ git submodule update --init --recursive\r\n<\/pre>\n
PHP-FPM configuration<\/h4>\n
[user]$ cat << EOF | sudo tee \/etc\/php5\/fpm\/pool.d\/$(whoami).conf\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]$ sudo service php5-fpm restart<\/pre>\n
Nginx configuration<\/h4>\n
[user]$ cat << EOF | sudo tee \/etc\/nginx\/sites-available\/yourSymphonySite.com\r\nserver {\r\n server_name yourSymphonySite.com;\r\n listen 80;\r\n root $HOME\/yourSymphonySite.com\/public_html;\r\n access_log $HOME\/yourSymphonySite.com\/logs\/access.log;\r\n error_log $HOME\/yourSymphonySite.com\/logs\/error.log;\r\n index index.php;\r\n \r\n\r\n location \/ {\r\n rewrite ^(.*[^\/])\\$ \\$1\/ permanent;\r\n if (!-d $request_filename) {\r\n rewrite ^\/(.*)\\$ \/index.php?symphony-page=\\$1 last;\r\n }\r\n }\r\n\r\n location ~ ^\/symphony(\/?.*)\\$ {\r\n if (!-f \\$request_filename) {\r\n rewrite ^\/symphony\/?\\$ \/index.php?mode=administration&\\$query_string last;\r\n rewrite ^\/symphony(\/(.*\/?))?\\$ \/index.php?symphony-page=\\$1&mode=administration&\\$query_string last;\r\n }\r\n }\r\n \r\n location ~ ^\/image\/(.*)\\$ {\r\n try_files \\$uri \\$uri\/ \/extensions\/jit_image_manipulation\/lib\/image.php?param=\\$1;\r\n }\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 location ~ \/\\.git {\r\n deny all;\r\n }\r\n\r\n location ~ ^\/manifest\/(.*)\\$ {\r\n return 403;\r\n }\r\n\r\n location ~ ^\/workspace\/utilities\/(.*).xsl\\$ {\r\n return 403;\r\n }\r\n\r\n location ~ ^\/workspace\/pages\/(.*).xsl\\$ {\r\n return 403;\r\n }\r\n\r\n location ~ ^\/(.*).sql\\$ {\r\n return 403;\r\n }\r\n\r\n location ~ (^|\/)\\. {\r\n return 403;\r\n }\r\n\r\n}\r\nEOF<\/pre>\n
[user]$ sudo ln -s \/etc\/nginx\/sites-available\/yourSymphonySite.com \/etc\/nginx\/sites-enabled\/yourSymphonySite.com<\/pre>\n
[user]$ sudo nginx -t\r\n[user]$ sudo service nginx restart<\/pre>\n
Final steps<\/h4>\n
[user]$ rm -rf ~\/yourSymphonySite.com\/public_html\/install\/ ~\/yourSymphonySite.com\/public_html\/workspace\/install.sql\r\n<\/pre>\n
\n