Posts

Showing posts from November, 2020

How to install Let's Encrypt SSL Certificate in Ubuntu 18.04/NGINX?

In this post, we will see, how to install Let's Encrypt SSL Certificate on NGINX webserver. Steps are pretty straight forward and easy. First, add the repository: sudo add-apt-repository ppa:certbot/certbot   You’ll need to press ENTER to accept. Install Certbot’s Nginx package with apt: sudo apt install python-certbot-nginx    Install Let's Encrypt SSL Certificate sudo certbot --nginx -d jenkins.cloudshades.in      Follow the screen and provide the required input. Like email-id, permanent redirection to https etc.

How to reset MySQL root password in Ubuntu in latest Ubuntu versions 18.04 and above

Image
I have forget my MySQL root password and not able to login in phpMyAdmin. I am very bad in MySQL commandline. After long struggle while Googling, I found this solution in Stackoverflow - But this will work only latest Ubuntu version because of enhance security of MySQL.  First, as root, stop the mysql server.  systemctl stop mysql Next, create a /var/run/mysqld directory to be used by MySQL process to store and access socket file:  mkdir -p /var/run/mysqld chown mysql:mysql /var/run/mysqld Check that the newly created directory do exist. Now manually start MySQL with the following linux command and options:  /usr/sbin/mysqld --skip-grant-tables --skip-networking & Confirm that the process is running as expected:  jobs [1]+ Running sudo /usr/sbin/mysqld --skip-grant-tables --skip-networking;  Leave that terminal running and open another terminal, not as root. Now access MySQL database without password:  mysql -u root -p mysql> Using the MySQL session first flush privileges:  FLUS

How to use APACHE/NGINX as reverse proxy?

Image
  In this post we will learn, how can we use apache and NGINX webserver as a reserve proxy. Means if we are using an application of different port and we want to use that application on port 80 or 443. For Apache Step 1: Install apache2 webserver sudo apt-get update sudo apt-get install apache2 -y [Check the apache installed or not and apache version] apache2 -v [Start the apache service if not running] sudo systemctl start apache2     [Enable apache service at boot time] sudo systemctl enable apache2 [Restart apache service] sudo systemctl restart apache2 Step 2: Create a configuration file under /etc/apache2/sites-availbale  [Like I have done in previous Jenkins post] cd /etc/apache2/sites-availbale Step 3: Add the following lines in the jenkins.conf file sudo vim jenkins.conf ServerName jenkins.domain ServerAlias www.jenkins.domain ProxyRequests Off ProxyPass / http://localhost:8080/ ProxyPassReverse / http://localhost:8080/ ProxyPassReverse / http://jenkins.host/ Order allow,deny A