• Categories
    Category
    {{ postCtrl.tags }}
    • {{ category.tag_type }}

      • {{tag.tag_name}}
      • View more
  • Categories
    Category
    {{ postCtrl.tags }}
    • {{ category.tag_type }}

      • {{tag.tag_name}}
      • View more
  • News
  • Tutorials
  • Forums
  • Tags
  • Users
Tutorial News Comments FAQ Related Articles

How to install LAMP setup on Ubuntu 21

  • 00:31 sudo -s
  • 00:41 cd /
  • 00:48 apt install apache2
  • 01:05 apt install mariadb*
  • 01:27 mysql_secure_installation
  • 02:16 apt install php libapache2-mod-php php-mysql
  • 02:46 vi /etc/www/html/index.php
{{postValue.id}}

To Install Lamp on Ubuntu 21.04

Introduction

LAMP stands for Linux, Apache, Mysql, Php. Which is widely used for web hosting , All LAMP stacks are open source and free to use, it is also very secured one

Login as Root User

linuxhelp@linuxhelp:~$ sudo -s

Changing the directory

root@linuxhelp:/home/linuxhelp# cd /

Install apache webserver

root@linuxhelp:/# apt install apache2
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
The following additional packages will be installed:
  apache2-bin apache2-data apache2-utils libapr1 libaprutil1
  libaprutil1-dbd-sqlite3 libaprutil1-ldap
Suggested packages:
  apache2-doc apache2-suexec-pristine | apache2-suexec-custom
The following NEW packages will be installed:
  apache2 apache2-bin apache2-data apache2-utils libapr1 libaprutil1
  libaprutil1-dbd-sqlite3 libaprutil1-ldap
0 upgraded, 8 newly installed, 0 to remove and 254 not upgraded.
Need to get 1,739 kB of archives.
After this operation, 7,550 kB of additional disk space will be used.
Do you want to continue? [Y/n] y
Get:1 http://in.archive.ubuntu.com/ubuntu hirsute-updates/main amd64 libapr1 amd64 1.7.0-6ubuntu0.1 [96.9 kB]
Get:2 http://in.archive.ubuntu.com/ubuntu hirsute/main amd64 libaprutil1 amd64 1.6.1-5ubuntu1 [84.9 kB]

Install the Mariadb

root@linuxhelp:/# apt install mariadb*
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
Note, selecting 'mariadb-tokudb-engine-5.5' for glob 'mariadb*'
Note, selecting 'mariadb-server-core-5.5' for glob 'mariadb*'
Note, selecting 'mariadb-plugin-spider' for glob 'mariadb*'
Note, selecting 'mariadb-server' for glob 'mariadb*'
Note, selecting 'mariadb-plugin-s3' for glob 'mariadb*'
Note, selecting 'mariadb-galera-server-5.5' for glob 'mariadb*'
Note, selecting 'mariadb-test' for glob 'mariadb*'
Note, selecting 'mariadb-plugin-mroonga' for glob 'mariadb*'
Note, selecting 'mariadb-client-core-5.5' for glob 'mariadb*'
Note, selecting 'mariadb-connect-engine-10.0' for glob 'mariadb*'
Note, selecting 'mariadb-connect-engine-10.1' for glob 'mariadb*'
Note, selecting 'mariadb-oqgraph-engine-10.0' for glob 'mariadb*'
Note, selecting 'mariadb-oqgraph-engine-10.1' for glob 'mariadb*'
Note, selecting 'mariadb-gssapi-server-10.1' for glob 'mariadb*'
Note, selecting 'mariadb-gssapi-server-10.2' for glob 'mariadb*'
Note, selecting 'mariadb-test-data-10.0' for glob 'mariadb*'
Note, selecting 'mariadb-testsuite-10.1' for glob 'mariadb*'
Note, selecting 'mariadb-testsuite-10.3' for glob 'mariadb*'
Note, selecting 'mariadb-rocksdb-engine-10.2' for glob 'mariadb*'
Note, selecting 'mariadb-rocksdb-engine-10.3' for glob 'mariadb*'
Note, selecting 'mariadb-plugin-rocksdb' for glob 'mariadb*'
Note, selecting 'mariadb-test-10.0' for glob 'mariadb*'

Configure the database by using following command

root@linuxhelp:/# mysql_secure_installation

Snap 1 Snap 2 Snap 3

Install the php

root@linuxhelp:/# apt install php libapache2-mod-php
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
The following additional packages will be installed:
  libapache2-mod-php7.4 php-common php7.4 php7.4-cli php7.4-common php7.4-json
  php7.4-opcache php7.4-readline
Suggested packages:
  php-pear
The following NEW packages will be installed:
  libapache2-mod-php libapache2-mod-php7.4 php php-common php7.4 php7.4-cli
  php7.4-common php7.4-json php7.4-opcache php7.4-readline
0 upgraded, 10 newly installed, 0 to remove and 254 not upgraded.
Need to get 4,042 kB of archives.

Create an php file

root@linuxhelp:/# vi /var/www/html/index.php

Snap 4

Opening by ping the IP in browser Snap 5

With this method, the installation of LAMP setup is comes to end.

Tags:
hobbs
Author: 

Comments ( 0 )

No comments available

Add a comment
{{postCtrl.cmtErrMsg}}

Frequently asked questions ( 5 )

Q

What is the LAMP Stack?

A

LAMP stack is a prominent open source software and its primitive purpose is web application development. The following essentials such as a operating system, a web server, a database, and a programming language are needed inorder to achieve the smooth work from a web application.

Q

What are the components of LAMP stack?

A

The four components of LAMP stack are Linux, Apache, MySQL, and PHP. They are put up to achieve a high-performance in web applications and is used for providing a demonstrated software set.

Q

What is LAMP stack and mean stack?

A

It is an acronym for the Linux Operating System and also contains Linux, Apache, MySQL, and PHP. It aims in delivering web applications that are performing better. MEAN Stack Developer is a prominent technology stack and its main purpose is to create cloud-hosted applications.

Q

Does lamp include Python?

A

It also compatible of using both python and perl and by using LAMP it is easier to comphrehend both PHP and MySQL programs.

Q

What is LAMP and WAMP?

A

WAMP, MAMP, and LAMP are the acronyms for “Windows, Apache, MySQL, and PHP,” “Mac, Apache, MySQL, and PHP,” and “Linux, Apache, MySQL, and PHP.” These both have a different operating system and their abbreviations is used to narrate a fully functioning setup.

Back To Top!
Rank
User
Points

Top Contributers

userNamenaveelansari
135850

Top Contributers

userNameayanbhatti
92510

Top Contributers

userNamehamzaahmed
32150

Top Contributers

1
userNamelinuxhelp
31040

Top Contributers

userNamemuhammadali
24500
Can you help David Lopez Guillen ?
Ayuda urgente instale SSL para servidor Opensuse y ahora no funciona tengo servicio web

hola segui este tutorial para tener un certificado ssl y ahora no se ve mi app en la red, espero alguien pueda ayudarme, tengo M9oodle en3.5 en un servidor open suse y ahora no funciona por favor ayuda.

https://www.linuxhelp.com/how-to-create-ssl-certificate-in-opensuse

Networking
  • Routing
  • trunk
  • Netmask
  • Packet Capture
  • domain
  • HTTP Proxy
Server Setup
  • NFS
  • KVM
  • Memory
  • Sendmail
  • WebDAV
  • LXC
Shell Commands
  • Cloud commander
  • Command line archive tools
  • last command
  • Shell
  • terminal
  • Throttle
Desktop Application
  • Linux app
  • Pithos
  • Retrospect
  • Scribe
  • TortoiseHg
  • 4Images
Monitoring Tool
  • Monit
  • Apache Server Monitoring
  • EtherApe 
  • Arpwatch Tool
  • Auditd
  • Barman
Web Application
  • Nutch
  • Amazon VPC
  • FarmWarDeployer
  • Rukovoditel
  • Mirror site
  • Chef
Contact Us | Terms of Use| Privacy Policy| Disclaimer
© 2025 LinuxHelp.com All rights reserved. Linux™ is the registered trademark of Linus Torvalds. This site is not affiliated with linus torvalds in any way.