首页 > 数据库 >3_Installing Linux, Apache, MySQL, PHP (LAMP) Stack on Ubuntu 20.04

3_Installing Linux, Apache, MySQL, PHP (LAMP) Stack on Ubuntu 20.04

时间:2023-06-07 21:57:08浏览次数:69  
标签:sudo Copy Linux Installing server install MySQL PHP 20.04

 

 

地址:https://www.codewithharry.com/blogpost/lamp-stack-ubuntu-20-04/

 

Installing LAMP stack on Ubuntu 20.04 in 5 Minutes

This post will explain how to install LAMP stack on Ubuntu 20.04. LAMP stack consists of the following components:

  1. Linux - Any Linux based operating system
  2. Apache server - Apache is an open-source webserver
  3. MySQL - MySQL database
  4. PHP - PHP as a server-side programming language

These components work together to host single or multiple dynamic websites that are stable in production.

I will be using DigitalOcean for creating the VPS but you can use any service provider of your choice. As long as the operating system of your server is Ubuntu, this guide will work.

 

 

 

Before you go ahead and start installing the LAMP stack on Ubuntu, make sure you have a non-root user configured along with a server firewall for security purposes. If you don't know what I mean, have a look at this article to configure a non-root sudo user and a firewall on your server before you proceed further.

Installing Apache and allowing it through the firewall

Apache is an amazing open-source web server. Let's install it using the following commands:

sudo apt update

This command updates the package lists for upgrades. Let's run it to ensure that we install the up-to-date versions of the software later.

sudo apt install apache2

Press Y when prompted and the installation will finish after a while.

 

 

 

Let's allow Apache through the firewall using the following command:

sudo ufw allow in "Apache Full"

You can always issue the "sudo ufw status" command to verify the changes:

sudo ufw status

You can now go to the server URL (IP address) and the apache2 default page will be displayed on the screen

 

 

 

Congratulations! You have successfully installed the apache web server on your server

Installing MySQL on Ubuntu

MySQL is a very popular and open source database that can be used with almost any application to store huge amounts of data effectively.

Execute the following command to install MySQL on ubuntu:

sudo apt install mysql-server

confirm the installation by typing 'y' followed by the 'Enter'.

You should be able to login to MySQL console by typing the following command:

sudo mysql

 

 

 

To exit the MySQL console type exit in the MySQL console

exit

Installing PHP

We can install PHP by firing the following commands:

sudo apt install php libapache2-mod-php php-mysql

This will install the following 3 packages

  • php -  installs PHP
  • libapache2-mod-php - Used by apache to handle PHP files
  • php-mysql - PHP module that allows PHP to connect to MySQL 

Confirm the PHP installation by executing the below command:

php -v

Congratulations! You have successfully installed LAMP stack on your server. If you have any doubts, feel free to drop a comment below and I will get back to you!

 

 

 

 

 

 

标签:sudo,Copy,Linux,Installing,server,install,MySQL,PHP,20.04
From: https://www.cnblogs.com/hechunfeng/p/17464668.html

相关文章

  • linux 脚本 if [ $? -ne 0 ];then
    在shell命令中,if[$?-ne0];then是一个条件语句,用于检查上一个命令的执行状态。$?是一个特殊变量,它包含了上一个命令的退出状态码。-ne是不等于的意思。退出状态码为0表示命令执行成功,非0表示命令执行失败或出现错误。因此,if[$?-ne0];then的意思是:如果上一个......
  • linux内核编程语言环境
    3.1as86汇编器在Linux0.1x系统中使用了两种汇编器(Assembler)。一种是能产生16位代码的as86汇编器,使用配套的ld86链接器;另一种GNU的汇编器gas(as),使用GNUld链接器来链接产生的目标文件。as86+ld86是由MINIX-386的主要开发者之一BruceEvans编写的Intel8006、80386汇编编译程序......
  • SecureCRT for Linux 9.3无限30天试用
    SecureCRTforLinux9.3无限30天试用最近从Windows转到Linux,xshell没有linux版本,其他的又不想用,就下载了securecrt,但是都知道这个是收费的,只能用30天,买又买不起,下载好deb包安装后,默认在当前用户家目录下生成一个.vandyke目录,没有的话进到crt里面,Option-->GlobalOptions可以看到......
  • Linux-篇四
    组管理和权限管理基本介绍所有者、所在组、其他组、改变用户所在组文件/目录所有者一般文件的创建者就是该文件的所有者查看文件的所有者ll相当于ls-ahl修改文件的所有者文件/目录所在组当某个用户创建一个文件后,这个文件的所有组就是该用户所在的组(默认)修改文件/目录所在的组√......
  • linux time subsystem
    linuxtimesubsystemreference蜗窝科技时间子系统Linux时间管理系统一文入门linux内核高精度定时器hrtimer机制LinuxTime......
  • Docker(一):Linux系统下Docker的安装与卸载
    一、准备工作1.Linux系统,我这里使用的是云服务器CentOS72.查看系统内核系统内核需要3.0以上 3.系统版本 二、安装过程1.卸载旧的版本yumremovedocker\docker-client\docker-client-latest\docker-comm......
  • amazon linux ssh 使用密码登录
    amazonlinux ssh 使用密码登录1、使用AWS控制台创建的密钥对或者直接通过网页登录注意:使用pem私钥不允许直接登录root用户,只能登录默认用户例如:ec2-user,ubuntu等等2、创建root密码sudopasswdroot3、切换到root用户suroot4、修改sshd_config文件vim/etc/ssh/sshd_conf......
  • amazon linux 2 重置root密码
    amazonlinux2重置root密码linux的版本很多,但是重置root用户的密码的方法都是相似的,都是进入单用户模式修改root密码。步骤1.重启amazonlinux2重启amazonlinux2服务器后,进入系统加载页面2.按键盘“e”键,进入编辑模式3.移动光标找到linux16开头的那行,将光标移动到该行的末......
  • Linux 下启动jmeter 报-bash: bin/jmeter: Permission denied
    问题:通过cd进入jmeter目录中,执行脚本 bin/jmeter-n-txxxxx.jmx -l../50.jtl出现以下问题解决方法:修改文件权限chmod+xbin/jmeter修改后再次执行可正常启动 ......
  • 解决Ubuntu 20.04升级后gnome-control-center设置程序无法打开问题
    解决Ubuntu20.04升级后gnome-control-center设置程序无法打开问题Ubuntu20.04系统升级后,发现gnome设置程序无法正常打开了。在终端运行命令查看错误信息,运行以下命令:sudognome-control-center从显示的错误信息可以看出,其调用的一些so文件,需要高版本的libc6,而Ubuntu20.0......