Latest posts

Browse topics

Configuring Nginx to Display 404 Page for Unconfigured Domains and Server IP Address

In today's digital age, it is crucial for website owners to have a properly configured web server.

This not only ensures a smooth and seamless user experience but also protects the website from potential security threats.

One common issue that website owners face is incorrectly indexed links in search engines like Google. In this article, we will provide a simple guide on how to configure Nginx to display a 404 page for unconfigured domains and your server's IP address.

The first step in this process is to create a dummy or default domain folder. This folder will serve as a redirect for all incorrect requests made to the website. To create this folder, open the terminal and enter the following commands:

sudo mkdir -p /srv/www/default sudo usermod -a -G www-data admin sudo chown -R www-data:www-data /srv/www sudo chmod -R 775 /srv/www

Once the dummy domain folder has been created, the next step is to configure Nginx server blocks for this folder. Open the Nginx configuration file by entering the following command in the terminal:

sudo nano /usr/local/nginx/sites-available/default

In the Nginx configuration file, paste the following code:

server{ listen 80 default; root /srv/www/default; }

Next, enable the domain by creating a symbolic link between the available and enabled folders in Nginx:

sudo ln -s /usr/local/nginx/sites-available/default /usr/local/nginx/sites-enabled/default

The final step is to create a basic HTML index.html file and upload it to the /srv/www/default folder. This file will display the content that will be shown when accessing the server's IP address or an unconfigured domain.

After uploading the index.html file, restart Nginx by entering the following commands in the terminal:

sudo /etc/init.d/nginx stop sudo /etc/init.d/nginx start

Now, try accessing the server's IP address in a web browser. You should see the content from the index.html file that you created.

In conclusion, configuring Nginx to display a 404 page for unconfigured domains and server IP addresses is a simple process that can help to protect your website from potential security threats and ensure a smooth user experience.

Improve User Experience with Image Hover Effects for Drupal Thumbnail Images

Drupal is a powerful and flexible content management system that enables you to create visually appealing and engaging websites. One way to enhance the visual impact of your Drupal site is to add image hover effects to your thumbnails.

In this article, we'll explore how to use Drupal to create image hover effects for thumbnails.

Step 1: Install and Configure the Image Hover Effects Module

To create image hover effects for your Drupal thumbnails, you'll need to install and configure the Image Hover Effects module. This module allows you to apply a variety of hover effects to your images, including zoom, rotate, flip, and more.

Once you've installed the module, you can configure it by going to the module settings page in the Drupal admin interface. From there, you can choose which hover effects to enable, customize the settings for each effect, and apply the effects to specific image fields on your site.

Step 2: Create a Thumbnail Image Field

To add thumbnails to your Drupal site, you'll need to create an image field for your content type. This can be done using the Drupal core Fields module, which allows you to create custom fields for your content types.

Once you've created the image field, you can configure its display settings to show the image as a thumbnail. You can also choose the size of the thumbnail and any other display settings you want to apply.

Step 3: Apply the Image Hover Effect to Your Thumbnails

Now that you've created your image field and enabled the Image Hover Effects module, you can apply the hover effect to your thumbnails. To do this, you'll need to go to the display settings for your image field and choose the hover effect you want to apply.

You can also customize the settings for the hover effect, such as the speed of the animation, the color of the overlay, and other options.

Step 4: Preview and Test the Image Hover Effect

Once you've applied the image hover effect to your thumbnails, you can preview and test it to make sure it looks and works as expected. You can do this by viewing the content on your Drupal site that uses the image field and hovering over the thumbnail to see the effect in action.

If you're not happy with the result, you can go back to the module settings or the display settings for your image field to make any necessary changes.

Conclusion

Adding image hover effects to your Drupal thumbnails is a great way to enhance the visual appeal of your site and make it more engaging for visitors. With the Image Hover Effects module, it's easy to apply a variety of hover effects to your images and customize the settings to suit your needs. By following the steps outlined in this article, you can create stunning image hover effects for your Drupal site in no time.

Dauphinoise potatoes

Time by time, I like to experiment with food preparation, this time I decided to make a Dauphinoise potato, inspired by BBC Good Food recipe. 

As it might happen, it happened this time as well - I didn't stick to BBC food preparation methodology.

What did I do?

I sliced potatoes, made a bechamel sauce. Took a pan, made the first layer with bechamel sauce, few rows with sliced potatoes, again bechamel sauce, salt, and pepper, again sliced potatoes. Actually kinda a lasagna from potatoes, right?

Baked for about 1 hour at 200° C... at the end added cheese for toppings.

I liked it. Good with some meatballs. 

Display YouTube videos on Drupal site with YouTube field module

Recently I started a new topic series - documentaries, where I publish documentaries I have watched and recommend to watch others. I write a brief description of what each documentary is, and then I embed a YouTube link to show a video on my blog. 

How To Embed YouTube video in Drupal 8 (CKEDITOR)

But lately I started to think of creating my own Screen-casts, and the idea of embedding a video on content didn't satisfy me anymore.

What I wanted - to populate a video in the field, so later by using views I can display video on top of content, not in the content:

 

To achieve this, I just needed to add one small module and create a new view.

  • Download YouTube module
  • Extract it to sites/all/modules
  • Enable it from modules page
  • Add a new YouTube field to your Content type field

I will not write this time how to create a view containing your video, it's too straightforward if you are familiar with views, if not, please leave a comment below, and I'll guide you through in some of my next posts.

Upgrading Your Drupal 7 Site: Tips and Tricks for a Smooth Transition (Minor Upgrade)

Upgrading a website can be a daunting task, especially if you're not familiar with the process. But upgrading your Drupal site is necessary for security, bug fixes, and new features. In this article, I'll be discussing the process of upgrading a Drupal 7.10 site to the newest version of Drupal, a minor upgrade.

Before you start, it's important to understand the difference between a major and a minor upgrade. A major upgrade, such as upgrading from Drupal 6 to Drupal 7, involves significant changes in the codebase and can result in breaking your site. A minor upgrade, on the other hand, is a more straightforward process that brings small updates and bug fixes to your site. In this article, we'll be focusing on the latter.

The first step in upgrading your Drupal 7.10 site to the newest version is to back up your entire Drupal system, including files and database. This is crucial in case something goes wrong during the upgrade process. You can use a backup module, such as Backup and Migrate, to create a backup of your site. Make sure to store the backup in a secure location, such as an external hard drive or cloud storage.

Once you have a backup of your site, it's time to upgrade. The process of upgrading a Drupal 7.10 site to the newest version of Drupal involves two steps: updating the codebase and updating the database.

To update the codebase, you can use the manual method or the drush method. The manual method involves downloading the latest version of Drupal from the official website and uploading it to your server. Then, you'll need to copy the settings.php file and the files directory from your old site to the new site. Finally, you'll need to run the update.php script to complete the upgrade.

The drush method is a more efficient way to upgrade your site, as it automates the process. If you have drush installed on your server, simply run the following command:

drush up drupal

This command will update your Drupal site to the newest version.

Once the codebase has been updated, it's time to update the database. To do this, you'll need to log into your site as an administrator and run the update.php script. This script will perform any necessary database updates, such as updating the schema and data structures.

It's important to note that the update.php script should only be run once. Running it multiple times can cause issues with your site.

After the update.php script has been completed, you'll need to clear the cache and check your site to make sure everything is working as expected. If you encounter any issues, it's important to address them immediately. You can use the backup you created earlier to restore your site if necessary.

In conclusion, upgrading your Drupal 7.10 site to the newest version of Drupal is a straightforward process that can bring many benefits to your site, including security, bug fixes, and new features. By following the steps outlined in this article, you can ensure a smooth upgrade process and avoid any potential issues. Remember to always back up your site before upgrading and to address any issues as soon as they arise.