1.换源
备份原先的源
cp /etc/apt/sources.list /etc/apt/sources.list.bak
vim /etc/apt/sources.list
换成
deb http://mirrors.aliyun.com/ubuntu/ trusty main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ trusty-security main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ trusty-updates main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ trusty-proposed main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ trusty-backports main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ trusty main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ trusty-security main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ trusty-updates main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ trusty-proposed main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ trusty-backports main restricted universe multiverse
更新
apt-get update
2.安装apache2
apt-get install apache2
service apache2 restart
在本地浏览器打开localhost 应该可以看到apache2的欢迎界面
3.安装php
按照ubuntu安装的方法 apt-get install php5是没法用的,不晓得为啥子
我找的解决办法是如下:
apt-get install software-properties-common
add-apt-repository ppa:ondrej/php
apt-get update
apt-get install php
apt-get install libapache2-mod-php
service apache2 restart
4.测试php
在/var/www/html目录下新建test.php
内容如下:
<?php
phpinfo();
?>
打开localhost/test.php 正常显示则代表成功
5.至于mysql 的安装,后续再写