RPi 2B apache2 mysql php5 and vsftp

时间:2023-03-09 02:55:35
RPi 2B apache2 mysql php5 and vsftp
/*************************************************************************
* RPi 2B apache2 mysql php5 and vsftp
* 声明:
* 本文主要记录RPi 2B如何安装Apache2、mysql、php5、vsftp服务器,并对其进行
* 测试,为后续工作做准备,其中遇到SD卡空间不足的问题。
*
* 2016-2-19 深圳 南山平山村 曾剑锋
************************************************************************/ 一、参考文章:
. Apache Server (PHP + MySQL) on Raspberry PI
http://www.tuicool.com/articles/I7Jfue
. 树莓派(raspberry pi)学习10: 安装ftp服务器
http://blog.csdn.net/c80486/article/details/8460854 二、安装流程:
. sudo apt-get update
. sudo apt-get install apache2 php5 libapache2-mod-php5
. sudo apt-get install mysql-server mysql-client php5-mysql
mysql username: root
mysql passwd: zengjf
. sudo apt-get install vsftpd
username: pi
passwd: raspberry 三、默认SD卡空间不够用:
. sudo raspi-config
. 选择选项卡1:Expand Filessystem 四、mysql 测试:
pi@raspberrypi:~ $ mysql -hlocalhost -uroot -p
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is
Server version: 5.5.-+deb8u1 (Raspbian) Copyright (c) , , Oracle and/or its affiliates. All rights reserved. Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners. Type 'help;' or '\h' for help. Type '\c' to clear the current input statement. mysql> show databases;
+--------------------+
| Database |
+--------------------+
| information_schema |
| mysql |
| performance_schema |
+--------------------+
rows in set (0.00 sec) mysql> 五、php5测试
pi@raspberrypi:~ $ php -v
PHP 5.6.-+deb8u1 (cli) (built: Jan ::)
Copyright (c) - The PHP Group
Zend Engine v2.6.0, Copyright (c) - Zend Technologies
with Zend OPcache v7.0.6-dev, Copyright (c) -, by Zend Technologies 六、apache2 php测试:
. cat /var/www/html/index.php
<html>
<head>
<title> zengjf </title>
</head>
<body>
<?php
echo "I am zengjf"
?>
</body>
</html>
. 浏览器访问:http://192.168.0.5
<html>
<head>
<title>zengjf</title>
</head> <body>
I am zengjf
</body>
</html> 七、vsftp 测试:
浏览器键入:ftp://192.168.0.5
/ 的索引
名称 大小 修改日期
Desktop/ // 下午2::
Documents/ // 下午9::
Downloads/ // 下午9::
Music/ // 下午9::
Pictures/ // 下午9::
Public/ // 下午9::
Templates/ // 下午9::
Videos/ // 下午9::
python_games/ // 下午9::
show B // 下午2::