Ubuntu 16.04 Build Lamp development environment

Source: Internet
Author: User
Tags install php phpinfo install django phpmyadmin pip install django

1. Configure the network environment

Slightly


2. Set the root password

sudo passwd initial set root password

Su switches to the root user


3. Common software

1. SSH

sudo apt-get install Openssh-server
2. Vim
3. Tree
4. Git

sudo apt-get installxxx

4. Build Lamp

1. Installing Apache

sudo apt-get install git

Test: The browser accesses the Http://Ubuntu IP and the IT works! page appears.

View 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

2. Install MySQL

sudo apt-get install mysql-server mysql-client

Test: Mysql-u root-p

View status: Service MySQL Status/start/stop/retart

To view the listening port: NETSTAT-TUNPL or Netstat-tap

3. Install PHP

sudo apt-get install PHP

Test: Php7.0-v

4. Other modules

sudo apt-get install libapache2-mod-php7.0
sudo apt-get install Php7.0-mysql
Restart Service

Service Apache2 Restart

Service MySQL Restart

Test Apache can parse PHP

vim/var/www/html/phpinfo.php

Written in file: <?php echo phpinfo ();? >

Browser access: Http://ubuntu address/phpinfo.php, PHP version page appears

5. Modify Permissions

sudo chmod 777/var/www

6. Installing phpMyAdmin

sudo apt-get install phpMyAdmin

Install: Select Apache2, click OK. The next option is to configure the database and enter the password.

Create phpMyAdmin shortcut: sudo ln-s/usr/share/phpmyadmin/var/www/html

Enable Apache Mod_rewrite module: sudo a2enmod rewrite

Restart Service:

Service PHP7.0-FPM Restart

Service Apache2 Restart

Test: Browser access: Http://ubuntu address/phpmyadmin

7. Install the Python package

1. Pip
sudo apt-get install Python-pip
2. Django
Pip Install Django
3. Mysql-python
Pip Install Mysql-python

Ubuntu 16.04 Build Lamp development environment

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.