Install LAMP on Ubuntu 16.04

Install LAMP on Ubuntu 16.04_第1张图片

Reference http://www.linuxidc.com/Linux/2016-09/135629.htm

step 0

Please run apt-get update and apt-get upgrade first.

step 1 Install Apache

  1. sudo apt-get install apache2

note: The default config file is /etc/apache2/site-available/000-default.conf, and the content may be

    ServerName abc.com
    ServerAlias www.abc.com
    
        AllowOverride All
    
    ServerAdmin webmaster@localhost   
    DocumentRoot /var/www/html/xxx
    ErrorLog ${APACHE_LOG_DIR}/error.log
    CustomLog ${APACHE_LOG_DIR}/access.log combined

You can use your domain name instead of 'abc' and your web directory can take replace of 'xxx'.

  1. Test http://localhost in your browser.

step 2 Install PHP

  1. sudo apt-get install php7.0
  2. sudo apt-get install libapache2-mod-php7.0
  3. service apache2 reload

step 3 Install MySQL

  1. apt-get install mysql-server mysql-client

    You should enter you root psw in this step.

  2. service mysql stop/restart/start

Finally, the default web root directory is /var/www/html

你可能感兴趣的:(Install LAMP on Ubuntu 16.04)