Sunday, January 7, 2024

Setup MAMP (Mac Apache MySQL/MySQL DB PHP) on Mac OS Sonoma on Macbook (Silicon Chip)

Introduction

Apple MacBook has gained popularity among developers in recent past. Many young developers are switching to Mac from Windows and Linux Environment. This article is an guide for developers who recently switched from differnet environment (specially Linux) to help them set up local MAMP (MacOS Apache MySQL PHP/Perl/Python) Environment

Friday, January 5, 2024

Setup inbuilt Apache in MacOS Sonoma

Many developer use mac for web development. I myself has seen several tutorials where trainer used apple system for training, but when I baught macbook, I found it bit difficult to set up the environment. I believe that many new developer face such issues so i decided to write this tutorial to help them. I have been using Linux (mostly Ubuntu/Linux Mint) for quite a time prior to switching to Mac.

Set up Web Server (Apache)

Apache is the most popular webserver. and the good news is that Mac OS (macOS 10.13 onwards) comes preinstalled with Apache and you just need to start the webservices. run following command to start apache 

sudo apachectl start 


To test if apache is working, just open your favorite webbrowser and type localhost on its address if you see page as follows, your webserver is working perfectly.


For those who are familier with apache I would like to inform that Apache2 is installed at /etc/apache2 and default document root is '/Library/WebServer/Documents' 

Document root is the location where you need to save all your files that you want to share through webserver.  Please be noted that when you save any file at default document root you may need to give additional permissions so that they can be served through web server. The easier method is to set up a folder in your home directory (i.e. /users/<yourUserName>) I have created a folder named Web for this purpose on my home directory.
So if you want to change the default document root you need to edit /etc/apache/httpd.conf (you will require to open Macintosh HD and navigate to etc folder. If folder is not visible, press Command+Shift+.(period) to display hidden files.) then open httpd.conf in your favorite text editor (many blogs recommend VI or nano so if you are confortable with these tools or like working with terminal that will also do)
locate DocumentRoot (in my case it was on line No 255) and change the folder from /Library/WebServer/Documents to the directory you created in your home directory (in my case it was /Users/isthakur/Web) 

Now you need to give permission to apache web server to access this folder so run following command on your home directory.

chmod +a "_www allow execute" ~

followed by the command 

sudo apachectl restart


Create html file named index.htm on your selected folder and test by opening localhost in your favorite web browser output in my case is as follows


We have successfully configured the apache on Mac. Wish you all the success.

Inbuilt Apache server works perfeclty fine if you do not intend to use php. But If you plan to develop using PHP as a server side language you must know that MacOS depricated PHP and stopped supporting it implicitely since MacOS Montery.  So if you are PHP lover like me you must stop the inbuilt apache  

Note:
  1. Show Hidden Files  :Click the Finder icon in your dock to open Finder. Navigate to the folder where you want to find hidden files. Press Command + Shift + . (the period key). This will show hidden files in the folder.
  2. Show Macintosh HD :It's really easy to show hard drive on your Desktop Mac. Open the Finder and select the main Finder menu. Then, click Settings. Under the General tab, under the Show these items on the Desktop, ensure Hard disks is selected.

Wednesday, August 30, 2023

Dear Sister, Thankyou for being in my life


 

Dear Sister,

As Rakshabandhan dawns upon us once again, my heart swells with a flood of memories, and I find myself traversing the corridors of time back to our cherished childhood. From the days of innocence when we shared our dreams under the same roof to the moments that have woven the tapestry of our lives, you have been a constant source of love, support, and unwavering companionship.

Do you remember those carefree summer afternoons when we used to chase butterflies in the garden? The laughter that echoed through the house as we concocted imaginative tales, and the secret hideouts we built together, they are all etched in my heart. Each thread of these memories forms a bond that time cannot fade.

From sharing our tiffin boxes at school to facing the world's challenges side by side, you've been more than a sister; you've been a confidante, a partner in crime, and my pillar of strength. Through all the ups and downs, your unwavering belief in me has lifted me up even in my darkest hours. Your unconditional love has been my guiding light.

As I stand at this juncture of life, I am filled with gratitude for every single precious moment we've shared. The late-night conversations, the giggles over silly jokes, and even the occasional squabbles have shaped our relationship into an unbreakable bond. Your presence has been a blessing, a constant reminder that no matter how rough the seas of life get, there's a safe harbor in your embrace.

On this Rakshabandhan, I want to express my heartfelt gratitude to you, dear sister. Thank you for being the most wonderful part of my life's journey. Thank you for believing in me when I had doubts, for cheering me on when I needed courage, and for holding my hand when I faltered. You are not just a sister, but a treasure I hold dearer than life itself.

As we tie another rakhi this year, let it symbolize the unbreakable bond that time and distance cannot diminish. Let it remind us of the love, care, and affection we've shared, and the promise to continue walking this beautiful journey hand in hand.

Happy Rakshabandhan, dear sister. May our bond continue to shine as a beacon of love and companionship.

With all my love,

Inder Singh Thakur

Monday, August 14, 2023

Irony of Indian Education System

In ancient times in India, students use to go to gurukuls where they stay with their teachers(guru) and study. Teacher give them lesson and practice work. There was no concept of home-work. Students need not to write something in their text books, rather they had to understand and memorise the concept. We can find countless references in our holi books and sacred literature, which says that students stayed with teacher for the duration of education. With the passage of time, our education system evolved the gurukuls converted into vidyalays (school), mahavidyalaya (college) and vishwavidyalaya (University).

भारतीय शिक्षा प्रणाली की विडंबना

भारत में प्राचीन काल में, छात्र गुरुकुलों में जाते थे जहां वे अपने शिक्षकों (गुरु) के साथ रहते थे और अध्ययन करते थे। शिक्षक उन्हें सबक देते हैं और काम का अभ्यास करते हैं। घर-काम की कोई अवधारणा नहीं थी। छात्रों को अपनी पाठ्य पुस्तकों में कुछ लिखने की आवश्यकता नहीं है, बल्कि उन्हें अवधारणा को समझना और याद रखना था। हम अपनी होली की किताबों और पवित्र साहित्य में अनगिनत संदर्भ पा सकते हैं, जो कहते हैं कि छात्र शिक्षा की अवधि के लिए शिक्षक के साथ रहे। समय बीतने के साथ, हमारी शिक्षा प्रणाली ने गुरुकुलों को विद्यालयों (स्कूल), महाविद्यालय (कॉलेज) और विश्वविद्यालय (विश्वविद्यालय) में परिवर्तित कर दिया।

Tuesday, July 18, 2023

The Dark Side of Kids Learning Tubes: Unveiling the Hidden Dangers

 Introduction


Welcome to our comprehensive guide that explores the dark side of kids' learning tubes. In this article, we will delve into the hidden dangers lurking behind these seemingly harmless educational tools. While they offer a plethora of benefits, it's crucial to be aware of the potential downsides. By understanding the risks, we can ensure a safer and more enriching learning experience for our children.

From Rallies to Results: The Rollercoaster Ride of Himachal Pradesh Election 2022

 

Introduction:

The political landscape of Himachal Pradesh was set ablaze with fervor and anticipation as the much-awaited Himachal Pradesh Election 2022 unfolded. From the adrenaline-fueled rallies to the nail-biting results, this rollercoaster ride of democracy captivated the attention of the entire nation. The election witnessed twists and turns, surprises and upsets, making it a thrilling journey for both politicians and voters alike. Let's embark on a retrospective journey, exploring the exhilarating rollercoaster ride of the Himachal Pradesh Election 2022.

Setup MAMP (Mac Apache MySQL/MySQL DB PHP) on Mac OS Sonoma on Macbook (Silicon Chip)

Introduction Apple MacBook has gained popularity among developers in recent past. Many young developers are switching to Mac from Windows an...