#重新构建#64MB运行内存安裝Wordpress(Caddy/PHP7.0/

各种各样实例教程#重新构建#64MB运行内存安裝Wordpress(Caddy/PHP7.0/Sqlite)
介绍

系统软件:Debian-8.0-x86_64-minimal

妻子提前准备

升级系统软件,再加源(Debian8没法立即安裝PHP7)

echo "deb etc/apt/sources.list
echo "deb-src etc/apt/sources.list
wget dotdeb.gpg
apt-key add dotdeb.gpg
apt-get update apt-get upgrade
reboot
安裝PHP/Sqlite/Caddy

安裝Sqlite

apt-get install sqlite #安裝Sqlite

安裝Caddy这儿应用逗比脚本制作

wget -N --no-check-certificate ToyoDAdoubiBackup/doubi/master/caddy_install.sh chmod +x caddy_install.sh bash caddy_install.sh

安裝PHP7:

apt-get install php7.0-fpm php7.0-cgi php7.0-sqlite3 php7.0-curl php7.0-gd php7.0-mbstring php7.0-mcrypt php7.0-xml php7.0-xmlrpc php7.0-zip php7.0-opcache -y
sed -i 's/;=1/=0/' /etc/php/7..ini
配备Caddy

文件目录:/usr/local/caddy/,在建文档名叫:Caddyfile

编写它:

zai.ge {
 redir home/wwwroot/zaige
 tls xx
 gzip
 fastcgi / /7.0-fpm.sock php
 rewrite {
 if {path} not_match ^\/wp-admin
 to {path} {path}/ /index.php?{query}
}

表述一下:

第一段:zai.ge是自动跳转到p>

下边:

root 是网站网站根目录

tls 是是不是全自动配备Lets SSL资格证书

fastcgi 是配备PHP

rewrite 是Wordpress的伪静态数据。

重新启动Caddy

/etc/init.d/caddy restart
配备WP

1、免费下载WP

apt-get install unzip
cd /home/wwwroot/zaige
wget latest-zh_CN.zip
unzip *.zip
mv wordpress/* ./
rm -rf *.zip wordpress

2、使WP可使用Sqlite

wget plugin/sqlite-integration.1.8.1.zip
unzip *.zip
mv sqlite-integration wp-content/plugins
cp wp-content/plugins/sqlite- wp-content
rm *.zip

3、改动WordPress配备文档:

cp wp-config-sample.php wp-config.php
vim wp-config.php

4、把下边几行注解或删掉掉:

define('DB_NAME', 'database_name_here');
define('DB_USER', 'username_here');
define('DB_PASSWORD', 'password_here');
define('DB_HOST', 'localhost');

5、更换或再加

define('DB_FILE', '64mb');
define('DB_DIR', '/home/wwwroot/zaige/db');

6、改动管理权限

chmod -R 755 /home/wwwroot/zaige
chown www-data:www-data -R /home/wwwroot/zaige
Caddy表明
起动:/etc/init.d/caddy start
终止:/etc/init.d/caddy stop
重新启动:/etc/init.d/caddy restart
查询情况:/etc/init.d/caddy status
查询Caddy起动系统日志:tail -f /tmp/caddy.log
安裝文件目录:/usr/local/caddy
Caddy配备文档部位:/usr/local/caddy/Caddyfile
Caddy全自动申请办理SSL资格证书部位:/.caddy/acme/acme-v01./sites/xxx.xxx(网站域名)/
续篇

经检测沒有Swap运作WP非常非常死,常常502

参照:archives/651/