Tuesday, September 26, 2023

How to install OCI CLI in CentOS 8 Stream

 How to install OCI CLI in CentOS 8 Stream

The steps mentioned in the internet is not working for me. So this is the working commands.

# yum install python38 -y

# ll /usr/bin/pip3.8

# ll /usr/bin/pip-3.8

# pip3.8 install oci-cli

# oci --version

Monday, September 18, 2023

How to redirect 404 error to the home page

 How to redirect 404 error to the home page

Following steps helps to redirect all 404 error pages to the home page. Assume you already installed httpd in this server.

  • Make sure you enabled "rewrite_modile" (httpd - M | grep rewrite)
  • vi /etc/httpd/conf/httpd.conf (enable AllowOverride from "None" to "All"). Based on your configuration path.
  • vi /var/www/html/.htaccess (ErrorDocument 404 https://example.com)
  • systemctl restart httpd
  • Test it

How to install letsencrypt on Amazon linux 2023

 How to install letsencrypt on Amazon linux 2023

In Amazon linux 2023, EPEL is not available. All the documentations avaialble in internet is about EPEL and then install certbot. But here we need to use a different approach.

  • Login to the server
  • dnf install python3 augeas-libs
  • dnf remove certbot
  • python3 -m venv /opt/certbot/
  • /opt/certbot/bin/pip install --upgrade pip
  • /opt/certbot/bin/pip install certbot certbot-apache
  • ln -s /opt/certbot/bin/certbot /usr/bin/certbot
  • certbot --apache
This works perfectly for me.



Wednesday, September 6, 2023

Single command to checkout all branches in git

 Single command to checkout all branches in git


[yourserver #] for branch in `git branch -a | grep remotes | grep -v HEAD | grep -v master `; do; git branch --track ${branch#remotes/origin/} $branch; done;


This is useful when we do git migrations.

Monday, July 24, 2023

The GPG keys listed for the "MySQL 8.0 Community Server" repository are already installed but they are not correct for this package. Check that the correct key URLs are configured for this repository.

 OS : CentOS 7

Error while installing Mysql

The GPG keys listed for the "MySQL 8.0 Community Server" repository are already installed but they are not correct for this package.

Check that the correct key URLs are configured for this repository.


Fix:


Import new key from rpm --import https://repo.mysql.com/RPM-GPG-KEY-mysql-2022


Yum update

yum install mysql-server

Thursday, June 15, 2023

Access denied for user 'user'@'hostname' (using password: YES) in mysql8

 Error : Access denied for user 'user'@'hostname' (using password: YES) in mysql8

Mysql version is Mysql8

OS is Ubuntu 22

I am sure that i can connect from my both apps servers to the DB from the command shell.

The issue is the mysql user password. In my password, i had some special characters. When we input this password in command prompt, in bash shell it will work. But its not working from nodejs code (.env file)

Solution :

I change the password without a special character and the issue got fixed.