发布于 2016-01-16 05:45:21 | 247 次阅读 | 评论: 0 | 来源: PHPERZ

这里有新鲜出炉的精品教程,程序狗速度看过来!

LAMP Web服务器套件

LAMP是一个缩写,它指一组通常一起使用来运行动态网站或者服务器的自由软件


配置安装源

编辑sources.list文件,替换一下更新源,这里用阿里云的更新源
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

deb http://mirrors.aliyuncs.com/ubuntu/ trusty main restricted universe multiverse
deb http://mirrors.aliyuncs.com/ubuntu/ trusty-security main restricted universe multiverse
deb http://mirrors.aliyuncs.com/ubuntu/ trusty-updates main restricted universe multiverse
deb http://mirrors.aliyuncs.com/ubuntu/ trusty-proposed main restricted universe multiverse
deb http://mirrors.aliyuncs.com/ubuntu/ trusty-backports main restricted universe multiverse
deb-src http://mirrors.aliyuncs.com/ubuntu/ trusty main restricted universe multiverse
deb-src http://mirrors.aliyuncs.com/ubuntu/ trusty-security main restricted universe multiverse
deb-src http://mirrors.aliyuncs.com/ubuntu/ trusty-updates main restricted universe multiverse
deb-src http://mirrors.aliyuncs.com/ubuntu/ trusty-proposed main restricted universe multiverse
deb-src http://mirrors.aliyuncs.com/ubuntu/ trusty-backports main restricted universe multiverse

中科大更新源

deb http://debian.ustc.edu.cn/ubuntu/ trusty main restricted universe multiverse
deb http://debian.ustc.edu.cn/ubuntu/ trusty-security main restricted universe multiverse
deb http://debian.ustc.edu.cn/ubuntu/ trusty-updates main restricted universe multiverse
deb http://debian.ustc.edu.cn/ubuntu/ trusty-proposed main restricted universe multiverse
deb http://debian.ustc.edu.cn/ubuntu/ trusty-backports main restricted universe multiverse
deb-src http://debian.ustc.edu.cn/ubuntu/ trusty main restricted universe multiverse
deb-src http://debian.ustc.edu.cn/ubuntu/ trusty-security main restricted universe multiverse
deb-src http://debian.ustc.edu.cn/ubuntu/ trusty-updates main restricted universe multiverse
deb-src http://debian.ustc.edu.cn/ubuntu/ trusty-proposed main restricted universe multiverse
deb-src http://debian.ustc.edu.cn/ubuntu/ trusty-backports main restricted universe multiverse

更新

apt-get update

安装Mysql

apt-get install mysql-server mysql-client

查看Myql默认密码

vim /etc/mysql/debian.cnf

用默认密码进入mysql,修改Mysql默认密码

set password for 'root'@'localhost' = password('yourpass')

允许myysql外部链接

修改 /etc/mysql/my.cnf,注释掉bind-address = 127.0.0.0

安装Apache

apt-get install apache2

默认网站目录 /var/www/html

修改默认网站目录

/etc/apache2/sites-available/000-default.conf 把DocumentRoot换成自己想指定的目录

其中如果要绑定域名的话 修改ServerName XX.COM

安装PHP

-get install php5 libapache2-mod-php5

重启apache2

service apache2 restart

测试 PHP,建立一个探针文件

vi /var/www/html/info.php

内容

<?php
phpinfo()
?>

打开 localhost/info.php 可以看到

让PHP5支持MySql

`apt-cache search php5
apt-get install php5-mysql php5-curl php5-gd php5-intl php-pear php5-imagick php5-imap php5-mcrypt php5-memcache php5-ming php5-ps php5-pspell php5-recode php5-snmp php5-sqlite php5-tidy php5-xmlrpc php5-xsl`

重启apache2

service apache2 restart

安装 XCache 优化缓存

apt-get install php5-xcache

重启apache2

service apache2 restart

安装phpmyadmin管理Mysql

apt-get install phpmyadmin


要求输入Myql的用户名和密码。

如果此步跳过,以后想重新配置

dpkg-reconfigure phpmyadmin

phpmyadmin在/usr/share/phpmyadmin目录,所以就用命令:ln -s /usr/share/phpmyadmin /var/www 建立软连接。

phpadmin地址:localhost/phpmyyyadmin/index.php




最新网友评论  共有(0)条评论 发布评论 返回顶部

Copyright © 2007-2017 PHPERZ.COM All Rights Reserved   冀ICP备14009818号  版权声明  广告服务