Skip to main content

Install LAMP stack on Ubuntu

STEP:1 INSTALL APACHE

Apache is a free open source software that runs over 50% of the world’s web servers.

To install apache, open the terminal and type in these commands:

sudo apt-get update 

sudo apt-get install apache2


STEP:2 INSTALL MYSQL

MySQL is a powerful database management system used for organizing and retrieving data.

To install MySQL, open the terminal and type in these commands:

sudo apt-get install mysql-server libapache2-mod-auth-mysql php5-mysql

During the installation, MySQL will ask you to set a root password. If you miss the chance to set the password while the program is installing, it is very easy to set the password later from within the MySQL shell.

Once you have installed MySQL, we should activate it with this command:

sudo mysql_install_db

Finish up by running the MySQL set up script:

sudo /usr/bin/mysql_secure_installation

The prompt will ask you for your current root password.

Type it in.

Enter current password for root (enter for none): OK, successfully used password, moving on...

Then the prompt will ask you if you want to change the root password. Go ahead and choose N and move on to the next steps.

Once you're done with that you can finish up by installing PHP.


STEP:3 INSTALL PHP

PHP is an open-source web scripting language that is widely used to build dynamic web pages.

To install PHP, open the terminal and type in this command.

sudo apt-get install php5 libapache2-mod-php5 php5-mcrypt

After you answer yes to the prompt twice, PHP will install itself.

It may also be useful to add PHP to the directory index, to serve the relevant PHP index files:

sudo nano /etc/apache2/mods-enabled/dir.conf

PHP also has a variety of useful libraries and modules that you can add on to your virtual server. You can see the libraries that are available.

apt-cache search php5-

Once you decide to install the module, type:

sudo apt-get install name of the module

You can install multiple libraries at once by separating the name of each module with a space.

STEP:4 RESULTS — See PHP on your Server

Although LAMP is installed, we can still take a look and see the components online by creating a quick php info page

To set this up, first create a new file:

sudo nano /var/www/info.php

Add in the following line:

<?php phpinfo(); ?>

Then Save and Exit.

Restart apache so that all of the changes take effect:

sudo service apache2 restart






Comments

Popular posts from this blog

How to Practice Coding Online: Tools and Demos

  If you are learning to code, you need two things: Good Logic and Right Tools . Many people read tutorials but forget to practice. Today, I will share some amazing tools that will help you learn faster. 1. Practice SQL without Installing Software Usually, to learn SQL, you have to install heavy software. But now you can do it online. On thetechinfo.net , there is a Live SQL Playground . You can write queries like: SELECT * FROM users WHERE status = 'active'; It is a great tool for beginners who want to see a Live Demo of how databases work. 2. PHP and String Logic Tools When preparing for interviews, you must practice string problems. For example, checking a Palindrome or Reversing a String . Example: To reverse 'Hello', you can use a simple loop in PHP. Demo: You can find step-by-step logic and code examples on thetechinfo.net to solve these problems easily. 3. Real-World Project Roadmap If you know the basics, you should build a project. A Multi-User Task Mana...

Google Ads

 Google Ads Google Ads is one of the most popular advertising platforms in the world. It's a pay-per-click advertising platform that allows businesses of all sizes to reach their target audience and generate leads and sales. In this blog, we will discuss what Google Ads is, how it works, and the benefits it offers to businesses. What is Google Ads? Google Ads is an online advertising platform that allows businesses to create and display ads on Google's search engine results pages (SERPs) and on other websites that are part of the Google Display Network. Advertisers can target specific audiences, locations, and keywords to ensure their ads are shown to the right people at the right time. How does Google Ads work? Google Ads works on a pay-per-click (PPC) model, which means that advertisers only pay when someone clicks on their ad. Advertisers bid on keywords and phrases that are relevant to their business, and Google uses a complex algorithm to determine which ads are shown and ...

iPhone SE 5G launched with A15 Bionic chip

iPhone SE 5G launched with A15 Bionic chip: Here’s all you need to know Apple today announced the Apple iPhone SE 5G at the Apple Peak Performance Spring 2022 event. The new iPhone SE 5G edition succeeds the older iPhone SE 2020 and comes with some much-needed upgrades. Here’s all you need to know about the iPhone SE 5G, including price, specifications, new features and availability detail iPhone SE 5G: What’s new? The iPhone SE 5G comes with largely the same design elements from the older iPhone SE 2020. This includes a 4.7-inch Retina HD display with reinforced glass on the front and back, the same protective glass that is also found on the iPhone 13 series. The iPhone SE 5G is also powered by the Apple A15 Bionic chip, which is 5G enabled. The A15 Bionic chip is the same chipset that was used in the Apple iPhone 13 series. This brings a few new powerful additions to the SE series. This includes a 6-core CPU, a 4-core GPU and a 16-core Neural Engine that enables features like Live Te...