树莓派-nginx+php-fpm +sqlite+wordpress

root用户下进行

1、  安装、启动nginx 

apt-get update

apt-get install nginx

/etc/init.d/nginx start


2、  安装phpsqlite
apt-get install php5-fpm php5-sqlite sqlitesqlite3

3、修改nginx的配置文件

nano /etc/nginx/sites-available/default

修改内容如下
listen 80;

index index.php index.html index.htm;
location ~ \.php$ {
fastcgi_pass unix:/var/run/php5-fpm.sock;
fastcgi_index index.php;
include fastcgi_params;
}

4、重新加载nginx的配置

/etc/init.d/nginx reload

5、测试web

浏览器访问检测

6、测试php

nano /usr/share/nginx/www/test.php

添加如下:

<? phpinfo(); ?>

保存退出,浏览器访问检测

7、安装wordpress

1)安装wordpress

官网http://cn.wordpress.org/下载wordpress安装包,解压到树莓派的/var/www目录下,进入wordpress的根目录,把wp-config-sample.php重命名为wp-config.php,编辑wp-config.php添加:

define(‘USE_MYSQL‘, false);

tip:用xftp传输文件、或直接wget,慢的很。我把sd卡放插笔记本上直接操作。

2) 下载、安装sqlite插件到wordpress(要使wordpress支持sqlite)

地址:http://wordpress.org/plugins/sqlite-integration/

解压插件包,将解压后的包放到wp-content/plugins/目录下,再把包里面的db.php复制到wp-conte目录下。 最后sd卡安树莓派上启动,用浏览器访问http://192.168.1.103/wordpress/检验。

8、安装ftp服务器,方便传文件 (可选)
apt-get install vsftpd         #
安装vsftpd
service vsftpd start          #
启动ftp服务

nano /etc/vsftpd.conf        #编辑vsftdp的配置文件

找到以下行,定义一下
anonymous_enable=NO     #
不允许匿名访问
local_enable=YES           #
设定本地用户可以访问
write_enable=YES         #
设定可以进行写操作

local_umask=022          #设定上传后文件的权限掩码


service vsftpd restart       #重启vsftpd

时间: 2024-07-29 01:58:42

树莓派-nginx+php-fpm +sqlite+wordpress的相关文章

树莓派Nginx+php+sqlite

mysql占用内存太大,所以选用sqlite 安装: //更新 sudo apt-get update sudo apt-get upgrade //安装nginx sudo apt-get install nginx //启动nginx sudo /etc/init.d/nginx start //安装php-fpm sudo apt-get install php5-fpm //安装sqlite sudo apt-get install php5-sqlite Nginx配置: sudo n

深入理解PHP之:Nginx 与 FPM 的工作机制

完全转载(算是一个收藏了) https://zhuanlan.zhihu.com/p/20694204 网络上有很多关于如何配置 Nginx + FPM 的文章,但它们更多从操作的角度出发,告诉我们怎么做,但却没有告诉我们为什么要这么做,本文从 Nginx 与 FPM 的工作机制出发,探讨配置背后的原理,让我们真正理解 Nginx 与 PHP 是如何协同工作的. 要说 Nginx 与 PHP 是如何协同工作的,首先得说 CGI (Common Gateway Interface) 和 FastC

记录一次自己对nginx+fastcgi(fpm)+mysql压力测试结果

nginx + fastcgi(fpm) 压力测试: CentOS release 5.9 16核12G内存 静态页面: 并发1000,压测200秒,测试结果: 系统最大负载5.47 成功响应: 2563065, 502:0, 失败:0 PHP页面(对mysql进行一次带索引的查询,数据库记录500条): 并发1000,压测200秒,测试结果: 系统最大负载15.66 成功响应: 114368, 502:712, 失败:58715 并发200,压测200秒,测试结果: 系统最大负载25.81 成

树莓派学习笔记——Python SQLite查询历史温度

0 前言 本文通过Python SQLite查询树莓派CPU的温度历史数据,在前面的博文中已经介绍了树莓派CPU温度获取,SQLite操作和利用Python插入历史数据,下面再介绍如何查询数据,本文主要分为三部分,第一部分为查询所有温度记录,第二部分获得最近一小时数据,第三部分为把获得结果格式化为字典类型. [相关博文] [树莓派学习笔记--索引博文]--更多博文请关注. [树莓派学习笔记--获取树莓派CPU温度] [树莓派学习笔记--定时向yeelink上传树莓派CPU温度] [树莓派学习笔记

树莓派学习笔记——Python SQLite插入温度记录

0 前言 本文使用python向SQLite数据库中插入树莓派温度数据,SQLite数据库中包含一张只包含三个字段的记录表--参数名称,时间和温度值.本文重点解释Python操作SQlite的具体方法,由于网上资料众多,重复部分不再复述只做到具体情况具体分析. [相关博文] [树莓派学习笔记--索引博文]--更多博文请关注. [树莓派学习笔记--获取树莓派CPU温度] [树莓派学习笔记--定时向yeelink上传树莓派CPU温度] [树莓派学习笔记--SQLite操作简述] 1 创建数据库和空表

[Nginx] - PHP+FPM相关的配置

CodeIgniter的配置: worker_processes 1; events { worker_connections 1024; } http { include mime.types; default_type application/octet-stream; sendfile on; keepalive_timeout 65; fastcgi_connect_timeout 300s; fastcgi_send_timeout 300s; fastcgi_read_timeout

Nginx配置https的wordpress站点,wp-content目录下资源404解决方案

wordpress 下配置 ssl证书, server { listen 443; server_name demo.example.com; ssl on; root /data/; ssl_certificate /cert/cert.pem; ssl_certificate_key /cert/cert.key; ssl_session_timeout 5m; ssl_ciphers ECDHE-RSA-AES128-GCM-SHA256:ECDHE:ECDH:AES:HIGH:!NULL

CentOS6.5安装php7+nginx+mysql实现安装WordPress

安装php7+nginx参考该博客http://blog.csdn.net/whatday/article/details/50645117 安装php7参考http://blog.csdn.net/u013474436/article/details/52838496(先参考它安装php7)

nginx和fpm的进程数配置和502,504错误

一般来说 php-cgi进程数不够用.php执行时间长(mysql慢).或者是php-cgi进程死掉,都会出现502错误: Nginx 504 Gateway Time-out则是与nginx.conf的设置有关: 1.502 和 php-fpm.conf 1.request_terminate_timeout引起的资源问题 request_terminate_timeout的值如果设置为0或者过长的时间,可能会引起file_get_contents的资源问题. 如果file_get_conte