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 build ubuntu 16.04.2 server LAMP environment

2025-02-23 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

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

This article mainly introduces how to build ubuntu 16.04.2 server LAMP environment, has a certain reference value, interested friends can refer to, I hope you can learn a lot after reading this article, the following let the editor take you to know about it.

1.

Install Mysql: [install the service and client of MySQL5, enter the password of the root user according to the prompt]

Sudo apt-get install mysql-server mysql-client

two。

Install apache2:

Sudo apt-get install apache2

The default directory for the server is / var/www/html

3.

Install php7

Sudo apt-get install php7.0

4.

Install apache2 php7 module

Sudo apt-get install libapache2-mod-php7.0

5.

Test whether php is working properly

Sudo mv / var/www/html/index.html / var/www/html/index.html.bak

Sudo echo "" > / var/www/html/index.php-- > you may need su-root, switch to root login.

Restart the apache2 service

Sudo service apache2 restart

Change permissions:

Sudo chmod 777 / var/www

6.

Test result: 127.0.0.1 or http://localhost/

7. Install phpMyAdmin

Sudo apt-get install phpmyadmin

It is installed under / usr/share/ by default, so a soft connection must be established to link a document under phpmyadmin and / var/www/html, change to the / var/www/html directory, and enter the following command

In the / var/www/html directory, create the following link file:

Sudo ln-s / usr/share/phpmyadmin / var/www/html

Sudo a2enmod rewrite

Sudo service apache2 restart

Then visit phpmyadmin (such as http://127.0.0.1/phpmyadmin)) in the browser's address bar to log in to the management database.

Thank you for reading this article carefully. I hope the article "how to build ubuntu 16.04.2 server LAMP Environment" shared by the editor will be helpful to you. At the same time, I also hope you will support us and pay attention to the industry information channel. More related knowledge is waiting for you to learn!

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

Development

Wechat

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

12
Report