Category: HowTo


Cure of Migraine in Ayurveda


I suffered with migraine in my childhood. My father tried all the modern medicine systems including allopathy and homoeopathy, but all in vain. My head used to ache so heavily that it appeared that it will burst. Finally, I got the medicine during with a vaidya ji (Ayurvedic doctor) at my village. He prescribed a kadha for me with a 21 days course. Seven herbs were used in making this kadha and it worked like a magic. Within first 2 days, my headache went as if it never happened, although I did complete my 21 days course. After that I never got that headache ever again. This is a real magic. The magic of Ayurveda. Folllowing are the herbs used to make that kadha:

  1. Harre
  2. Baheda
  3. Amla
  4. Neem ki chal
  5. Neem ki giloya
  6. Haldi
  7. Cnhirayata

There herbs appear to be very ordinary. But their effect is really magical. These are the hindi names of these herbs.

Preparation of kadha

A 100 grams of mixture of all these herbs in equal quantity needs to be taken everyday and boiled in water so that just a small quantity remains. Then this kadha is filtered and taken. The remaining portion after filteration can be kept and used again in the evening to prepare another dose in the evening. In this way, one 100 gm. bundle can be used 2 times – once in the morning and other in the evening. Next day, a fresh mixture needs to be taken. In this way, a course of 21 days should be completed.


How to configure Windows 11 PC with WSL for LAMP (Linux, Apache, MySQL, PHP) development?


Windows Subsystem for Linux (WSL) is a feature that allows you to run Linux applications natively on Windows 11. It is a great tool for developers who want to use Linux tools and frameworks on their Windows machines. In this article, we will show you how to install and configure WSL for PHP MySQL development using Apache and phpMyAdmin.

Step 1: Enable WSL and install a Linux distribution

Before you can use WSL, you need to enable it on your Windows 11 PC. To do that, follow these steps:

  • Open the Settings app and click on System.
  • On the left pane, click on Developer and then toggle on the Developer mode switch.
  • On the right pane, click on Windows Subsystem for Linux and then click on Install.
  • Wait for the installation to complete and then restart your PC.

After enabling WSL, you need to install a Linux distribution of your choice. You can do that from the Microsoft Store or from the command line. For this article, we will use Ubuntu 20.04 LTS as an example. To install it from the Microsoft Store, follow these steps:

  • Open the Microsoft Store app and search for Ubuntu.
  • Click on Ubuntu 20.04 LTS and then click on Get.
  • Wait for the download and installation to finish and then launch it from the Start menu or the taskbar.
  • The first time you launch it, you will be asked to create a user name and password for your Linux account. Enter them and press Enter.

Step 2: Install Apache, PHP and MySQL on Ubuntu

Now that you have Ubuntu running on WSL, you can install the necessary packages for PHP MySQL development. To do that, follow these steps:

  • Open your Ubuntu terminal (either from the Start menu or by typing wsl in the Run dialog box).
  • Update your Ubuntu packages by running: sudo apt update
  • Install Apache, PHP and MySQL by running: sudo apt install apache2 php mysql-server
  • Secure your MySQL installation by running: sudo mysql_secure_installation and following the prompts.
  • Start Apache and MySQL services by running: sudo service apache2 start and sudo service mysql start

Step 3: Configure Apache, PHP and MySQL on Ubuntu

After installing Apache, PHP and MySQL, you need to configure them to work together. To do that, follow these steps:

  • Create a test PHP file in the default web root directory by running: echo "<?php phpinfo(); ?>" | sudo tee /var/www/html/info.php
  • Edit the default Apache configuration file by running: sudo nano /etc/apache2/sites-available/000-default.conf
  • Find the line that says <VirtualHost *:80> and add this line below it: ServerName localhost
  • Find the line that says DocumentRoot /var/www/html and add this line below it: DirectoryIndex index.php index.html index.htm
  • Save and exit the file by pressing Ctrl+OEnterCtrl+X.
  • Enable the PHP module by running: sudo a2enmod php7.4
  • Test your Apache configuration by running: sudo apache2ctl configtest
  • Restart Apache by running: sudo service apache2 restart

Step 4: Connect to MySQL from Windows

To connect to your MySQL database running on WSL from Windows, you need to change the authentication method for your MySQL user. By default, MySQL uses auth_socket authentication, which is not supported by most Windows applications. To change it to mysql_native_password, follow these steps:

  • Log in to your MySQL shell by running: sudo mysql -u root -p and entering your password.
  • Run this command to change the authentication method for your root user: ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'new-password'; where new-password is a strong password of your choice.
  • Exit the MySQL shell by running: exit
  • Download and install MySQL Workbench or any other MySQL client application on your Windows 11 PC.
  • Launch MySQL Workbench and create a new connection with these settings:
    • Connection name: WSL
    • Hostname: localhost
    • Port: 3306
    • Username: root
    • Password: new-password
  • Click on Test Connection and then on OK if it succeeds.

Step 5: Install phpMyAdmin on Ubuntu

phpMyAdmin is a web-based tool that allows you to manage your MySQL databases using a graphical interface. To install phpMyAdmin on Ubuntu, follow these steps:

  • Install phpMyAdmin by running: sudo apt install phpmyadmin
  • During the installation, you will be asked to choose the web server that should be automatically configured to run phpMyAdmin. Select apache2 and press Enter.
  • You will also be asked whether to configure the database for phpMyAdmin with dbconfig-common. Select Yes and press Enter.
  • You will then be asked to provide the password for the database’s administrative user. Enter the password you set for the root user in step 4 and press Enter.
  • You will also be asked to provide a password for the phpMyAdmin application itself. Enter a strong password of your choice and press Enter. Confirm the password by entering it again and pressing Enter.
  • Restart Apache by running: sudo service apache2 restart

Step 6: Test your PHP MySQL development environment

To test your PHP MySQL development environment, you can create a simple PHP script that connects to your MySQL database and displays some data. To do that, follow these steps:

  • Create a new PHP file in the web root directory by running: sudo nano /var/www/html/test.php
  • Paste this code into the file:
<?php
// Connect to MySQL database
$mysqli = new mysqli("localhost", "root", "new-password", "mysql");

// Check connection
if ($mysqli->connect_error) {
    die("Connection failed: " . $mysqli->connect_error);
}

// Query the database
$sql = "SELECT user, host FROM user";
$result = $mysqli->query($sql);

// Display the results
if ($result->num_rows > 0) {
    echo "<table border='1'>";
    echo "<tr><th>User</th><th>Host</th></tr>";
    while($row = $result->fetch_assoc()) {
        echo "<tr><td>" . $row["user"] . "</td><td>" . $row["host"] . "</td></tr>";
    }
    echo "</table>";
} else {
    echo "No results found";
}

// Close connection
$mysqli->close();
?>

Copy

  • Save and exit the file by pressing Ctrl+OEnterCtrl+X.
  • Open your browser and go to http://localhost/test.php
  • You should see a table with the user and host columns from the mysql.user table.

To test your phpMyAdmin installation, follow these steps:

  • Open your browser and go to http://localhost/phpmyadmin
  • You should see the phpMyAdmin login page. Enter your username (root) and password (new-password) and click on Go.
  • You should see the phpMyAdmin dashboard with your MySQL databases and tables.

Congratulations! You have successfully configured your Windows 11 PC with WSL for PHP MySQL development using Apache and phpMyAdmin. You can now create and run your PHP projects using Apache, PHP, MySQL and phpMyAdmin on Ubuntu. Happy coding! 😊


How to configure Windows 11 PC with WSL for PHP MySQL development?


Windows Subsystem for Linux (WSL) is a feature that allows you to run Linux applications natively on Windows 11. It is a great tool for developers who want to use Linux tools and frameworks on their Windows machines. In this article, we will show you how to install and configure WSL for PHP MySQL development.

Step 1: Enable WSL and install a Linux distribution

Before you can use WSL, you need to enable it on your Windows 11 PC. To do that, follow these steps:

  • Open the Settings app and click on System.
  • On the left pane, click on Developer and then toggle on the Developer mode switch.
  • On the right pane, click on Windows Subsystem for Linux and then click on Install.
  • Wait for the installation to complete and then restart your PC.

After enabling WSL, you need to install a Linux distribution of your choice. You can do that from the Microsoft Store or from the command line. For this article, we will use Ubuntu 20.04 LTS as an example. To install it from the Microsoft Store, follow these steps:

  • Open the Microsoft Store app and search for Ubuntu.
  • Click on Ubuntu 20.04 LTS and then click on Get.
  • Wait for the download and installation to finish and then launch it from the Start menu or the taskbar.
  • The first time you launch it, you will be asked to create a user name and password for your Linux account. Enter them and press Enter.

Step 2: Install Nginx, PHP and MySQL on Ubuntu

Now that you have Ubuntu running on WSL, you can install the necessary packages for PHP MySQL development. To do that, follow these steps:

  • Open your Ubuntu terminal (either from the Start menu or by typing wsl in the Run dialog box).
  • Update your Ubuntu packages by running: sudo apt update
  • Install Nginx, PHP and MySQL by running: sudo apt install nginx php mysql-server
  • Secure your MySQL installation by running: sudo mysql_secure_installation and following the prompts.
  • Start Nginx and MySQL services by running: sudo service nginx start and sudo service mysql start

Step 3: Configure Nginx, PHP and MySQL on Ubuntu

After installing Nginx, PHP and MySQL, you need to configure them to work together. To do that, follow these steps:

  • Create a test PHP file in the default web root directory by running: echo "<?php phpinfo(); ?>" | sudo tee /var/www/html/info.php
  • Edit the default Nginx configuration file by running: sudo nano /etc/nginx/sites-available/default
  • Find the line that says index index.html index.htm index.nginx-debian.html; and add index.php after it, so it looks like this: index index.php index.html index.htm index.nginx-debian.html;
  • Find the block that says location / { ... } and add this line inside it: try_files $uri $uri/ =404;
  • Find the block that says location ~ \.php$ { ... } and uncomment it by removing the # symbols at the beginning of each line.
  • Save and exit the file by pressing Ctrl+OEnterCtrl+X.
  • Test your Nginx configuration by running: sudo nginx -t
  • Reload Nginx by running: sudo service nginx reload

Step 4: Connect to MySQL from Windows

To connect to your MySQL database running on WSL from Windows, you need to change the authentication method for your MySQL user. By default, MySQL uses auth_socket authentication, which is not supported by most Windows applications. To change it to mysql_native_password, follow these steps:

  • Log in to your MySQL shell by running: sudo mysql -u root -p and entering your password.
  • Run this command to change the authentication method for your root user: ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'new-password'; where new-password is a strong password of your choice.
  • Exit the MySQL shell by running: exit
  • Download and install MySQL Workbench or any other MySQL client application on your Windows 11 PC.
  • Launch MySQL Workbench and create a new connection with these settings:
    • Connection name: WSL
    • Hostname: localhost
    • Port: 3306
    • Username: root
    • Password: new-password
  • Click on Test Connection and then on OK if it succeeds.

Step 5: Test your PHP MySQL development environment

To test your PHP MySQL development environment, you can create a simple PHP script that connects to your MySQL database and displays some data. To do that, follow these steps:

  • Create a new PHP file in the web root directory by running: sudo nano /var/www/html/test.php
  • Paste this code into the file:
<?php
// Connect to MySQL database
$mysqli = new mysqli("localhost", "root", "new-password", "mysql");

// Check connection
if ($mysqli->connect_error) {
    die("Connection failed: " . $mysqli->connect_error);
}

// Query the database
$sql = "SELECT user, host FROM user";
$result = $mysqli->query($sql);

// Display the results
if ($result->num_rows > 0) {
    echo "<table border='1'>";
    echo "<tr><th>User</th><th>Host</th></tr>";
    while($row = $result->fetch_assoc()) {
        echo "<tr><td>" . $row["user"] . "</td><td>" . $row["host"] . "</td></tr>";
    }
    echo "</table>";
} else {
    echo "No results found";
}

// Close connection
$mysqli->close();
?>

Copy

  • Save and exit the file by pressing Ctrl+OEnterCtrl+X.
  • Open your browser and go to http://localhost/test.php
  • You should see a table with the user and host columns from the mysql.user table.

Congratulations! You have successfully configured your Windows 11 PC with WSL for PHP MySQL development. You can now create and run your PHP projects using Nginx, PHP and MySQL on Ubuntu. Happy coding! 😊


How to Install LAMP on Ubuntu


LAMP is a popular software stack that consists of Linux, Apache, MySQL, and PHP. It is used to run dynamic web applications and websites. In this article, we will show you how to install LAMP on Ubuntu 20.04 LTS.

Step 1: Update your system

Before installing any software, it is always a good idea to update your system to the latest version. To do this, open a terminal and run the following commands:

sudo apt update
sudo apt upgrade

This will download and install any available updates for your system.

Step 2: Install Apache

Apache is the most widely used web server software in the world. It is responsible for serving web pages and files to the clients. To install Apache on Ubuntu, run the following command:

sudo apt install apache2

This will install Apache and its dependencies. You can verify that Apache is running by typing your server’s IP address or hostname in your web browser. You should see the default Ubuntu Apache web page.

Step 3: Install MySQL

MySQL is a popular relational database management system that stores and manages data for web applications. To install MySQL on Ubuntu, run the following command:

sudo apt install mysql-server

This will install MySQL and its dependencies. You will be asked to set a password for the root user of MySQL during the installation process. Make sure you choose a strong and secure password.

After installing MySQL, you should run a security script that will remove some insecure default settings and lock down access to your database. To do this, run the following command:

sudo mysql_secure_installation

You will be asked to answer a series of questions. You can follow the recommended answers, but make sure you remember your root password.

Step 4: Install PHP

PHP is a popular scripting language that runs on the server side and generates dynamic web pages. To install PHP on Ubuntu, run the following command:

sudo apt install php php-mysql

This will install PHP and its module for MySQL. You can verify that PHP is working by creating a test file in the web root directory of Apache. To do this, run the following commands:

sudo nano /var/www/html/info.php

This will open a text editor where you can paste the following code:

<?php
phpinfo();
?>

Save and close the file by pressing Ctrl+X, Y, and Enter. Then, open your web browser and type your server’s IP address or hostname followed by /info.php. You should see a page with information about PHP.

Step 5: Congratulations!

You have successfully installed LAMP on Ubuntu 20.04 LTS. You can now start developing your web applications using this powerful software stack.