Step 1☆ 安裝LAMP

sudo apt-get install apache2 mysql-server mysql-client php5 phpmyadmin

Step 2☆ 启动服务

sudo /etsudo /etc/init.d/apache2 restart
sudo /etc/init.d/mysql restart

http://IP

Ubuntu  搭建LAMP环境_Apache

Step 3☆ 新建测试页确认服务已经正常工作

sudo vim /var/www/html/info.php

<?php
phpinfo();
?>

http://IP/info.php


Ubuntu  搭建LAMP环境_ubuntu_02


Step 4☆ 常用配置修改


1.修改Apache ServerName
sudo vim /etc/apache2/apache2.conf

ServerName 127.0.0.1:80

2.重新启动Apache
sudo /etc/init.d/apache2 restart