ubuntu下apache+mysql+php安装笔记

1. 安装apache
$sudo apt-get install apache2
测试:
浏览器中输入:http://192.168.21.133/
192.168.21.133为ubuntu IP

2. 安装PHP
$ sudo apt-get install php5
$ sudo apt-get install libapache2-mod-php5
$ sudo /etc/init.d/apache2 restart

测试:sudo vim /var/www/test.php
vim输入:

<html>
<body>

<?php
echo "Hello World";
?>

</body>
</html>
在浏览器中输入:http://192.168.21.133/test.php

浏览器中输出hello world,表示安装正确

3. 安装mysql

$sudo apt-get install mysql-server
开启外部访问权限
$grant all privileges on *.* to root@"%" identified by"123456";  

$ sudo vi /etc/mysql/my.cnf

bind-address=127.0.0.1=> bind-address= 你机器的IP
或者注释bind-address=127.0.0.1这行
这样就可以允许其他机器访问MySQL了

参考:http://wiki.ubuntu.org.cn/MySQL%E5%AE%89%E8%A3%85%E6%8C%87%E5%8D%97

4. 让apache、php支持 mysql
$sudo apt-get install libapache2-mod-auth-mysql
$sudo apt-get install php5-mysql
$sudo /etc/init.d/apache2 restart

5.安装phpmyadmin
$sudo apt-get install phpmyadmin
$sudo ln -s /usr/share/phpmyadmin /var/www/
使用:http://localhost/phpmyadmin/ 访问


参考:http://www.linuxidc.com/Linux/2010-07/27230.htm

转载于:https://my.oschina.net/zipu888/blog/549574

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值