This was done on an Ubuntu 14.04 laptop (named groundcontrol). For all intents and purposes it is similar to a VPS. Just like a VPS it has MySQL, Php and Apache running a virtual host, all current versions as of this time.
This tutorial assumes you have set up your VPS appropriately, with the proper directories prepared, hosts file and DNS ready, etc.
I. Download and un-compress.
Go to Drupal.org, click ‘Download & Extend’
Click Drupal 8, right click the latest Drupal core 8.x and select ‘copy link address’.
Via SSH, login your VPS and go to the directory you set up for the installation. Here I used ‘/srv/www/d8’.
- Enter ‘sudo wget’ then right-click your mouse to paste the address on the command line, ie.
sudo wget https://ftp.drupal.org/files/projects/drupal-8.1.1.tar.gz
The latest compressed drupal 8 files will download.
- Uncompress the file
ghm33@groundcontrol /srv/www/d8 $ sudo tar xvzf drupal-8.1.1.tar.gz
The files will decompress into a folder called drupal-8.1.1.
- Move all the compressed files in the new drupal-8.1.1 directory into public_html.
ghm33@groundcontrol /srv/www/d8 $ sudo cp -rv drupal-8.1.1/* public_html/
Enter the command ‘ls public_html/’ and you will now see all the drupal 8 directories and files properly laid out.
II. Prepare database.
Still in the terminal, login mysql.
sudo mysql -u root -p
- Enter password to login mysql shell.
- Create a database:
create database d8;
- Create a user and grant privileges to that user on d8:
grant all on d8.* to 'd8user' identified by 'password';
- flush priviliges;
- quit
You now have an empty database (d8) and a database user (d8user). List this down.
III. Set up Drupal 8.
Open your browser and enter the url where you placed the drupal 8 files. This should appear:
After choosing a language, click ‘standard installation’ in ‘choose profile’.
A few errors appear.
- Fix the clean URLs issue (the .htaccess file was not included when we copied it over).
sudo cp -rv /srv/www/d8/drupal-8.1.1/.htaccess /srv/www/d8/public_html/
- Fix the File System issue:
sudo mkdir -p /srv/www/d8/public_html/sites/default/files
- Fix the Settings file issue:
sudo cp -rv /srv/www/d8/public_html/sites/default/default.settings.php /srv/www/d8/public_html/sites/default/settings.php
Refresh the page. You will probably see these messages:
- Fix the file system issue:
sudo chmod -R 777 /srv/www/d8/public_html/sites/default/files/
- Fix the settings file issue:
sudo chmod 777 /srv/www/d8/public_html/sites/default/settings.php
- Refresh your browser and proceed. Enter the database details prepared earlier.
Wait.
This message will appear:
Enter the ff. commands to fix these:
sudo chmod 444 /srv/www/d8/public_html/sites/default/settings.php sudo chmod -R 755 /srv/www/d8/public_html/sites/default/files/
You should now have a working Drupal 8 installation.
Visit the ‘admin/reports/status’ page first and deal with any issues you find there. We will cover file and directory permissions in another post.