This time we'll look at how Ubuntu builds the lamp environment.
We just installed the virtual machine last time.
So first we need to change the source of the software. (The official source is really too slow.) )
Ubuntu Configuration Source
On this website.
Download the source you need.
I will download it first openssh-server
and then ssh
log in to the operation. The computer is too jammed.
Once connected, we first change the mirror source.
sources.list
Put it in the /etc/apt/
table of contents
deb https://mirrors.ustc.edu.cn/ubuntu/ bionic main restricted universe multiversedeb-src https://mirrors.ustc.edu.cn/ubuntu/ bionic main restricted universe multiversedeb https://mirrors.ustc.edu.cn/ubuntu/ bionic-security main restricted universe multiversedeb-src https://mirrors.ustc.edu.cn/ubuntu/ bionic-security main restricted universe multiversedeb https://mirrors.ustc.edu.cn/ubuntu/ bionic-updates main restricted universe multiversedeb-src https://mirrors.ustc.edu.cn/ubuntu/ bionic-updates main restricted universe multiversedeb https://mirrors.ustc.edu.cn/ubuntu/ bionic-backports main restricted universe multiversedeb-src https://mirrors.ustc.edu.cn/ubuntu/ bionic-backports main restricted universe multiverse
And then update it. sudo apt-get update
Next we build the lamp environment
First to installapache2
sudo apt-get install apache2 -y
When the installation is complete, access the virtual machine IP to see the following interface:
Then installphp
sudo apt-get install php7.2 -y
Installing php
related components
sudo apt-get install libapache2-mod-php7.2
Installation mysql
Services
sudo apt-get install mysql-server -y
Installing php-mysql
related components
sudo apt-get install php7.2-mysql
Here the lamp environment has actually been built. The following options are available.
Installation phpmyadmin
(optional)
PhpMyAdmin is a PHP-based, web-base-style database management tool that is architected on a Web site host for MySQL.
sudo apt-get install phpmyadmin -y
Choose hereapache2
sudo ln -s /usr/share/phpmyadmin /var/www/html/phpmyadmin
Access to the virtual machine ip/phpmyadmin can see the following interface
Restart mysql
, apache2
service
sudo service mysql restart
sudo service apache2 restart
Ubuntu 18.04 LTS Build LAMP Environment