Build a LAMP development environment on Ubuntu 16.04

Build a LAMP development environment on Ubuntu 16.04

(These commands can be copied and pasted by right-clicking, if not right, just type it yourself)

After opening Ubuntu, right click and select open-terminal to enter the terminal command line

The following operations are all lost here

basic settings:

  1. Set root password

sudo passwd

Switch to root user: su or su-or su root
Switch to normal user: su username or logout

2 . Update source

sudo apt-get update

The file saved by the source is: /etc/apt/sources.list

(If there is a situation where you are asked to enter a password, please enter the one you set before, press Enter, the password is not displayed on the screen, and then if E: Invalid operation updata appears, it’s okay, re-enter sudo apt-get updata and press Enter, it’s good if the following pile appears)

Install common software

  1. SSH

sudo apt-get install openssh-server

View status: service ssh status/start/stop/restart
Or: /etc/init.d/ssh status/start/stop/retsrt
In fact, the service command is to execute the /etc/init.d script, and the functions of the two are the same

(These tools may be used in the future. It doesn’t matter if you don’t know it now. After inputting the command, the picture above appears, just hit y and press Enter)

  1. Vim

sudo apt-get install vim

(Also enter the command and press Enter, just follow the steps, if it has been installed, it will prompt, like the picture above, at this time, English is especially important haha)

  1. Tree

sudo apt-get install tree

  1. Git

sudo apt-get install git

Build a LAMP [this is the point]

  1. Install Apache

sudo apt-get install apache2

Test: The browser visits the IP of http://Ubuntu (ie http://localhost), and the It Works! webpage appears.
(Open the Firefox browser and enter the URL in the search bar)

(The picture above is ok)

Check the status: service apache2 status/start/stop/restart
Web directory: /var/www
Installation directory: /etc/apache2/
Global configuration: /etc/apache2/apache2.conf
Listening port: /etc/apache2/ports.conf
Virtual host: /etc/apache2/sites-enabled/000-default.conf

(These may be used in the future, just ignore it)

  1. Install MySQL

sudo apt-get install mysql-server mysql-client

1

Press y

Test: mysql -u root -p

(If the installation is successful, you will enter the mysql command line, mysql> looks like this, and press quit to exit; just ok)
View status: service mysql status/start/stop/retart
View the status of the listening port: netstat -tunpl or netstat -tap

  1. Install PHP

sudo apt-get install php7.0

1

(I should have installed it, just follow the steps without installation)

Test: php7.0 -v

  1. Install other modules

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

sudo apt-get install php7.0-mysql

1

Restart service
service apache2 restart

(You will be asked to enter the password when restarting, just enter the one you set before)

service mysql restart

Test whether Apache can parse PHP
sudo vim /var/www/html/phpinfo.php

This is the case after entering

Press i to enter insert mode

Then write in the file: , Press Esc after typing

Press Shift+ again: Enter one: then enter wq and press Enter

Browser access: http://ubuntu address/phpinfo.php (ie http://localhost/phpinfo.php), the PHP Version webpage appears

(This is ok)

  1. Modify permissions

sudo chmod 777 /var/www

  1. Install phpMyAdmin

sudo apt-get install phpmyadmin

Installation: Select apache2 and click OK. The next choice is to configure the database and enter the password.

(You will be allowed to choose in the middle, just choose apache2, then choose ok, set a password, enter the password again, it's fine, remember to set a password that you will not forget)
Create phpMyAdmin shortcut: sudo ln -s /usr/share/phpmyadmin /var/www/html
Enable Apache mod_rewrite module: sudo a2enmod rewrite

Restart the service:
service php7.0-fpm restart
service apache2 restart

(You will still be asked to enter the password, just enter it)

Test: Browser visit: http://ubuntu address/phpmyadmin (ie http://localhost/phpmyadmin)

(This is ok)

  1. Configure Apache

Sudo vim /etc/apache2/apache2.conf

1

After opening the file

Press i first and then slide to the end of the page

Add to:
AddType application/x-httpd-php .php .htm .html
AddDefaultCharset UTF-8

Then press Esc to enter: wq enter and exit (w is to save q is to exit)

Restart Apache service

service apache2 restart

the lamp is built

Recommended Posts

Build a LAMP development environment on Ubuntu 16.04
Build a python development environment under Ubuntu
Build an Ubuntu Linux development environment on a Vmware virtual machine
ubuntu build python development environment
How to build a LAMP environment on centos7.2
Build a file server on ubuntu
lamp on ubuntu
Steps to build LNMP environment on ubuntu 20.04
Build arm virtual operating environment on Ubuntu
Ubuntu configuration development environment
Ubuntu 18.04 LTS LAMP build
Ubuntu development environment configuration
Python3 development environment to build a detailed tutorial
Build a basic environment for Java development under Centos7
Embedded Linux development environment to build and configure Ubuntu
ubuntu builds common development environment
How to set up a Masterless Puppet environment on Ubuntu 14.04
Teach you how to build a Git server on Ubuntu
Ubuntu 18.04.1 build Java environment and HelloWorld
Build Nginx-RTMP live server on ubuntu
Deploy JobConverter + Ibreoffice environment on Ubuntu
Ubuntu16.04 build php5.6 Web server environment
Docker ubuntu: install python-PIL-image environment on 14.04
Build Nginx environment on Linux (CentOS)
Install Python virtual environment on Ubuntu 18.04
Build Discuz forum based on ubuntu
Install Spark stand-alone environment on Spark Ubuntu18
Install Hadoop system environment on Ubuntu 18.04
How to build nfs service on ubuntu16.04
WordPress-Build a personal blog based on Ubuntu 16.04
Build the C++ compilation environment under ubuntu
Configure Java development environment in Ubuntu20.04 LTS
(1) Centos7 installation to build a cluster environment
A little experience using mysql on Ubuntu
[PHP] Build a PHP operating environment under CentOS
Docker learning 2- quickly build a centos7-python3.6 environment
Build a Minecraft Bedrock Edition server (Ubuntu)
Install JDK and configure environment variables on Ubuntu 16.04
Install Python3 environment in a brand new Ubuntu
Ubuntu build etcd
How to use Jenkins to build automatically on Ubuntu
Install Leanote on Ubuntu18 to build cloud notes
Ubuntu build Seafile
How to set up a DNS server on Ubuntu 18.04
How to start a blog with Hexo on Ubuntu 14.04
A simple tutorial to install Sogou Pinyin on ubuntu18.04
How to configure a fixed IP based on Ubuntu 18.04
How to create a Python virtual environment in Ubuntu 14.04
How to set a fixed IP based on Ubuntu 16.04
Install and configure Mono production environment on Ubuntu Server
install vscode on ubuntu18
Install Redis on Ubuntu
ubuntu16.04 deploy GPU environment
Install R4 on ubuntu20
Install nvtop on Ubuntu 18.04
Install docker on Ubuntu
CentOS6.7 build LNMP environment
Centos7.6 build LNMP environment
Install Docker on ubuntu18.04
Install nodejs10 on Ubuntu16
lamp (centos7) installation lamp environment