Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to install LAMP in Ubunt16.04

2025-03-17 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/01 Report--

This article will explain in detail how to install LAMP in Ubunt16.04. The content of the article is of high quality, so the editor shares it for you as a reference. I hope you will have a certain understanding of the relevant knowledge after reading this article.

Installation of the Apache2 web server:

In Ubuntu Linux, the web server is Apache2, and we can install Apache2 with the following command.

$sudo apt update$ sudo apt install apache2-y

When the package for Apache2 is installed, the related services for Apache2 are started and run automatically after restart. In some cases, if your Apache2 service is not automatically running and enabled, you can enable it with the following command:

$sudo systemctl start apache2.service$ sudo systemctl enable apache2.service$ sudo systemctl status apache2.service

If you turn on Ubuntu's firewall (ufw), you can use the following command to remove the port (80,443) restrictions on the web server:

$sudo ufw statusStatus: active$ sudo ufw allow in 'Apache Full'Rule addedRule added (V6)

Well, at this time you can enter the IP address of your server to access your web server, and you will not be surprised to see the Apache2 welcome page.

Installation of the database server (MySQL Server 5.7):

MySQL and MariaDB are both database servers in Ubuntu 16.04. The installation packages for both MySQL Server and MariaDB Server can be found in the default software source for Ubuntu, and we can choose one of them to install. Install the mysql server in the terminal with the following command.

$sudo apt install mysql-server mysql-client

During installation, it will ask you to set the password for the root account of the mysql server:

Confirm the password of your root account and click OK.

This is the end of the installation of the MySQL server, and the MySQL service is automatically started and enabled. We can verify the status of the MySQL service with the following command.

$sudo systemctl status mysql.service

Installation of the PHP scripting language:

Since PHP7 already exists in the software source of Ubuntu, execute the following command in the terminal to install PHP7

The copy code is as follows:

$sudo apt install php7.0-mysql php7.0-curl php7.0-json php7.0-cgi php7.0 libapache2-mod-php7.0

Create a simple php page under the root of / var/www/html 's apache.

$touch info.php$ vi info.php

Save and exit the file after editing in vi.

Now you can access this page from the web browser and type: "http:///info.php", you can see the following page."

If you can see the purple PHPINFO page, the installation has been completely successful.

Installation of phpMyAdmin:

PhpMyAdmin allows us to perform all the tasks related to database management and other database operations through its web interface, and this installation package already exists in the Ubuntu software source.

Use the following command to install phpMyAdmin in Ubuntu server 16.04 LTS.

$sudo apt install php-mbstring php7.0-mbstring php-gettext$ sudo systemctl restart apache2.service$ sudo apt install phpmyadmin

During the following installation process, it prompts us to select the target server on which phpMyAdmin is running.

Select Apache2 and click OK.

Click OK to configure the database managed by phpMyAdmin.

Specifies the password that phpMyAdmin uses when registering with the database server.

Confirm the password required by phpMyAdmin and click OK.

Now you can start trying to access phpMyAdmin, open a browser and type: "http://Server_IP_OR_Host_Name/phpmyadmin""

Use the root account and password we set up when we installed.

When we click "Go", we will redirect to the phpMyAdmin' web interface shown below.

If there is an error here, remember to add a soft link to phpmyadmin to point to the apache directory

$sudo ln-s / usr/share/phpmyadmin / var/www/html/phpmyadmin on how to install LAMP in Ubunt16.04 to share here, I hope the above content can be of some help to you, can learn more knowledge. If you think the article is good, you can share it for more people to see.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report