{"id":17715,"date":"2015-09-25T05:33:00","date_gmt":"2015-09-25T10:33:00","guid":{"rendered":"https:\/\/secure.rosehosting.com\/blog\/?p=17715"},"modified":"2023-03-17T04:58:23","modified_gmt":"2023-03-17T09:58:23","slug":"how-to-install-drupal-with-postgresql-on-a-debian-8-vps","status":"publish","type":"post","link":"https:\/\/www.rosehosting.com\/blog\/how-to-install-drupal-with-postgresql-on-a-debian-8-vps\/","title":{"rendered":"How to install Drupal with PostgreSQL on a Debian 8 VPS"},"content":{"rendered":"
In this tutorial we will cover the steps needed to install the latest stable version of Drupal on your Debian 8 VPS<\/a> along with PostgreSQL<\/a>.<\/p>\n Drupal is very popular and easy to use open-source CMS (content management system ) written in PHP. It is distributed under the GNU General Public License and used for managing, publishing and organizing a website, regardless of whether it is a personal blog or a corporate website.<\/p>\n This install guide assumes that Apache and PHP are already installed and configured on your Debian 8 Linux VPS<\/a>. If not, you can learn how to Install LAMP (Linux, Apache, MySQL, PHP) on Debian 9<\/a>. <\/p>\n Please note that you don’t need to install MySQL because we will install and use PostgreSQL for the Drupal installation.<\/p>\n At the time of writing this tutorial, Drupal 7.39 is the latest stable version available and it requires:<\/p>\n – Web Server: Apache, Nginx or Hiawatha You can find more information about Drupal’s system requirements from their official documentation<\/a>.<\/p>\n Login to your server via SSH<\/p>\n Let\u2019s reassure that we have the proper version of Debian installed on our server :<\/p>\n UPDATE THE SYSTEM<\/strong><\/p>\n Make sure your server is fully up to date using:<\/p>\n Install Drush:<\/p>\n Debian Jessie installs the 5.10.0 version of Drush. If you like to install and use the latest release, enter the underneath commands:<\/p>\n Check if the update was successful:<\/p>\n You should get the following output:<\/p>\n INSTALL DRUPAL<\/strong><\/p>\n We will download the Drupal installation into the \/var\/www\/html<\/strong> directory. <\/em>Then unpack the archive and set the proper ownership so the files can be processed by Apache. The below commands do exactly that:<\/em><\/p>\n Rename the unpacked archive to your website name.<\/p>\n INSTALL POSTGRESQL<\/strong><\/p>\n Now, you need to install PostgreSQL and create a database and user that you will need to finish the Drupal installation. Issue the following command:<\/p>\n Switch from root to the PostgreSQL user:<\/p>\n You can create a PostgreSQL user by executing:<\/p>\n Enter your drupaluser password when prompted. Now, create a database and assign the user to it:<\/p>\n Exit from the postgres user:<\/p>\n Last but not least, you need to create a new virtual host directive in Apache for your domain. You can create the file with your favorite text editor. For example we are using vim:<\/p>\n Replace your_domain with your actual domain name and paste the following into the file:<\/p>\n Activate the rewrite module:<\/p>\n Enable your new virtual host directive:<\/p>\n Restart Apache for the changes to take effect:<\/p>\n Next, enter your Drupal installation document root:<\/p>\n Change permissions of the CHANGELOG.txt to avoid security problems:<\/p>\n Now, open your favorite web browser and navigate to http:\/\/your_domain\/install.php . You will be welcomed by the Drupal installation page like the one below:<\/p>\n <\/p>\n <\/p>\n <\/p>\n <\/p>\n <\/p>\n <\/p>\n <\/p>\n <\/p>\n <\/p>\n <\/p>\n <\/p>\n <\/p>\n <\/p>\n <\/p>\n <\/p>\n Choose the Standard install. Click on Save and continue.<\/p>\n After you choose your language and the requirements are verified, the installation will take you to the ‘Set up database’ part. Here you need to check the Database Type to PostgreSQL and enter the database and user values that you configured previously. Also, under ‘ADVANCED OPTIONS’ you should set the database port to 5432. Use the below picture for reference:<\/p>\n <\/p>\n <\/p>\n <\/p>\n <\/p>\n <\/p>\n <\/p>\n <\/p>\n <\/p>\n <\/p>\n <\/p>\n <\/p>\n <\/p>\n <\/p>\n <\/p>\n <\/p>\n <\/p>\n <\/p>\n <\/p>\n <\/p>\n Once you are finished, click on ‘Save and continue’. After the installation is completed, configure your site according to your needs. Congratulations, you have successfully installed Drupal<\/a> with PostgreSQL on your Debian 8 VPS<\/a>.<\/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 do this installation 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 to install the latest stable version of Drupal on your Debian … <\/p>\n
\n– PHP: 5.2 or higher
\n– Database Server: MySQL – 5.0 or higher, PostgreSQL – 8.3 or higher, or SQLite<\/p>\n# ssh root@server_ip<\/pre>\n
# lsb_release -a\r\n\r\nDistributor ID: Debian\r\nDescription:\u00a0\u00a0\u00a0 Debian GNU\/Linux 8.2 (jessie)\r\nRelease:\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 8.2\r\nCodename:\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 jessie<\/pre>\n
# apt-get update && apt-get upgrade -y<\/pre>\n
# apt-get install drush php-console-table<\/pre>\n
# pear channel-discover pear.drush.org\r\n\r\n# pear install drush\/drush<\/pre>\n
# drush version<\/pre>\n
# Drush Version : 6.2.0<\/pre>\n
# cd \/var\/www\/html\/\r\n\r\n# wget http:\/\/ftp.drupal.org\/files\/projects\/drupal-7.39.zip\r\n\r\n# unzip drupal-7.39.zip\r\n\r\n# chown www-data: -R drupal-7.39<\/pre>\n
# mv drupal-7.39 your_domain<\/pre>\n
# apt-get install postgresql postgresql-client php5-pgsql<\/pre>\n
# su postgres<\/pre>\n
# createuser drupaluser --pwprompt --encrypted<\/pre>\n
# createdb drupal --owner=drupaluser<\/pre>\n
# exit<\/pre>\n
# vim \/etc\/apache2\/sites-available\/your_domain.conf<\/pre>\n
<VirtualHost *:80>\r\n\r\nServerAdmin webmaster@your_domain\r\nServerName your_domain\r\n\r\nDocumentRoot \/var\/www\/html\/your_domain\r\n\r\n<Directory \/var\/www\/html\/your_domain>\r\nRewriteEngine on\r\nRewriteBase \/mysite\r\nRewriteCond %{REQUEST_FILENAME} !-f\r\nRewriteCond %{REQUEST_FILENAME} !-d\r\nRewriteRule ^(.*)$ index.php?q=$1 [L,QSA]\r\n<\/Directory>\r\n\r\n<\/VirtualHost><\/pre>\n
# a2enmod rewrite<\/pre>\n
# a2ensite your_domain.conf<\/pre>\n
# \/etc\/init.d\/apache2 restart<\/pre>\n
# cd \/var\/www\/html\/your_domain\/<\/pre>\n
# chmod 600 CHANGELOG.txt<\/pre>\n
\n