Drupal 10 installation

Posted under » Drupal updated on 27 Oct 2023

First, make sure all your PHP libraries are installed and your LAMP installation eg. requirements like PHP8 and Apache mod rewrite.

The recommended way to install drupal is via composer which require an internet connection. You can download the installation zip from drupal website and put them on the web server root which may look like this.

/www/drupal/

You already have a website domain registered and pointed to the server and have apache configured.

One of the main reason why I (or many drupal fans) use drupal is that it can host multiple websites on a single drupal installation.

Unlike previous version,for security reasons, you have to go the sites folder and specify the sites that you have by editing

/www/drupal/sites/sites.php

It may look like this. Pretty handy if you want to point www to the top domain.

URL: http://main.com
$sites['main.com'] = 'main.com';
$sites['www.lkybastard.com'] = 'www.lkybastard.com';
$sites['lkybastard.com'] = 'www.lkybastard.com';

Go to sites folder and create the folder which look like this. Not sure if this was done automatically on current version but I have always done this

/www/drupal/sites/www.lkybastard.com

You then create the files directory like so

/www/drupal/sites/www.lkybastard.com/files

It may say you don't have a file called "settings.php". So copy from the /sites/default/default.settings.php

If your permissions for /files and sites.php is not correct it will nag you until you enable everyone to write to it. [chmod -R 0777 /www/drupal8/sites/www.lkybastard.com] files will do the trick.

Now go to your browser and point to your site. It will prompt you to install.

Once that done. You key in the MySQL info and the installation begins. You will have to create a blank mysql db with the correct user permissions.

The install script will write the setup on the settings.php file for you. After that, you key-in the site's name and email and basically your site is ready.

However, it will say you can prevent your settings file from writting. Do this (read more about this), you have to

$ chgrp www-data -R /www/drupal/sites/www.lkybastard.com/
$ chmod -R 0754 /www/drupal/sites/www.lkybastard.com/

Well not yet. Under reports it will say something about Trusted Host settings. Make your (final) changes on the settings.php. Add this at the bottom of settings.php

$settings['trusted_host_patterns'] = [
  '^www\.lkybastard\.com$',
];

Go to /admin/reports/status for more problems. Look at the logs. It may nag you that it has finished writting to the "settings.php" and the file should be write disabled. Look out for any errors under reports section.
 

 

web security linux ubuntu python django git Raspberry apache mysql php drupal cake javascript css AWS data