Search This Blog

Showing posts with label Debian. Show all posts
Showing posts with label Debian. Show all posts

Monday, October 2, 2023

Fixed anydesk display server not supported

This set of commands and instructions is meant to address an issue with AnyDesk on a remote server where the display configuration is not supported. AnyDesk is a remote desktop software that allows users to access and control remote computers. The issue mentioned here seems to be related to configuring the server's display settings and enabling automatic login for a specific user.


These are the steps to resolve the AnyDesk remote server display issue:

1. Login to the Terminal: You'll need to access your server's terminal as a superuser (root). Use the following command to become the superuser:

 sudo su

 You'll be prompted to enter your system password. Provide the password to gain superuser privileges.


2. Open custom.conf with an editor: This step involves editing the "custom.conf" file using the nano text editor. Use the following command to open the file:

  sudo nano /etc/gdm3/custom.conf

 Inside the "custom.conf" file, you need to uncomment (remove the "#" symbol) from the following lines:

   WaylandEnable=false

   AutomaticLoginEnable = true

   AutomaticLogin = $USERNAME


   After making these changes, your "custom.conf" file should look like the provided example.

# GDM configuration storage

#

# See /usr/share/gdm/gdm.schemas for a list of available options.

[daemon]

# Uncomment the line below to force the login screen to use Xorg

WaylandEnable=false

# Enabling automatic login

AutomaticLoginEnable = true

AutomaticLogin = $USERNAME

# Enabling timed login

#  TimedLoginEnable = true

#  TimedLogin = user1

#  TimedLoginDelay = 10

[security]

[xdmcp]

[chooser]

[debug]

# Uncomment the line below to turn on debugging

# More verbose logs

# Additionally lets the X server dump core if it crashes

#Enable=true


3. Configure login password: Set the AnyDesk login password to "G@^e$#" using the following command:

   echo "G@^e$#" | sudo anydesk --set-password

   This command will configure the AnyDesk password to the specified value.


4. Reboot your Server: To apply the changes and ensure that AnyDesk works with the updated configuration, you should reboot your server. Use the appropriate command for your server's operating system to do so.

After completing these steps and rebooting your server, the AnyDesk issue related to display support should be resolved, and you should be able to use AnyDesk for remote access without problems.


*** THE END ***

YOUTUBE LINK: @GTechInformations

INSTAGRAM LINK: @gtechinformations


For more information, please subscribe and continue to support us on all our platforms.


Automatic Restart Apache2 When It Goes Down

Managing the availability of your Apache2 web server is crucial to ensure uninterrupted web services. In the event that Apache2 unexpectedly stops, whether due to system issues or other reasons, it's essential to have a mechanism in place to automatically restart it. This guide will walk you through the process of creating a shell script and setting up a Systemd service that monitors Apache2's status and automatically restarts it if it's not running. These instructions are applicable to Ubuntu, Debian, and CentOS Linux distributions.

Follow the step-by-step instructions below to create an automated Apache2 restart system on your Ubuntu, Debian, or CentOS server:

Step 1: Login to the Terminal

Access your server's terminal by logging in as a superuser (root) with the following commands:

sudo su

You'll be prompted for your system password (Enter with your System password).


Step 2: Create a Shell Script to Restart Apache2

Create a shell script named `restart_apache.sh` and open it for editing:

nano /usr/local/bin/restart_apache.sh

Add the following content to the file:

#!/bin/bash

while true; do

    if ! systemctl is-active --quiet apache2; then

        echo "Apache2 is not running. Restarting..."

        systemctl restart apache2

    fi

    sleep 5

done

Save the file and exit the text editor.


Step 3: Make the Script Executable

Make the script executable with the following command:

chmod +x /usr/local/bin/restart_apache.sh


Step 4: Create a Systemd Service

Create a Systemd service file named `apache_restart.service` and open it for editing:

nano /etc/systemd/system/apache_restart.service

Add the following content to the file:

[Unit]

Description=Apache2 Restart Service

After=network.target

[Service]

ExecStart=/usr/local/bin/restart_apache.sh

Restart=always

User=root

Group=root

[Install]

WantedBy=multi-user.target

Save the file and exit the text editor.


Step 5: Enable and Start the Service

Enable the newly created service and start it:

sudo systemctl enable apache_restart.service

sudo systemctl start apache_restart.service

With these instructions, you will have established an automatic Apache2 restart mechanism on your Ubuntu, Debian, or CentOS server. This ensures that Apache2 automatically restarts if it unexpectedly stops, maintaining uninterrupted web server operations.


YOUTUBE LINK: @GTechInformations

INSTAGRAM LINK: @gtechinformations


For more information, please subscribe and continue to support us on all our platforms.

Sunday, October 1, 2023

Automatic Restart MySQL When It Goes Down

Managing the availability of your MySQL database is critical for uninterrupted service. In the event that your MySQL server unexpectedly stops, whether due to system issues or any other reason, it's essential to have a mechanism in place to automatically restart it. This blog post will guide you through the process of creating a shell script and setting up a Systemd service that monitors MySQL's status and automatically restarts it if it's not running. These instructions are applicable to Ubuntu, Debian, and CentOS Linux distributions.


Follow the step-by-step instructions below to create an automated MySQL restart system on your Ubuntu, Debian, or CentOS server:


[Step 1: Login to the Terminal]

Access your server's terminal by logging in as a superuser (root) with the following commands:

sudo su

You'll be prompted for your system password (Enter with your System password).


[Step 2: Create a Shell Script to Restart MySQL]

Create a shell script named `restart_mysql.sh` and open it for editing:

nano /usr/local/bin/restart_mysql.sh

Add the following content to the file:

#!/bin/bash

while true; do

    if ! systemctl is-active --quiet mysql; then

        echo "MySQL is not running. Restarting..."

        /etc/init.d/mysql start

    fi

    sleep 5

done


Save the file. its looks like below image



[Step 3: Make the Script Executable]

Make the script executable with the following command:

chmod +x /usr/local/bin/restart_mysql.sh


[Step 4: Create a Systemd Service]

Create a Systemd service file named `mysql_restart.service` and open it for editing:

nano /etc/systemd/system/mysql_restart.service

Add the following content to the file:

[Unit]

Description=MySQL Restart Service

After=network.target

[Service]

ExecStart=/usr/local/bin/restart_mysql.sh

Restart=always

User=root

Group=root

[Install]

WantedBy=multi-user.target


Save the file. its looks like below image



[Step 5: Enable and Start the Service]

Enable the newly created service and start it:

sudo systemctl enable mysql_restart.service

sudo systemctl start mysql_restart.service


[Step 6: Check the Status of the Service]

You can check the status of the MySQL restart service using the following command:

sudo systemctl status mysql_restart.service

This command will display information about the service, including whether it's active and running.

*** THE END ***

By following these steps, you will have set up an automatic MySQL restart mechanism on your Ubuntu, Debian, or CentOS server, ensuring that your MySQL database restarts seamlessly whenever it unexpectedly stops, thereby maintaining uninterrupted database operations.