Install LAMP on Ubuntu 16.04

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
    <Directory /var/www/html/xxx/>
        AllowOverride All
    </Directory>
    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

最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容