# 树莓派做轻web服务器 URL: https://chengjinfang.com/posts/2017/linux-raspberrypi-2/ Author: 程锦方 Date: 2017-06-25 Tags: #note #linux Summary: 用 Raspberry Pi 搭建轻量 Web 服务器,安装和配置 Nginx、PHP 与 SQLite。 ------------------------------------------------------------------------ ## 树莓派做 Web 服务器 ### nginx + php + sqlite 安装 #### 安装 nginx ``` sudo apt-get install nginx ``` #### 启动 nginx ``` sudo /etc/init.d/nginx start ``` ##### nginx 的配置文件 ``` sudo vi /etc/nginx/sites-available/default ``` ###### nginx 的 www 根目录默认在/usr/share/nginx/www中 #### 安装 php 和 sqlite ``` sudo apt-get install php5-fpm php5-sqlite ``` #### 重新加载 nginx 的配置 ``` sudo /etc/init.d/nginx reload ``` ------------------------------------------------------------------------ Site: https://chengjinfang.com/ · All Index: https://chengjinfang.com/all/ · RSS: https://chengjinfang.com/rss.xml