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

來源:互聯網
上載者:User

標籤:樹莓派-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

 


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

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.