资讯专栏INFORMATION COLUMN

在ubuntu14.04上安装lamp环境

王晗 / 2815人阅读

摘要:如果此步跳过,以后想重新配置在目录,所以就用命令建立软连接。地址感谢您的耐心阅读,如果您发现文章中有一些没表述清楚的,或者是不对的地方,请给我留言,你的鼓励是作者写作最大的动力,作者原文出处创作时间

配置安装源

编辑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

内容

打开 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


感谢您的耐心阅读,如果您发现文章中有一些没表述清楚的,或者是不对的地方,请给我留言,你的鼓励是作者写作最大的动力,

作 者 : @mousycoder

原文出处 : http://mousycoder.com/2015/11/25/install-lamp-environment-on-ubuntu14-04/

创作时间:2015-11-25

文章版权归作者所有,未经允许请勿转载,若此文章存在违规行为,您可以联系管理员删除。

转载请注明本文地址:https://www.ucloud.cn/yun/21239.html

相关文章

  • Ubuntu14.04安装LAMP环境,以及源码安装PHP5.6和Apache2.4

    摘要:安装在下很多功能都在这个软件包中了,不在区分等软件包了,因此我们可以直接安装注意这边的是为了方便安装,加上它就不需要在进行安装确认,简单粗暴一键完成安装的模块在中的模块有两个软件包,分别是和大多数情况下应该使用第一个。 安装Apache 在Ubunt14.04下很多功能都在apache2这个软件包中了,不在区分mpm-work,mpm-prefork,mpm-event等软件包了,因...

    silvertheo 评论0 收藏0
  • Ubuntu14.04安装LAMP环境,以及源码安装PHP5.6和Apache2.4

    摘要:安装在下很多功能都在这个软件包中了,不在区分等软件包了,因此我们可以直接安装注意这边的是为了方便安装,加上它就不需要在进行安装确认,简单粗暴一键完成安装的模块在中的模块有两个软件包,分别是和大多数情况下应该使用第一个。 安装Apache 在Ubunt14.04下很多功能都在apache2这个软件包中了,不在区分mpm-work,mpm-prefork,mpm-event等软件包了,因...

    syoya 评论0 收藏0
  • Ubuntu14.04安装LAMP环境,以及源码安装PHP5.6和Apache2.4

    摘要:安装在下很多功能都在这个软件包中了,不在区分等软件包了,因此我们可以直接安装注意这边的是为了方便安装,加上它就不需要在进行安装确认,简单粗暴一键完成安装的模块在中的模块有两个软件包,分别是和大多数情况下应该使用第一个。 安装Apache 在Ubunt14.04下很多功能都在apache2这个软件包中了,不在区分mpm-work,mpm-prefork,mpm-event等软件包了,因...

    myshell 评论0 收藏0
  • php7 + mysql5.7 +apache2.4 on Ubuntu 14.04

    摘要:如果想通过来安装,则需要添加源。目前网上给出的大部分答案是这样的这样是找不到版本的。通过,找到了正确的安装步骤这样才能通过来安装在安装过程中,会要求输入的密码。排错如果页面空白,请尝试强制刷新页面。此时应该可以看见中的内容了。 Ubuntu 14.04 安装并配置LAMP 标签:Ubuntu Linux Apache2.4 Mysql5.7 php7.0 开始之前 系统版本 Ubu...

    gougoujiang 评论0 收藏0
  • php7 + mysql5.7 +apache2.4 on Ubuntu 14.04

    摘要:如果想通过来安装,则需要添加源。目前网上给出的大部分答案是这样的这样是找不到版本的。通过,找到了正确的安装步骤这样才能通过来安装在安装过程中,会要求输入的密码。排错如果页面空白,请尝试强制刷新页面。此时应该可以看见中的内容了。 Ubuntu 14.04 安装并配置LAMP 标签:Ubuntu Linux Apache2.4 Mysql5.7 php7.0 开始之前 系统版本 Ubu...

    canger 评论0 收藏0

发表评论

0条评论

王晗

|高级讲师

TA的文章

阅读更多
最新活动
阅读需要支付1元查看
<