{"id":18947,"date":"2016-04-02T15:52:05","date_gmt":"2016-04-02T20:52:05","guid":{"rendered":"https:\/\/www.rosehosting.com\/blog\/?p=18947"},"modified":"2022-06-03T03:43:41","modified_gmt":"2022-06-03T08:43:41","slug":"install-habari-with-nginx-on-debian-8","status":"publish","type":"post","link":"https:\/\/www.rosehosting.com\/blog\/install-habari-with-nginx-on-debian-8\/","title":{"rendered":"Install Habari with Nginx on Debian 8"},"content":{"rendered":"
In this tutorial we will cover the steps needed for installing Habari<\/a> with Nginx on a Debian 8 VPS<\/a>.<\/p>\n Habari is a free and open source blog engine written in PHP that currently supports MySQL, SQLite and PostgreSQL for the database backend. It is a publishing platform and application framework with a modular, object-oriented core.<\/p>\n An interesting fact is that the name Habari comes from the Swahili greeting habari which means “(what’s the) news”.<\/p>\n We will be using our SSD 1<\/strong> Linux VPS<\/a> hosting plan for this tutorial. This article assumes that you already have Nginx, MySQL and PHP installed and configured on your server. If that is not the case, you can follow our great tutorial<\/a> and install the LEMP stack on your server easily.<\/p>\n You can check whether you have the proper Debian version installed on your server with the following command:<\/p>\n You should get this output:<\/p>\n Make sure your server is fully up to date using:<\/p>\n You can now create a database that will be needed for the Habari installation. Log into MySQL as root and execute the following queries:<\/p>\n Your next step is to download Habari and install it, configuring an Nginx virtual host directive for your domain along the way. First enter a directory of your choice where you will download the latest Habari version which at the moment of writing this article is version 0.9.2<\/strong>.<\/p>\n We will use the \/opt<\/strong><\/em> directory but feel free to download Habari to a location of your choice.<\/p>\n Create a directory in which the unpacked installation will be moved:<\/p>\n Unzip the archive into the above mentioned directory:<\/p>\n Assign the proper ownership of files and directories so your Nginx web server can actually read the data:<\/p>\n And last but not least, open a Nginx file, let’s call it habari which will serve as a virtual host for the domain you’ll use to host Habari.<\/p>\n Paste the below lines into the file:<\/p>\n Of course, don’t forget to replace domainname.com<\/strong> with your actual domain. Save and close the file. Then, enable it by creating a symlink:<\/p>\n Test the Nginx configuration:<\/p>\n If everything is successful, restart Nginx so the changes can take effect:<\/p>\n Now open your favorite web browser and navigate to http:\/\/your_domain.com<\/strong> to finish the Habari installation.<\/p>\n Enter the database credentials under Database Setup<\/strong> and click on Check Database Connection<\/strong> to verify that the credentials are correct.<\/p>\n After that configure your site under Site Configuration<\/strong> in which you can name your Habari site, username, password and email.<\/p>\n Next, choose your theme, plugins and click on Install Habari<\/strong> to proceed.<\/p>\n Congratulations, you have successfully installed Habari with Nginx on your Debian 8 server.<\/p>\n Of course you don\u2019t have to do any of this if you use one of our Debian VPS Hosting<\/a> services, in which case you can simply ask our expert Linux admins to install Habari for you. They are available 24\u00d77 and will take care of your request immediately.<\/p>\n PS.<\/span> 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 cover the steps needed for installing Habari with Nginx on a Debian 8 VPS. Habari … <\/p>\nREQUIREMENTS<\/h4>\n
LOG IN TO YOUR SERVER VIA SSH<\/h4>\n
# ssh root@server_ip<\/pre>\n
# lsb_release -a<\/pre>\n
Distributor ID: Debian\r\nDescription: Debian GNU\/Linux 8.3 (jessie)\r\nRelease: 8.3\r\nCodename: jessie<\/pre>\n
UPDATE THE SYSTEM<\/h4>\n
# apt-get update && apt-get upgrade<\/pre>\n
# mysql -u root -p\r\n\r\nmysql> create database habari;\r\nQuery OK, 1 row affected (0.00 sec)\r\n\r\nmysql> grant all privileges on habari.* to habariuser@localhost identified by 'your_password';\r\nQuery OK, 0 rows affected (0.00 sec)\r\n\r\nmysql> flush privileges;\r\nQuery OK, 0 rows affected (0.00 sec)\r\n\r\nmysql> exit\r\nBye<\/pre>\n
INSTALL HABARI<\/h4>\n
# cd \/opt\r\n\r\n# wget http:\/\/habariproject.org\/dist\/habari-0.9.2.zip<\/pre>\n
# mkdir -p \/var\/www\/html\/habari<\/pre>\n
# unzip habari-0.9.2.zip -d \/var\/www\/html\/habari\/<\/pre>\n
# chown -R www-data: \/var\/www\/html\/habari\/<\/pre>\n
# nano \/etc\/nginx\/sites-available\/habari<\/pre>\n
server {\r\n server_name domainname.com;\r\n\r\n access_log \/var\/log\/nginx\/domainname.com-access.log;\r\n error_log \/var\/log\/nginx\/domainname.com-error.log;\r\n root \/var\/www\/html\/habari;\r\n\r\n location \/ {\r\n index index.php;\r\n try_files $uri $uri\/ \/index.php$is_args$args;\r\n }\r\n\r\n location ~ \\.php$ {\r\n include \/etc\/nginx\/fastcgi_params;\r\n fastcgi_pass unix:\/var\/run\/php5-fpm.sock;\r\n fastcgi_index index.php;\r\n fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;\r\n }\r\n}<\/pre>\n
# ln -s \/etc\/nginx\/sites-available\/habari \/etc\/nginx\/sites-enabled\/<\/pre>\n
# nginx -t<\/pre>\n
# service nginx restart<\/pre>\n