Powerful Web Stack LEMP Installation & Configuration Setup in Ubuntu 20.04 on a VirtualBox VM.

For Step-by-Step Video Exercise for Web Stack LEMP:
My YouTube Channel
مشق کی عملی وڈیو کے لئے
میرا یوٹیوب چینل
Welcome to my practical exercise on mastering the Powerful Web Stack LEMP!
لیمپ اسٹیک انسٹالیشین میں مہارت حاصل کرنے کی میری عملی مشق میں خوش آمدید!
If you’re looking to power your websites and applications with blazing speed and optimal performance, you’ve come to the right place. In this step-by-step navigational tutorial, you are going to walk through the process of setting up a robust LEMP environment on Ubuntu 20.04 Oracle VirtualBox VM.
اگر آپ اپنی ویب سائٹس اور ایپلیکیشنز کو تیز رفتاری اور بہترین کارکردگی کے ساتھ بنانا چاہتے ہیں تو آپ صحیح جگہ پر پہنچ گئے ہیں۔ اس مرحلہ وار نیویگیشنل ٹیوٹوریل میں، آپ لیمپ انوائرنمنٹ کواُبُنٹُو اور ورچؤالباکس کی مشین پربالترتیب تیار ہوتے ہوئے دیکھیں گے۔
Whether you’re a seasoned developer or a curious enthusiast, understanding the LEMP stack (consisting of Linux, Nginx, MySQL/MariaDB, and PHP) is essential for building and deploying modern web applications. While walking with me through this process of setup, you’ll gain the necessary knowledge and hands-on experience to harness the full potential of this powerful web stack (LEMP).
چاہے آپ ایک تجربہ کار ڈویلپر ہوں یامشغلے کے طور پر لیمپ سٹیک شوقین؛ لیمپ اسٹیک کوبشمول (لینکس، اینجن ایکس، مائیسیکوئیل، ماریا ڈیی بی، اور پی ایچ پی)کو سمجھنا جدید ویب ایپلیکیشنز کے بنانے اور چلانے کے لیے ضروری ہے۔ سیٹ اپ کے اس عمل میں میرے ساتھ چلتے ہوئے، آپ کو اس طاقتور ویب اسٹیک کی مکمل صلاحیت کو بروئے کار لانے کے لیے ضروری علم اور تجربہ حاصل ہوگا۔
Do some googling to know about the core components of the LEMP stack and the reasons behind its popularity among web developers worldwide.
اسٹیک کے بنیادی اجزاء اور دنیا بھر میں ویب ڈویلپرز میں اس کی مقبولیت کی وجوہات کے بارے میں جاننے کے لیے کچھ گوگلنگ کرلیں۔
By the end of this exercise, you’ll have a fully functional LEMP stack up and running on your Ubuntu 20.04 VirtualBox VM or host computer, ready to host your websites, blogs, and applications.
اس مشق کے اختتام تک، آپ کے پاس اپنےہاسٹ کمپیوٹر پر یا ورچؤالباکس کی مشین پر لیمپ سٹیک مکمل طور پر فعال ہوگا اور آپ کی ویب سائٹس، بلاگز اور ایپلیکیشنز کی میزبانی کے لیے تیار ہوگا۔
Let’s dive in and embark on this exciting journey to master the Web Stack LEMP!
آئیے لیمپ اسٹیک میں مہارت حاصل کرنے کے لیے اس دلچسپ سفر کا آغاز کریں۔
Prerequisites Installation prior to install the WordPress: like, nginx, mysql-server, php, php-mysql, php7.4-fpm
ورڈپریس کی انسٹالیشن سے پہلےچند بنیادی ضرورت کے پروگراموں کی انسٹالیشن، مثلاً؛ انجن ایکس، مائیسیکوئیل-سرور، پی ایچ پی، پی ایچ پی-مائسیکوئیل، وغیرہ
I’ll be doing all this exercise as superuser, the sudo user.
میں یہ ساری مشق “سوڈو” یعنی روٹ یوزر کے طور پر کروں گا۔
sudo apt update
sudo apt upgrade -y
apt install nginx mysql-server php php-mysql php7.4-fpm If you’ve got on the MySQL prompt, then “Exit”.
اگر مائیسیکوئل چل جاتا ہے تو اس سے “ایگزیٹ” کر جائیں۔
sudo mysql mysql> exit Securing MySQL installation:
مائیسیکوئل کی انسٹالیشن کو پاسورڈ کے ذریعے محفوظ بنانے کے لئے
mysql_secure_installation !Remember!
!خبردار!
For production purpose, always use strong password.
پروڈکشن کے مقاصد کے لئےہمیشہ سٹرانگ پاسورڈ کا استعمال کریں۔
🤯 If secure installation doesn’t work: then use the following
اگر سیکیور انسٹالیشن کمانڈکام نہ کرے اور اٹک جائےتو یہ کمانڈ استعمال کرکے پراسیس کو ختم کریں۔
sudo killall -9 mysql_secure_installation Run the MySQL again and use the Alter User command.
دوبارہ مائیسیکوئل کو چلائیں اور دی گئی “آلٹریوزر”کی کمانڈ سے سیکیورانسٹالیشن والا مرحلہ مکمل کریں۔
sudo mysql Then on MySQL prompt that will look like: ‘ mysql>_ ‘ type the following command. You can use your own User and Password. After this command process Exit MySQL.
پھر مائیسیکوئیل کے کمانڈ پرامپٹ پر ذیل میں دی گئی کمانڈ ٹائپ کریں گے۔ یوزر اور پاسورڈ آپ اپنی مرضی کا دے سکتے ہیں۔ اس کمانڈ پر عمل کے بعد مائیسیکوئیل سے باہر چلے جائیں۔
ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'Pass3t*use'; Again, Login to MySQL with password confirmation.
مائی سیکوئیل میں دوبارہ پاسورڈ کنفرمیشن کے ساتھ ‘لاگ اِن’۔
mysql -u root -p Creating a database with the name wordpress.
“ورڈپریس” کے نام سے ڈیٹا بیس بنانی ہے۔
create database wordpress; Creating a user with the name userwp and a password to identify the user.
“یوزر ڈبلیوپی” کےنام سے یوزر بنانا ہے اور یوزر کا پاسورڈ بناناہے۔
create user 'userwp'@'localhost' identified by 'wpPass3t*use'; Granting all rights of wordpress database and its tables to the userwp.
یوزر کو ورڈپریس کی ڈیٹا بیس کے تماجملہ حقوق دینے ہیں۔
grant all privileges on wordpress.* to 'userwp'@'localhost'; MySQL reloads the privileges from the grant table. This command ensures that the changes made to the privileges and permissions or user accounts are immediately applied without restarting MySQL server.
مائیسیکوئیل گرانٹ ٹیبل سے مراعات \پریؤلیجز کو دوبارہ لوڈ کرتا ہے۔
یہ کمانڈ اس بات کو یقینی بناتی ہے کہ مراعات اور اجازتوں یا صارف اکاؤنٹس میں کی گئی تبدیلیاں سرور کو ریسٹارٹ کیے بغیر فوری طور پر لاگو کر دی جائیں۔
Flush Privileges command is used right after the use of CREATE USER, ALTER USER, GRANT, or REVOKE..
CREATE USER، ALTER USER، GRANT، REVOKE کے استعمال کے بعد Flush Privileges کمانڈ کا استعمال کیا جاتا ہے۔
flush privileges; After the flush privileges command. Now, exiting the MySQL environment.
فلش پریؤلیجز کمانڈ کے استعمال کے بعد اب مائیسیکوئل سے ایگزیٹ کریں گے۔
exit; Now, on Linux system prompt.
اب مائیسیکوئل سے باہر لینکس پرامپٹ پر
Enabling the services on the Reboots.
ویب سرور اور ڈیٹابیس کی سروسز کے سسٹم ری-بوٹ کےوقت خودبخودچل پڑنےکےلئے اقدامات۔
systemctl enable nginx && systemctl enable mysql && systemctl enable php7.4-fpm Downloading and Installing WordPress.
ورڈپریس کاآفیشل ویب سائیٹ سے ڈاؤنلوڈ اور انسٹالیشن
cd /var/www/html If you don’t have these directories /www/html, then create them inside the /var directory.
اگر آپ کو یہ ڈائریکٹریاں [www/html/] نہیں مل رہیں تو بنالیں۔
mkdir /var/www
mkdir /var/www/html Before downloading, I’ll step-in /html directory.
ڈاؤنلوڈ سے پہلے میں’ html/ ‘ میں جاؤں گا پھر ڈاؤنلوڈ کی کمانڈ لگاؤں گا۔
cd /var/www/html I browsed the wordpress website to get this link for download. If you are watching my exercise video along with this, you can see that clearly. Video link is shared at the beginning of this exercise.
یہ لنک آپ کو ورڈپریس کی سائیٹ سے مل جائےگا۔
اگر آپ میری مشق کی وڈیو بھی ساتھ دیکھ رہےہیں تو وہاں آپ دیکھ بھی سکتے ہیں۔ وڈیو کا لنک اس مشق کے آغاز پر شیئر کیا ہوا ہے۔
wget https://wordpress.org/latest.zip If you ain’t got the zip Unzip apps, then install them.
اگرآپ کے پاس زِپ ،أنزِپ ایپس نہیں ہیں تو انہیں انسٹال کر لیں۔
apt install zip unzip Now will unzip the downloaded zip file. And this will create a directory with the name wordpress and extract all the files in it.
اب ورڈپریس کی ڈاؤنلوڈ کی ہوئی زِپ فائل کو ایکسٹریکٹ/أنزِپ کرناہے۔ اور یہ خود سے ایک ڈائریکٹری ورڈپریس کے نام سے بناکراس میں ساری فائلیں ایکسٹریکٹ کردے گی۔
Our current location is: /var/www/html, let’s check if it is.
ہماری کرنٹ لوکیشن/ورکنگ ڈائریکٹری
/var/www/html/
ہونی چاہیئے۔ دی گئی کمانڈ سے ہم اپنی موجودہ /کرنٹ ڈائریکٹری کو جان سکتے ہیں۔
pwd Now the files will be extracted.
اب أنزِپ کی کمانڈ سے فائیلیں ایکسٹریکٹ ہو جائیں گی۔
unzip latest.zip Go inside the wordpress directory and copy all the files into the parent directory i.e. /html
اب ورڈپریس کی ڈائریکٹری کے اندر جائیں گے اور ساری فائیلیں “پیرنٹ ڈائریکٹری” html/ میں کاپی کر دیں گے۔
cd wordpress
cp * -avr ../ Step back to the parent directory of html directory www, where we have to change the ownership the ownership and Read/Write permissions of this html directory for Nginx.
اب ورڈپریس کی ڈائریکٹری سے نکل کر html/ کی پیرنٹ ڈائریکٹری میں جائیں گے۔
جہاں سے ہم نے html/ ڈائریکٹری کی ‘اونرشپ’ اور ‘رِیڈ/رائیٹ’ پرمِشنز تبدیل کرکے اینجن ایکس کو دینی ہیں۔
cd ..
cd .. If we type this command,
اگرہم یہ کمانڈ لگائیں تو
pwd it will show you the current location on the root like this.
/var/www
یہ ہمیں ہماری کرنٹ لوکیشن کچھ اسطرح سے دکھاتی ہے ۔
Now changing the ownership for the user:group that will be Nginx.
اب اؤنرشپ تبدیل کریں گے– یوزر:گروپ جوکہ اینجن ایکس کی ہوگی۔
chown www-data:www-data * -R The read/write/execute permissions to the user and group only. No permissions for others means No access.
رِیڈ/رائیٹ/ایگزیکیوٹ پرمِشنز یوزر (اینجن ایکس)اور اس کے گروپ کو اور — یعنی زِیرو باقی سب کوکسی قسم کا ایکسیس نہیں۔
chmod 770 * -R Let’s walk into the /etc/nginx/sites-enabled directory and edit the file named default.
چلیں جی اب “سائیٹس اِنئیبلڈ” کی ڈائریکٹری میں جاتے ہیں اور “ڈیفالٹ” نام کی فائل میں تبدیلیاں کرتے ہیں۔
cd /etc/nginx/sites-enabled
nano default Following updates will be done in the default configuration file according to my system. As per given lines of script.
میرے سسٹم کانفیگریشن کے حساب سے مندرجہ ذیل سکرپٹ میں نے تبدیل یا اضافہ کیا۔
File name: default
# Default server configuration
#
server {
listen 80 default_server;
listen [::]:80 default_server;
root /var/www/html;
# Add index.php to the list if you are using PHP
index index.php index.html index.htm index.nginx-debian.html;
server_name _;
location / {
try_files $uri $uri/ /index.php$is_args$args;
}
}
The 'default' file will look like this.
'ڈیفالٹ' فائل دی گئی تصویر کی طرح ہوگی۔

Restart Nginx and php7.4-fpm
انجن ایکس اور' پی ایچ پی ' کوریسٹارٹ کریں۔
systemctl restart nginx
systemctl restart php7.4-fpm Let's walk into the /etc/nginx/sites-enabled directory and edit the file named default.
wp-config-sample.php
سے کاپی کرکے
wp-config.php فائل بناتے ہیں۔
You can find the sample file in /html directory.
یہ فائل html/ کی کرنٹ ڈائریکٹری میں ملے گے۔
ls Use the following command to create wp-config.php file.
مندرجہ ذیل کمانڈسے”کانفیگ” فائل بناکر سکرپٹ میں تبدیلی یا اضافہ کریں گے۔
cp wp-config-sample.pht wp-config.php WordPress Configuration File Setup.
ورڈپریس کی کانفگریشن فائل کا سیٹ اپ
Need to make changes to this main wordpress configuration file. We will need the secret keys for the security of our installation and wordpress made this easy for by providing these keys on the following link.
اب ورڈپریس کی مرکزی کانفگریشن فائل میں کچھ تبدیلیوں کی ضرورت ہے۔
اور سیکریٹ کیز بھی چاہئے ہونگی اپنی اس انسٹالینشن کی سیکیورٹی کے لئے،جوکہ ورڈپریس نے ہماری سہولت کے لئے مندرجہ ذیل لنک پر مہیا کر رکھی ہیں۔
!Remember!
!خبردار!
Never save or copy these keys, you have to use unique values each time.
ان سیکریٹ کیز کو کاپی کرکے رکھنے کی ضرورت نہیں، یہ ہمیں ہر انسٹالیشن پر نئی استعمال کرنی ہیں۔
curl -s https://api.wordpress.org/secret-key/1.1/salt/ Now, will copy the keys for this time only and paste them into the wp-config.php file at their exact location. You may delete or ‘#’ the existing pattern. I often change them to 'comments'.
اب ان سیکیورٹی کیز کو کاپی کرکے "ڈبلیو پی -کانفگ.پی ایچ پی" فائل میں اس کی بتائی گئی جگہ پرپیسٹ کردیں گے۔
آپ چاہیں تو جو نمونہ پہلے سے موجود ہے اسے کمنٹ کردیں یا ڈیلیٹ کردیں۔ میں تو ایسے کوڈ کو "کمنٹ" کر دیا کرتا ہوں۔
Adding the database name, user name, password and server name to the configuration file.
اب کانفگ فائل میں ڈیٹا بیس کا نام، یوزرکا نام, پاسورڈ, اورسرور کا نام ان کی مخصوص جگہاؤں پر لکھنے ہیں۔
The last step to proceed with the installation and set up in browser.
To see the IP of your host machine.
اب آخری مرحلہ آتا ہے، براؤزر میں انسٹالیشن کی تکمیل کا۔
اب ہاسٹ مشین کا 'آئی پی' دیکھنے کے لئے مندرجہ ذیل کمانڈ استعمال ہوگی۔
ip a OR
یا
ipconfig if this command doesn’t work, then net-tools will be installed using following command.
اگر یہ کمانڈ کام نہ کرے تو مندرجہ ذیل کمانڈ سے 'نیٹ-ٹُولز' انسٹال کریں گے۔
apt install net-tools Restart the Nginx and php7.4-fpm before proceeding further.
Now open the browser and type in the IP address of your host machine. In my case it is localhost.The wordpress setup page will appear follow the steps and enjoy the wordpress on you local machine.
کچھ بھی کرنے سے پہلے'انجن ایکس اور پی ایچ پی 'ریسٹارٹ کرنی ہے۔
اور اب براؤزر کھول کر اپنی ہاسٹ مشین کا 'آئی پی ' ایڈریس ٹائپ کریں گے،جس سے ورڈپریس کا 'سیٹ اپ' کا صفحہ کھل کر سامنے آجائے گا۔ اس کی ہدایات پر عمل کرتے ہوئے ورڈپریس کا سیٹ اپ اپنی مشین پر مکمل کریں گے۔

Thank you for reading and watching, share it in your circle.
Stay in touch and visit again.
میری بلاگ پڑھنے اور وڈیودیکھنے کے لئے آپ کا شکریہ
اپنے دائرۂ احباب میں بھی شیئرکریں اور رابطے میں رہیں۔