Ubuntu 14.14安装LAMP

http://www.linuxeden.com/html/softuse/20140610/152522.html

LAMP 是 Linux、Apache、MySQL、PHP 的简称。本教程使用的 Ubuntu 14.04 LTS Server 64 位的系统,安装 Apache2 web服务、PHP5 支持 (mod_php)和 MySQL。

使用 SSH 连接到服务器,切换到 ROOT 账户:

sudo su

在正式安装之前更换一下源,国内的服务器,替换到国内源,为防止意外,先备份源:

cp /etc/apt/sources.list /etc/apt/sources.list_backup

在用vi编辑:

vi /etc/apt/sources.list

我比较喜欢中科大的源,比较快,共享一下:

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

1、安装数据库MySQL 5

apt-get install mysql-server mysql-client

系统提示设置密码:

mysql passwd

mysql passwd2

New password for the MySQL “root”user:<–输入你的root密码

Repeat password for the MySQL “root”user:<–在输入一次

2、安装 Apache:

apt-get install apache2

然后浏览器访问:

apche browser

默认目录:/var/www/html,配置文件:/etc/apache2/apache2.conf

3、安装 PHP:

apt-get install php5 libapache2-mod-php5

再重启 apache2

service apache2 restart

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

vi /var/www/html/info.php

内容如下:

5、让 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

重启 apache:

service apache2 restart

6、安装 XCache 优化缓存

apt-get install php5-xcache

重启 apache:

service apache2 restart

7、安装phpmyadmin管理Mysql:

apt-get install phpmyadmin

phpmyadmin

选择第一个,然后是设置phpmyadmin:

phpmyadmin setting

phpmyadmin setting2

http://wangfei4553693.blog.163.com/blog/static/270104772011923103046874/

在安装过程中会要求选择Web server:apache2或lighttpd,选择apache2,按tab键然后确定。然后会要求输入设置的Mysql数据库密码连接密码 Password of the database’s administrative user。
然后将phpmyadmin与apache2建立连接,以我的为例:www目录在/var/www,phpmyadmin在/usr/share/phpmyadmin目录,所以就用命令:sudo ln -s /usr/share/phpmyadmin /var/www 建立连接。

phpmyadmin测试:在浏览器地址栏中打开http://localhost/phpmyadmin



  • 0
    点赞
  • 4
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值