Tag: Ubuntu

How to increase the swap partition in Linux Mint and Ubuntu. How to create a Swap file in Linux

In this article, using Linux Mint and Ubuntu as an example, we will learn how to view information on the swap partition, create a swap file, and also increase the space available for swap.

The swap file is a specific place on permanent storage (for example, on a hard disk), where data that does not fit in RAM is temporarily dumped. That is, it is an opportunity to increase the amount of RAM without buying RAM modules. But such a “virtual” RAM is slower.

You can view the current size of the swap partition with the command:

swapon --show

Or with the free command:

free -h

Or with top:


As you can see, there is a 2 GB swap file on the system, which, let's say, is not enough.

Disable and delete this paging file with the following commands:

sudo swapoff -a
sudo rm -f /swapfile

There must be enough space on the disk to fit the swap file of the size you specified.

To create an 8G swap file (change the value as you wish) run the command:

sudo fallocate -l 8G /swapfile

Then run the commands:

sudo chmod 600 /swapfile
sudo mkswap /swapfile
sudo swapon /swapfile

Open System Monitor to make sure the system uses the swap file:

Or you can do it with the command:

swapon --show

That's all! You don't even need to reboot your system for the changes to take effect.

By the way, if you go again to change the size of the paging file (up or down – it doesn’t matter), then exactly follow the same instructions again, but specify a different size when creating the paging file.

How to delete swap file in Linux Mint and Ubuntu

To completely remove the paging file, run the commands:

sudo swapoff -a
sudo rm -f /swapfile

Then open the /etc/fstab file:

sudo gedit /etc/fstab

And remove the line from it:

/swapfile none swap defaults 0 0

Error “fallocate: fallocate failed: Text file busy”

If you encounter an error:

fallocate: fallocate failed: Text file busy

This means that you want to create a swap file, but a file with the same name already exists and is still in use.

To disable and remove it, run the commands:

sudo swapoff -a
sudo rm -f /swapfile

Managing Swap files on other Linuxes

To increase or create a swap file on other distributions, see the articles:

How to create a swap partition on another drive

You don't have to use the system disk for the swap, which can be low on space. You can create a partition on any drive in the system. For details, see the instruction “How to create a swap partition not on the system drive. How to move the swap partition to another disk”.

How to check swap file usage in Linux

Stress testing the system in a out of RAM scenario: How to check Swap file usage in Linux

How to connect a TV to a computer in Linux in GNOME (Ubuntu)

Is it possible to connect a TV or a second monitor to a computer in Linux

This post will show you how to connect a TV or a second monitor to a Linux computer with the GNOME desktop environment. It will also talk about the available settings and solutions to typical problems that arise when connecting a TV to a computer.

GNOME is used in distributions such as Ubuntu, and the GNOME desktop environment can be installed on any other distribution.

If you have a different desktop environment, then see the articles:

If you are a Windows user, then see the article “How to connect a TV to a computer in Windows 11”.

What you need to connect a TV or an additional monitor to a computer

To connect a TV or a second monitor to a computer or laptop, you need:

  • TV with HDMI connector (all modern models) or monitor with HDMI connector (all monitors released in the last two decades)
  • a computer with an HDMI connector – almost all computers and laptops will fit
  • HDMI cable

Choosing an HDMI cable

I approached the choice of HDMI cable quite simply – I chose the cheapest with the right length, which I found in the store. In subsequent use, this cable fully satisfied my needs.

Despite its cheapness, this HDMI cable supports:

  • UHD 4K@2160P / 4K@60Hz / 4K HDR
  • High Speed HDMI 2.0
  • Gold plated contacts

Cable length 1.8 meters.

Apparently, these are already the minimum characteristics – perhaps more expensive models support higher resolutions and data transfer at higher speeds.

What TV can be connected to a computer

Using an HDMI cable, you can connect any TV with an HDMI connector. This connector is present on all TVs and monitors released in the last decade.

Older TVs without an HDMI connector can also be connected to a computer, but instead of an HDMI cable, you will need a wire with an adapter.

As for the technical characteristics of the TV (diagonal size, screen resolution, screen refresh rate, aspect ratio), this is not critical. That is, you do not have to select a TV model with the same characteristics as your monitor. Modern video cards support a variety of modes (screen resolutions and refresh rates), including the video card will work with a TV if the screen resolution is different from the monitor.

For example, the characteristics of my devices:

  • laptop monitor: 17", 1920×1080, 16:9, 120 Hz
  • TV (all specifications): 32", 1366x768p, 16:10, 60Hz

That is, these are two very different devices, but at the same time I had no problems when they worked together.

How to connect HDMI cable to TV

Plug the HDMI cable into the connectors of the computer (laptop) and TV.

Both on the computer and on the TV, there may be several HDMI connectors – remember the number of the selected connector.

Turn on your computer and TV.

Note: The HDMI cable can be connected when the computer and TV are already on.

Use the remote control to select “HDMI” as the input source on the TV.

If, after selecting HDMI as the signal source on the TV, you see the message “No Input Signal”, then:

  1. Select HDMI with a different number.
  2. Move the wire, it may not be firmly connected to the computer or TV socket.
  3. Make sure your computer is on.
  4. The monitor on the computer should not be turned off due to inactivity.

How to use a TV connected to a computer

There are two main modes:

  • join displays
  • mirror (duplication) of images on both displays

When displays are combined, the total space expands. That is, if you connected another 1920×1080 display to a computer with one 1920×1080 display, then now the resolution of your virtual screen becomes 3840×1080, if there are three such displays, the resolution will become 5760×1080. You can drag program windows from one display to another. Some apps and games support these wide virtual screens.

When the image is repeated (Mirror), the same image will be shown on both displays.

Among the displays, Primary stands out. This is the one connected first. A feature of the main display is that it shows desktop shortcuts, although this can be changed in the settings.

In the next video, the TV is connected to the computer. To play a YouTube video on a TV, the web browser window is dragged from the monitor to the TV. The video begins by selecting HDMI as the audio output source to play audio on a TV instead of playing it on a computer (laptop).

Where are the settings for the second display and TV

Open Settings, go to the “Display” section.

Or immediately find the “Display” editing window in the Start menu.

Here you will see the display settings.

Select the display (or TV) you want to customize.

Each display will have its own set of settings.

The following groups of settings are presented:

  1. Display mode selection
  2. Selecting the Physical Location of Displays
  3. Selecting the Primary Display
  4. Customization of orientation, resolution, scaling, refresh rate of individual displays.

How to set the Primary monitor

By default, the Primary monitor shows the Top bar, Activities, and desktop shortcuts (if you have created them). You can change the monitor that will be considered the primary monitor, i.e. select a new primary monitor. For this:

1. Open the Settings app, go to the “Display” section.

2. In the Primary Display drop-down list, select the monitor that you want to make the primary.

3. Click the “Apply” button.

How to turn off the display or TV in the settings, without physically disconnecting

You can disconnect the HDMI cable from your TV or computer at any time, but this is not always convenient. In addition, you may want to turn off the computer monitor or the laptop's built-in monitor.

To turn off any monitor or TV in settings, open “Display” settings.

Select “Single Display” mode.

Then select the monitor you want to keep active (all others will be disabled).

Click the “Apply” button.

A disabled monitor will stop working (it will no longer receive a signal), but the disabled monitor will still be available in the settings. You can turn it back on at any time.

How to enable a display disabled in settings

Open the “Display” settings.

Select “Join Displays” or “Mirror” mode.

Click the “Apply” button.

This will automatically enable disabled monitors.

How to make the TV show the same thing as the monitor

Go to Setting → Display.

Select the “Mirror” option.

Click the “Apply” button.

As a result, the resulting settings for both monitors at once will be shown.

Now the output on the monitor and TV is the same:

You may notice that the picture is slightly cropped on the TV, this is due to the fact that the aspect ratio of the monitor built into the laptop and the TV is slightly different.

You can choose a different screen resolution and aspect ratio in the “Resolution” setting.

As a result, now the image on the TV is not cropped, but on the laptop monitor, blank bars appear on the sides of the screen.

How to make the TV become an extension of the monitor

Go to Setting → Display.

Select the “Join Displays” option.

In this case, one of the monitors will be considered the main one. In this case, each of the monitors will show its own desktop, which, in fact, is one.

Why can't I drag the program window to the second screen

If you see two displays in the settings, but you cannot drag the program window to the TV or the second display, then try dragging the window to the other side. That is, if you, for example, are trying to drag a program window to the left side, then try dragging it to the right side instead.

The fact is that the physical location of the second monitor (TV) and its location in the settings can be different. To fix this, swap the monitors in the settings.

In addition to the location of the monitors to the left and right of each other, other options are possible.

You can place one of the monitors (or TVs) above the other.

In this case, the screen resolution and desktop area will change accordingly.

If you have many monitors, you can place them however you want, not all monitors need to be in a straight line horizontally. You can arrange them, for example, as 3×2, that is, two rows of 3 monitors.

How to make the taskbar (Top bar) show on all monitors

If you want the Top bar (taskbar) to be shown on all connected monitors and TVs, then follow these steps.

Go to Setting → Appearance, in the “Dock” section, find the setting with the “Show on” drop-down list.

The following options will be offered:

  • All displays
  • Primary display
  • Built-in display
  • [List of connected monitors and TVs]

Select the “All displays” setting.

After that, the Taskbar will be shown on all monitors.

In this case, if the program window is opened using the Taskbar (Favorites), the program will appear on the monitor on which the Taskbar is located, the button of which was clicked.

The following video shows Ubuntu with a TV connected. The Ubuntu setting is set to “Join Displays” mode (combining displays), as well as showing the Taskbar on all monitors. The result shows an example of opening application windows on the TV and monitor and working in these applications.

Why is the sound played through a computer (laptop) and not through a TV

An HDMI cable can carry both video and audio. But even after connecting the TV with an HDMI cable, the sound is still output from the laptop speakers or computer speakers.

To change the audio output source, go to the audio settings. This can be done via Setting → Sound.

Or find this settings window through the start menu.

Find the “Output Device” setting.

Select the HDMI device from the dropdown list.

Why did the sound disappear after turning off the TV on the laptop (computer)

To change the audio output source, go to the audio settings. This can be done via Setting → Sound.

Or find this settings window through the start menu.

Find the “Output Device” setting.

In the drop-down list, select the “Speakers - Built-in Audio” device.

How to install the latest version of Tor on Ubuntu

How to get the latest version of Tor on Ubuntu

The tor package is present in the Ubuntu repositories, but its version may be out of date. This is especially true for Ubuntu distributions released several years ago, even if they have long-term support (LTS).

In new versions of Tor, identified weaknesses and vulnerabilities are eliminated, as well as updating and supplementing the functionality. For this reason, you may need to install the latest version of the tor package.

Like other programs on Linux, you can compile Tor from source, and this article will show you how. Fortunately, the Tor developers maintain a binary repository for Ubuntu and Debian distributions.

In this guide, we will look at two ways to install a fresh version of Tor – from the repositories and from the source code.

How to install Tor from the Tor developers repositories

The Tor Project has its own Debian repository. Debian itself includes an LTS version of Tor. With it, you will not always be able to have the latest and most stable version of Tor. Therefore, it is recommended to install tor from the Tor Project repository.

This section will show you how to enable the Tor package repository on Debian-based Linux distributions.

Prerequisite: Verify the CPU architecture

The package repository offers amd64, arm64, and i386 binaries. Verify your operating system is capable of running the binary by inspecting the output of the following commend:

dpkg --print-architecture

It should output either amd64, arm64, or i386. The repository does not support other CPU architectures.

Note on Raspbian: The package repository does not offer 32-bit ARM architecture (armhf) images (yet). You should either install the version Debian offers (make sure to check out Debian backports, too, as that one has often a more up-to-date Tor package), or build Tor from source.

1. Install apt-transport-https

This step is only required for apt versions below 1.5. Support for https was added in versions of apt 1.5 and later, so currently the apt-transport-https package is kept in the repository for compatibility only and can be removed from the system without consequences.

To check the version of apt use the command

apt --version

On older distributions, you may need to install this package:

sudo apt install apt-transport-https

2. Create a new file in /etc/apt/sources.list.d/ named tor.list.

sudo gedit /etc/apt/sources.list.d/tor.list

Add the following entries:

deb [signed-by=/usr/share/keyrings/tor-archive-keyring.gpg] https://deb.torproject.org/torproject.org <DISTRIBUTION> main
deb-src [signed-by=/usr/share/keyrings/tor-archive-keyring.gpg] https://deb.torproject.org/torproject.org <DISTRIBUTION> main

In these lines, replace <DISTRIBUTION> with your operating system code. Run

lsb_release -c

to find out the operating system code.

The following command will output only the distribution code (the command is suitable for use in scripts):

lsb_release -c | awk '{print $2}'

Note. Starting with Ubuntu Focal, 32-bit applications are no longer supported, so when using sudo apt update, you may encounter the message:

Skipping acquire of configured file 'main/binary-i386/Packages' as repository 'http://deb.torproject.org/torproject.org focal InRelease' doesn't support architecture 'i386'

To get rid of this message, the entries in the /etc/apt/sources.list.d/tor.list file need to be edited to be in the following format:

   deb     [arch= signed-by=/usr/share/keyrings/tor-archive-keyring.gpg] https://deb.torproject.org/torproject.org focal main
   deb-src [arch= signed-by=/usr/share/keyrings/tor-archive-keyring.gpg] https://deb.torproject.org/torproject.org focal main

Replace <ARCHITECTURE> with the architecture of your system, which can be viewed with the command

dpkg --print-architecture

For example:

deb [arch=amd64 signed-by=/usr/share/keyrings/tor-archive-keyring.gpg] https://deb.torproject.org/torproject.org impish main
deb-src [arch=amd64 signed-by=/usr/share/keyrings/tor-archive-keyring.gpg] https://deb.torproject.org/torproject.org impish main

3. Then add the gpg key used to sign the packages by running the following command at your command prompt:

wget -qO- https://deb.torproject.org/torproject.org/A3C4F0F979CAA22CDBA8F512EE8CBC9E886DDD89.asc | gpg --dearmor | sudo tee /usr/share/keyrings/tor-archive-keyring.gpg >/dev/null

4. Install tor and tor debian keyring

It is provided a Debian package to help you keep the latest version of your signing key. To install, use the following commands:

sudo apt update
sudo apt install tor deb.torproject.org-keyring

Source: https://support.torproject.org/apt/tor-deb-repo/

How to compile and install Tor from source on Ubuntu and Debian

This method differs from the previous one from a practical point of view in at least two important points:

  1. You need to keep track of new versions and update Tor yourself
  2. With this method, tor.service files are not created, that is, it will not be possible to manage the service using systemd with commands like
sudo systemctl start tor

To compile tor run the following commands:

sudo apt remove tor
sudo apt update
sudo apt install git make build-essential automake autoconf libevent-dev libssl-dev zlib1g-dev zlib1g asciidoc liblzma-dev libzstd-dev systemd libsystemd-dev pkg-config libnss3-dev
git clone https://github.com/torproject/tor
cd tor
sh autogen.sh
./configure --enable-systemd --enable-nss

Note that if the make command throws an error

make: *** No targets specified and no makefile found. Stop.

this means that the previous configure command failed. You need to return to its output and look in the last lines for the name of the missing package or another reason due to which the configuration failed.

After a successful compilation configuration, the installation is done like this:

sudo make install

To start Tor run the command:


A sample configuration file is located at /usr/local/etc/tor/torrc.sample, you can use this as a base to configure Tor:

sudo cp /usr/local/etc/tor/torrc.sample /usr/local/etc/tor/torrc

Should I install Tor from my package manager or build from source?

If you are using Debian or Ubuntu, installing Tor from the Tor Project repository has several advantages:

  1. Your ulimit -n is set to 32768, which is enough for Tor to keep all necessary connections open.
  2. The user profile is created only for Tor, so Tor does not need to be run as root.
  3. An init script is included in the package so that Tor can be configured to start on boot. You can use systemd and systemctl to control the service
  4. Tor works with the --verify-config option, which means that before starting the service, the configuration file will be checked for correctness – this can help you solve problems if the service is not running.
  5. Tor can bind to low-level ports and then lower the privileges of its process.

See also: More Tor manuals

Do services need to be restarted when updating packages

Package configuration: whether to restart the service

During the installation of package updates and their configuration, the apt program may ask you to restart the service:

There are services installed on your system which need to be restarted when certain libraries, such as libpam, libc, and libssl, are upgraded. Since these restarts may cause interruptions of service for the system, you will normally be prompted on each upgrade for the list of services you wish to restart. You can choose this option to avoid being prompted; instead, all necessary restarts will be done for you automatically so you can avoid being asked questions on each library upgrade. Restart services during package upgrades without asking?

This message can be confusing, especially the phrase “cause interruptions of service for the system”. In fact, the essence is quite simple – the binaries have been updated and you need to restart the services that use them so that they start using the updated versions of the files.

The name of the package that requires the service to be restarted is in the upper left corner, in the screenshot it is libc6, i.e. “GNU C Library: Shared libraries”. It contains the standard libraries that are used by nearly all programs on the system. This package includes shared versions of the standard C library and the standard math library, as well as many others.

What kind of interruptions can a service restart cause?

Examples of the consequences of restarting services:

  • at the time of restarting the web server service, sites will be unavailable to users
  • when restarting the caching proxy server, the cache stored in RAM will be deleted
  • restarting network services can lead to connection drops (but in practice this does not always happen)

That is, the possible consequences of restarting services on the home computer are insignificant – you can safely restart.

As far as restarting services on a server, for example, restarting the SSH server usually doesn't break the connection. You need to evaluate the consequences of restarting other services based on your situation.

See also:

Wine is missing from the context menu on Ubuntu (SOLVED)

To run Windows applications on Linux, it is usually enough to double-click on them. But it may be that the .exe file will be opened by the archive manager or another application (usually the archive manager).

If you try to select the “Open With Other Application” item in the context menu, then Wine will not be there. Even worse, it is impossible to add a custom command, that is, it is impossible to launch an .exe program with a double click or through the context menu.

First, make sure Wine is installed on your system. To do this, run the command

which wine

If the output contains the path to the executable file, for example, /usr/bin/wine, then this means that Wine is installed.

If nothing is shown in the output, it means that you first need to install the Wine package.

This can be done with the following set of commands:

sudo dpkg --add-architecture i386
sudo apt update
sudo apt install wine winbind

Windows applications can be launched from the command line using a command similar to the following:


But this is not very convenient, so let's look at how to add Wine to the context menu in Ubuntu.

On Ubuntu (GNOME 3) Wine is missing from the context menu and it is not possible to add a custom command. To fix, do the following:

sudo ln -s /usr/share/doc/wine/examples/wine.desktop /usr/share/applications/

If you encounter an error that the wine.desktop file is missing, then find it with the following command and edit the above command:

locate wine.desktop

Right-click on the .exe file and select the item called “Open With Other Application”.

Then select “View All Application”.

Click on “Wine Windows Program Loader” and then click on the “Select” button.

Ubuntu in VirtualBox does not stretch to full screen although Guest Additions are installed (SOLVED)

1. Are the Guest Additions actually installed?

First, make sure you actually have Guest Additions installed.

It is recommended to update the guest OS to the latest package versions:

sudo apt update
sudo apt full-upgrade

After the update is complete, restart your computer:


There is a guest additions package in the standard repositories. It can be installed as follows:

sudo apt update
sudo apt install virtualbox-guest-dkms

2. Enabling full screen mode and resizing the guest OS screen

To switch to full screen mode, press Host+A, or go to Menu → View → Full screen mode.

If this did not help either, then maximize the virtual machine window to the maximum, then go to Menu → View → Auto-resize Guest Display.

3. Changing the type of graphics controller

If that doesn't work, try with different graphics controllers. With the virtual machine turned off, you need to go to its settings, then to the Display tab.

On this tab, you need to set VMSVGA or VboxVGA as the Graphics controller - try different controllers and see which one works with “Auto-resize Guest Display”.

4. Reinstallation and reconfiguration of virtualbox-guest-dkms:

sudo apt remove virtualbox-guest-dkms --purge
sudo apt install virtualbox-guest-dkms
sudo dpkg-reconfigure virtualbox-guest-dkms

5. Increase the video memory size

In the settings of the virtual machine, increase the video memory size to the maximum

6. Manually change the screen resolution settings

Go to the screen resolution settings of your guest virtual machine and select another, more appropriate.


Some of these methods should help you. Write in the comments – which one, it will help other users who have encountered the exact same problem.

If all else fails, then it is recommended to update VirtualBox to the latest version, and also make a full system update and reboot:

sudo apt update && sudo apt full-upgrade -y

How to install a web server (Apache, PHP, MySQL, phpMyAdmin) on Linux Mint, Ubuntu and Debian

If you are a webmaster, or a PHP programmer, or you just need to run a website on your computer, then you can do it using a web server. On Linux, the web server (Apache) and related components (PHP, MySQL, phpMyAdmin) are installed in just a few commands.

This tutorial will show you how to set up a web server for sites on Linux Mint, Ubuntu and Debian.

How to install Apache, PHP, MySQL, phpMyAdmin on Linux Mint, Ubuntu and Debian

We will do most of the operations in the command line - the Linux terminal.

Open a terminal and run the following two commands in it:

sudo apt update
sudo apt install apache2 default-mysql-server php phpmyadmin

Answer No to the configuration prompt with dbconfig-common:

Use the Tab key to move between items and Enter to continue.

Select “apache2”:

Use the Space key to select items, use the Tab key to move between items, and press Enter to continue.

That's all! The web server (a bunch of Apache, PHP, MySQL, phpMyAdmin) is installed and ready to work. Open the link http://localhost/ in your browser

You will see the standard Apache page:

phpMyAdmin is available at http://localhost/phpmyadmin/

To start the web server every time you turn on the computer, run the command:

sudo systemctl enable apache2
sudo systemctl enable mysql

How to change URL path of phpMyAdmin. How to enable and disable phpMyAdmin

If during the installation of phpMyAdmin you chose not to configure it for use with the Apache web server, use the command to enable phpMyAdmin:

sudo ln -s /etc/phpmyadmin/apache.conf /etc/apache2/conf-enabled/

Restart the web server for the changes to take effect:

sudo systemctl restart apache2

To disable phpMyAdmin use the command:

sudo rm /etc/apache2/conf-enabled/phpmyadmin.conf

Restart the web server for the changes to take effect:

sudo systemctl restart apache2

There is an important line in the /etc/phpmyadmin/apache.conf file:

Alias /phpmyadmin /usr/share/phpmyadmin

Its essence is that the URL /phpmyadmin (for example, http://localhost/phpmyadmin) begins to correspond to the /usr/share/phpmyadmin folder. That is, the phpMyAdmin files (scripts) are physically located in /usr/share/phpmyadmin, and not in the web server directory (for example, /var/www/html/).

Many automatic scanners of “hidden” files and folders of a web server and sites check the “phpmyadmin”, “pma” and other similar directories. You can hide your phpMyAdmin nicely by changing the Alias. For instance:

Alias /lkjgler94345 /usr/share/phpmyadmin

phpMyAdmin will now be available at http://localhost/lkjgler94345 - not easy to find.

phpMyAdmin setup

By default phpMyAdmin does not allow login without password. If you have not set a password for the MySQL DBMS, then you have two options to choose from:

  • set password
  • make changes to phpMyAdmin setting to allow passwordless login

It is recommended to set a password for the database. To change the password, you can use the script:

sudo mysql_secure_installation

If you want to allow logging into phpMyAdmin without a password, then open the file

sudo gedit /etc/phpmyadmin/config.inc.php

Find the second (there are two) line

// $cfg['Servers'][$i]['AllowNoPassword'] = TRUE;

and uncomment it (remove the two slashes from the beginning of the line) to get:

$cfg['Servers'][$i]['AllowNoPassword'] = TRUE;

Most likely, when connecting, you will receive a surprise in the form of the error “#1698 - Access denied for user 'root'@'localhost'”. Step-by-step actions for its solution in this manual.

Where are the sites on the Apache web server?

By default, the root folder for web documents is /var/www/html. In /var/www you can create your own virtual hosts.

The /var/www/html folder and all files inside it belong to the root user.

For you to be able to modify, add, delete files in this folder, you need to use sudo. For example, with the following command, you will open a file manager to manage the contents of a folder.

sudo nemo /var/www/html

All other programs that make changes to /var/www/html must also be run with sudo.

On a local server, for ease of use, you can make yourself the owner of this folder:

sudo chown -R $USER:$USER /var/www/html

Now you and the programs launched on your behalf do not need superuser privileges to work with the contents of this directory:

nemo /var/www/html

Apache index files

If the user requests from the web server not a file, but a directory, then the server looks for files index.html, index.php, index.htm, etc. in it. If these files are in this directory, then their contents are shown. These files are called index files. If there are two or more such files in a directory at once, then one of them is shown in accordance with the set priority.

You can see which files are index files for your server and in what order their priority is arranged in the file

sudo gedit /etc/apache2/mods-enabled/dir.conf

There you will see something like:

<IfModule mod_dir.c>
    DirectoryIndex index.html index.cgi index.pl index.php index.xhtml index.htm

Typically, users want to move the PHP index file (index.php) to the first position after DirectoryIndex, so that something looks like this:

<IfModule mod_dir.c>
    DirectoryIndex index.php index.html index.cgi index.pl index.xhtml index.htm

After making changes, save and close the file, restart the web server.


This tutorial showed you how to install Apache web server on your Linux Mint machine. In terms of its functionality, this server does not differ from the capabilities of hosting. You can test your sites on it, use it when learning PHP, install WordPress, etc. Moreover, this server can be made available to the local or even global network.

Chromium will no longer sync passwords - what should Linux users do?

Chrome and Chromium on Linux

Everyone knows the Google Chrome web browser. Chromium is at its core. That is, Chromium is the open source web browser that Google builds on the Chrome web browser, adding proprietary (i.e. closed) code to it.

The Chrome browser is distributed by Google itself as compiled files. The Chromium browser is available as open source. For this reason, Chrome is popular among Windows users - most Windows users install binaries compiled by the authors on their system and do not see anything strange in this.

It's a little different on Linux. Linux users also download and install compiled packages, but compilation is done by the distribution maintainers using the source code of the programs. This is in line with the spirit of Linux and its licenses. Closed source packages are placed in separate repositories (package sources for installation).

For this reason, it is Chromium that is prevalent among Linux users, and Chrome is often absent from the repositories. But until recently, browsers were almost identical, so you could use Chromium just like Chrome.

The Chrome/Chromium web browser makes extensive use of Google's APIs. These APIs include, for example, password and bookmark synchronization. But Google announced that from March 2021, some APIs will be available only in the Chrome web browser, but will be disabled in Chromium, as well as in all third-party browsers that use Chromium as their basis. Disabled APIs include password synchronization.

I don't mind third-party web browsers - just imagine that if you log into your Google account on a third-party browser, thanks to the password synchronization function, it gets access to all (!) your passwords on all (!) websites. Many untrustworthy Chromium-based web browsers have sprung up about the creators of which cannot be found and whose source code is not published (sometimes despite their assurances).

But what's really annoying is that important functions will no longer work in Chromium too. From a full-fledged alternative to Chrome, Chromium has now become a web browser with limited functions.

If you don't use password sync, then you have nothing to worry about

Despite the anger of the maintainers of some distributions and threats to stop supporting or even kick the web browser out of the repositories, apparently no one will do it. Therefore, if you do not need the function of synchronizing passwords and bookmarks, then you can safely continue using Chromium on Linux.

But what about Linux users who use Chromium and need password sync and other features? Let's consider several options.

1. Stop using the password sync feature in web browsers

Yes, the fact that all your passwords are stored by strangers is bad, to put it mildly. But it's super convenient if you have more than one device (computer, phone, tablet, second computer, more virtual computers…). But if you think about it, it's like giving the keys to your apartment to an outsider, so that when you appear, he opens and closes the door to your apartment, and you don't have to climb into your pockets for keys. Conveniently. But you have no idea what happens to your keys while you are away.

Therefore, one option is to continue using Chromium, but stop using the password sync feature.

2. Switch to Firefox

Firefox is open source and also has a password sync feature. If you want to show Google that you are not satisfied with this change, you can switch to Firefox. Just in case - if your passwords are synchronized using Firefox, then it is no better or worse than if they are stored by Google.

3. Install Chrome on Linux

In fact, installing Chrome from Google itself on Linux is trivial. So you can go the same route that most Windows users do - just install a web browser with proprietary code.

In Debian, Linux Mint, Ubuntu, Kali Linux and their derivatives, to install Google Chrome, just run the commands:

wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb
sudo dpkg -i ./google-chrome-stable_current_amd64.deb
sudo apt install -f

That's all! At the same time, during the installation of the web browser, the Google repository will be added to the list of repositories and Chrome will be updated along with the rest of the packages in the system.

In Arch Linux, Manjaro, BlackArch and their derivatives, to install Google Chrome, just run the command:

pikaur -S google-chrome

If you have not yet installed pikaur, then install it according to the instructions “Automatic installation and update of AUR packages”.

To update a web browser package, you will need to run a system update using pikaur - this command is to update both packages from the system repositories and from the AUR:

pikaur -Syu

4. Extensions for synchronization with encryption (Bitwarden)

You can install an extension like Bitwarden and continue using Chromium.

Bitwarden uses end-to-end encryption, meaning passwords are synchronized encrypted. Moreover, the source code is open even for the server, that is, you can synchronize without any third-party participants at all.

Bitwarden works with almost any device and browser you can think of: Windows, Mac, Linux; iOS and Android; Chrome, Firefox, Safari, Edge and many other niche browsers. This gives you freedom of movement, unlike browser password managers.


Which option did you choose or, perhaps, made some other decision?

Error “Cannot load modules/libphp7.so” (SOLVED)

Some Linux distributions have already started migrating to PHP 8. In some distributions the new version of PHP removes the old one, as a result of which the web server may stop working due to the fact that the files specified in the web server configuration are missing or renamed.

Examples of errors you may encounter:

httpd: Syntax error on line 504 of /etc/httpd/conf/httpd.conf: Syntax error on line 1 of /etc/httpd/conf/mods-enabled/php.conf: Cannot load modules/libphp7.so into server: /etc/httpd/modules/libphp7.so: cannot open shared object file: No such file or directory

It says the file /etc/httpd/modules/libphp7.so was not found.

Another error that says the /etc/httpd/conf/extra/php7_module.conf file was not found:

httpd: Syntax error on line 504 of /etc/httpd/conf/httpd.conf: Syntax error on line 2 of /etc/httpd/conf/mods-enabled/php.conf: Could not open configuration file /etc/httpd/conf/extra/php7_module.conf: No such file or directory

On some distributions, the Apache web server service is called apache2, and on some httpd. Therefore, this guide will consider both options.

Fix “Cannot load modules/libphp7.so” when webserver service is named httpd (Arch Linux, CentOS and their derivatives)

To view the status of the service and the errors that led to its inoperability, run the command:

systemctl status httpd.service

Open the config file /etc/httpd/conf/mods-enabled/php.conf:

sudo vim /etc/httpd/conf/mods-enabled/php.conf

Find the line in it

LoadModule php7_module modules/libphp7.so

and replace it with:

LoadModule php_module modules/libphp.so

Then find the line

Include conf/extra/php7_module.conf

and replace with:

Include conf/extra/php_module.conf

Restart the web server service:

sudo systemctl restart httpd.service

and check its status:

systemctl status httpd.service

Fix “Cannot load modules/libphp7.so” when webserver service is named apache2 (Debian, Ubuntu, Linux Mint, Kali Linux and their derivatives)

To view the status of the service and the errors that led to its inoperability, run the command:

systemctl status apache2.service

Disable PHP 7.* module:

a2dismod php7.4

Maybe you have a different version of PHP, start typing “a2dismod php” and use the TAB key for autocompletion:

To enable PHP 8 use a command like (use the TAB key for auto-completion):

a2enmod php8

Restart the web server service:

sudo systemctl restart apache2.service

and check its status:

systemctl status apache2.service