Latest posts

Browse topics

How to Install Drupal 11 with Nginx, PHP-FPM 8.3, MySQL, phpMyAdmin on Ubuntu 24.04 - Linode Guide

In this article, you will learn how to set up a webserver for serving Drupal 11 websites running with Nginx, PHP-FPM 8.3, MySQL, and phpMyAdmin on Ubuntu 24.04

For the following tutorial, I used very much the information from my previous guide with Ubuntu 23.04, but I decided to rewrite it for Ubuntu 24.04 version as it is shipped with php8.4 and also php8.4 version and will work with Drupal 11 (most probably with previous versions too)

Prerequisites

  • Ubuntu 24.04
  • Root privileges.

You can get a cheap VPS starting at just $5/mo from Linode. That's what I did - bought a new nanode from Linode

Literally, in a couple of seconds, the new server was up and running - that's what I love about sticking with Linode for years

Follow the basic security guide, see: Securing Your Server

I will use Terminal from MAC to access  over SSH (Windows users could use Putty)

Secure your server

Create the user, replacing example_user with your desired username. You’ll then be asked to assign the user a password:

adduser example_user

Add the user to the sudo group so you’ll have administrative privileges:

adduser example_user sudo

Disallow root logins over SSH. This requires all SSH connections to be by non-root users. Once a limited user account is connected, administrative privileges are accessible either by using sudo or changing to a root shell using su -.

sudo nano /etc/ssh/sshd_config

Under # Authetification section change to

# Authentication: ...
PermitRootLogin no

Update the Ubuntu system

sudo apt-get update

Install Nginx and PHP-FPM

Install Nginx with the following apt command:

sudo apt-get install nginx -y

Next, install php8.1-fpm with php-gd extension that is required by Drupal core:

sudo apt-get install php8.3-fpm php8.3-cli php8.3-gd php8.3-mysql php8.3-xml -y

Configure Nginx and PHP-FPM

In this step, we will configure Nginx to use php-fpm to serve HTTP requests for PHP pages. Go to the php-fpm directory "/etc/php/8.1/fpm" and edit the "php.ini" file:

sudo nano /etc/php/8.3/fpm/php.ini

Un-comment the cgi.fix_pathinfo line and change the value to "0"

When using nano command you can use CTRL+W to locate that line. Once changed press CTRL+O to save changes and CTRL+X to exit from nano editor

Now we should modify the default Nginx virtual host configuration. Edit the "default" file and enable the php-fpm directive.

sudo nano /etc/nginx/sites-available/default

Un-comment  location ~ \.php$ section, so it look like this

location ~ \.php$ {
include snippets/fastcgi-php.conf;
# With php7.4-cgi alone:
#fastcgi_pass 127.0.0.1:9000;
# With php7.4-fpm:
fastcgi_pass unix:/run/php/php7.4-fpm.sock;
}

CTRL+O and CTRL+X

Then test the Nginx configuration with the command "nginx -t" to ensure that it is valid:

nginx -t

If there is no error, restart nginx and the php-fpm service:

systemctl restart nginx
systemctl restart php8.3-fpm

PHP Info file (Optional)

Next, test that php-fpm is working properly with Nginx by creating new PHP info file in the web directory "/var/www/html"

cd /var/www/html/
echo "<?php phpinfo(); ?>" > info.php

Visit the info.php file at the server IP  in a web browser.

Configure the VirtualHost for Drupal

We will install Drupal 11 in the directory "/srv/www/reinisfischer.com". Please replace my domain name in your installation with the domain name of the website that you want to use this Drupal installation for. So let's create the directory:

sudo mkdir -p /srv/www/reinisfischer.com/{public_html,logs}
sudo usermod -a -G www-data admin
sudo chown -R www-data:www-data /srv/www
sudo chmod -R 775 /srv/www
sudo nano /etc/nginx/sites-available/reinisfischer.com

Paste the Nginx configuration for Drupal 11:

Gael raised some security concerns (see comment below). I’ve updated the server block to include additional protections — it may not be perfect, but it’s definitely tighter now.

server {
    server_name reinisfischer.com;
    root /srv/www/reinisfischer.com/public_html; ## <-- Your only path $
    access_log /srv/www/reinisfischer.com/logs/access.log;
    error_log /srv/www/reinisfischer.com/logs/error.log;
    listen 80;
    listen [::]:80;
    location = /favicon.ico {
        log_not_found off;
        access_log off;
    }
    location = /robots.txt {
        allow all;
        log_not_found off;
        access_log off;
    }
    # Very rarely should these ever be accessed outside of your lan
    location ~* \.(txt|log)$ {
        allow 192.168.0.0/16;
        deny all;
    }
    location ~ \..*/.*\.php$ {
        return 403;
    }
    location ~ ^/sites/.*/private/ {
        return 403;
    }
    # Block access to "hidden" files and directories whose names begin with a
    # period. This includes directories used by version control systems such
    # as Subversion or Git to store control files.
    location ~ (^|/)\. {
        return 403;
    }
    location / {
        # try_files $uri @rewrite; # For Drupal <= 6
        try_files $uri /index.php?$query_string; # For Drupal >= 7
    }
    location @rewrite {
        rewrite ^/(.*)$ /index.php?q=$1;
    }
   # Block access to Drupal source code files
   location ~* \.(module|inc|install|engine|theme|tpl(\.php)?|info|po|sh|.*sql|xtmpl)$ {
   deny all;
   }
    # In Drupal 8, we must also match new paths where the '.php' appears in the middle,
    # such as update.php/selection. The rule we use is strict, and only allows this pattern
    # with the update.php front controller.  This allows legacy path aliases in the form of
    # blog/index.php/legacy-path to continue to route to Drupal nodes. If you do not have
    # any paths like that, then you might prefer to use a laxer rule, such as:
    #   location ~ \.php(/|$) {
    # The laxer rule will continue to work if Drupal uses this new URL pattern with front
    # controllers other than update.php in a future release.
    location ~ '\.php$|^/update.php' {
        fastcgi_split_path_info ^(.+?\.php)(|/.*)$;
        #NOTE: You should have "cgi.fix_pathinfo = 0;" in php.ini
        include fastcgi_params;
        include snippets/fastcgi-php.conf;
        fastcgi_param SCRIPT_FILENAME $request_filename;
        fastcgi_intercept_errors on;
        fastcgi_pass unix:/run/php/php8.3-fpm.sock;
    }
    # Fighting with Styles? This little gem is amazing.
    # location ~ ^/sites/.*/files/imagecache/ { # For Drupal <= 6
    location ~ ^/sites/.*/files/styles/ { # For Drpal >= 7
        try_files $uri @rewrite;
    }
    location ~* \.(js|css|png|jpg|jpeg|gif|ico)$ {
        expires max;
        log_not_found off;
    }
}

CTRL+O and CTRL + X

The Drupal virtual host file has been created, now we have to activate it by creating a symlink to the file in the "sites-enabled" directory:

ln -s /etc/nginx/sites-available/reinisfischer.com /etc/nginx/sites-enabled/

Test the Nginx configuration and if there are no errors restart Nginx:

nginx -t
systemctl restart nginx

Install MySQL

sudo apt-get install mysql-server
​sudo mysql_secure_installation

Warning: As of July 2022, an error will occur when you run the mysql_secure_installation script without some further configuration. The reason is that this script will attempt to set a password for the installation’s root MySQL account but, by default on Ubuntu installations, this account is not configured to connect using a password.

See: How To Install MySQL on Ubuntu 20.04 for mysql_secure_installation fix

Prior to July 2022, this script would silently fail after attempting to set the root account password and continue on with the rest of the prompts. However, as of this writing, the script will return the following error after you enter and confirm a password:

Output

... Failed! Error: SET PASSWORD has no significance for user 'root'@'localhost' as the authentication method used doesn't store authentication data in the MySQL server. Please consider using ALTER USER instead if you want to change authentication parameters. New password:

This will lead the script into a recursive loop which you can only get out of by closing your terminal window.

Because the mysql_secure_installation script performs a number of other actions that are useful for keeping your MySQL installation secure, it’s still recommended that you run it before you begin using MySQL to manage your data. To avoid entering this recursive loop, though, you’ll need to first adjust how your root MySQL user authenticates.

First, open up the MySQL prompt: 

  1. sudo mysql

Then run the following ALTER USER command to change the root user’s authentication method to one that uses a password. The following example changes the authentication method to mysql_native_password:

  1. ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'password';

After making this change, exit the MySQL prompt:

  1. exit

Following that, you can run the mysql_secure_installation script without issue.

Install phpMyAdmin

sudo apt-get install phpmyadmin

Hit ESC when the installation prompts you for auto-configuration because there is no option for Nginx.

Make an easily accessible symlink

sudo ln -s /usr/share/phpmyadmin/ /srv/www/reinisfischer.com/public_html/phpmyadmin

Install and Configure Drupal

Enter the directory that we created earlier and download Drupal with wget. I'm using the latest Drupal 11.1.2. release as of February 10, 2025, make sure you are downloading the latest version by visiting the Drupal download page and writing down the last numbers (version)

cd /srv/www/reinisfischer.com
sudo wget https://ftp.drupal.org/files/projects/drupal-11.1.2.tar.gz
sudo tar -xvzf drupal-11.1.2.tar.gz
sudo cp drupal-11.1.2/* public_html/ -R
sudo chown www-data:www-data public_html -R

Now visit your Drupal site in the web Browser, you should see the similar screen

Now, using phpmyadmin login into MySQL and setup database

Optional: How to edit hosts file on Mac

from the terminal 

sudo nano /etc/hosts

add your IP address pointing to the domain name to test before the DNS zone gets updated

Kakhaberi Restaurant: A Culinary Gem Near Bibliani

In early January 2025, during a weekend trip to Gudauri, we stumbled upon Kakhaberi restaurant near Bibliani. 

What a discovery it turned out to be! Nestled along the route to the mountains, this place is a treasure trove of authentic Georgian cuisine, offering a delightful mix of great food, efficient service, and genuine hospitality.

Our experience was memorable from the moment we stepped in. The food was not only amazing but also served promptly—a blessing when traveling with a young child. The staff, fluent in English, made communication effortless and added to the welcoming atmosphere.

For myself, I decided to try 50 ml of their locally made brandy, only to be generously served what felt like at least 120 ml. The taste? Absolutely delightful, especially when mixed with Georgian lemonade—a unique pairing I highly recommend. Meanwhile, our kiddo enjoyed a feast of French fries, kebab, and her all-time favorite, tkemali (Georgian plum sauce). Every dish was fresh, flavorful, and prepared with care.

On our way back to Tbilisi, we couldn’t resist making another stop at Kakhaberi. This time, I ordered their homemade brandy for takeaway—an incredible bargain at just GEL 15. Conveniently, the restaurant accepts VISA cards, making payment hassle-free.

Kakhaberi stands out for its true and authentic Georgian cuisine, served in a warm and inviting setting. Whether you’re heading to Gudauri or simply exploring the area, this spot is a must-visit. It’s the kind of place you’ll want to return to—just as we did!

Salty Garden & Lisi Lake (2024)

The last weekend of April 2024 was filled with nature, good company, and memorable experiences. The journey took us to Salty Garden near Bazaleti Lake, where I met Anastasiya, who was working at the Salty Garden tavern, and later, a hike around Lisi Lake wrapped up the adventure.

Located in the picturesque surroundings of Bazaleti Lake, Salty Garden is a hidden gem perfect for relaxation. The area is known for its tranquil atmosphere, fresh air, and scenic landscapes. The garden itself offers a cozy retreat with charming outdoor seating, organic food, and a peaceful environment, making it an ideal place to unwind. The lake, surrounded by rolling hills, adds to the beauty of the spot, providing opportunities for short walks and photography.

One of the highlights of the weekend was meeting Anastasiya from Latvia, who was working at the Salty Garden tavern. Conversations about travel, culture, and shared experiences enriched the time spent at Salty Garden. The exchange of stories over a delicious meal made the visit even more enjoyable, reinforcing the joy of spontaneous connections while exploring new places.

To end the weekend on an active note, we headed to Lisi Lake for a hike. Located on the outskirts of Tbilisi, Lisi Lake is a popular destination for those looking to escape the city's hustle and bustle. The lake is surrounded by a vast open landscape with walking trails, making it an excellent spot for hiking, jogging, or simply enjoying the view. The fresh air and calm waters created a refreshing atmosphere, providing the perfect setting to reflect on the experiences of the weekend.

This weekend was a perfect mix of relaxation, social encounters, and outdoor exploration. Salty Garden near Bazaleti Lake provided a serene escape, meeting Anastasiya brought an unexpected yet delightful connection, and hiking around Lisi Lake added a touch of adventure. Moments like these remind us of the simple joys of travel and discovery.

How to Install Composer on Ubuntu (24.04) for Easy Drupal Module & Theme Updates

As a Drupal developer, keeping your modules up to date is crucial for security and performance. To streamline this process, I use Composer—a powerful dependency manager for PHP. It allows me to quickly update Drupal modules without the hassle of manually downloading and configuring each one. In this guide, I will walk you through the process of installing Composer on Ubuntu 24.04.

I typically run Drupal on an Ubuntu-based server with Nginx as the web server. This combination provides excellent performance and stability for hosting Drupal sites. Composer plays a crucial role in managing dependencies efficiently in this environment.

Composer is a dependency management tool for PHP that simplifies the installation and updates of libraries and packages. Instead of manually downloading and integrating each module, Composer automates the process, ensuring you always have the latest stable versions of your dependencies.

Step-by-Step Guide to Installing Composer on Ubuntu 24.04

1. Update Your System

Before installing any new software, ensure your system is up to date by running:

sudo apt update && sudo apt upgrade -y

2. Install Required Dependencies

Composer requires PHP and other dependencies. Install them using:

sudo apt install php-cli unzip curl -y

3. Download and Install Composer

Run the following commands to install Composer globally:

curl -sS https://getcomposer.org/installer | php sudo mv composer.phar /usr/local/bin/composer

Alternatively, you can use the official installation method:

php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');" php composer-setup.php php -r "unlink('composer-setup.php');"

Move Composer to a global location:

sudo mv composer.phar /usr/local/bin/composer

4. Verify Installation

After installation, verify that Composer is working by running:

composer -V

You should see the version number displayed, confirming a successful installation.

Using Composer for Drupal Module Updates

Once Composer is installed, updating Drupal modules becomes a breeze. Here’s how you can do it:

  1. Navigate to your Drupal project’s root directory:

    cd /path/to/your/drupal/site

  2. To update a specific module, run:

    composer update drupal/module_name --with-dependencies

  3. To update all modules and dependencies, use:

    composer update

  4. Clear the Drupal cache to apply updates:

    drush cache:rebuild

Using Composer simplifies Drupal module updates, ensuring you always have the latest security patches and features. With just a few commands, you can maintain your Drupal site efficiently and avoid potential compatibility issues. My usual setup involves Ubuntu with Nginx, and Composer integrates seamlessly into this environment, making dependency management straightforward.

Let me know in the comments if you have any questions or need further assistance.

Erisoni Restaurant in Gori

During my recent visit to Gori, I had the pleasure of dining at Restaurant Erisoni, a place I wouldn’t have discovered if it weren’t for a friendly recommendation. The night before, while enjoying a cup of coffee at Georgia Hotel Gold, I struck up a conversation with David, my business partner. As we chatted about things to do in Gori, I asked for some tips on must-visit spots, and without hesitation, David insisted that I should check out Erisoni. He even provided me with precise navigation details, emphasizing that it was a place worth visiting.

Initially, dining at Erisoni wasn’t in our plans, but fate had other ideas. The next morning, as we attempted to get breakfast at the hotel, we realized it wasn’t an option. A quick Google search for breakfast spots in Gori brought up Erisoni once again. Remembering David’s strong recommendation, we decided to give it a try. A short 10-minute drive later, we found ourselves settling in at the restaurant, ready to explore its offerings.

The first thing that stood out was the pricing—reminiscent of Tbilisi’s restaurant scene from 6-7 years ago. The affordability, combined with the authentic taste of local cuisine, made it a delightful experience.

Erisoni captures the essence of Gori’s culinary traditions, and to my surprise, they even serve Ossetian Khachapuri, a rare find in many places.

For anyone visiting Gori, Restaurant Erisoni is a spot worth experiencing. Whether you’re looking for an affordable, delicious meal or simply wish to taste local flavors, this place delivers. If you find yourself in town, take a detour and give it a try—you won’t regret it! Our total bull about 110 GEL.