本文及资源最后更新时间 2021-07-07 by sky995
前置条件,先安装好 Linux Deploy 参考文章
《旧手机烂手机不要换锈钢脸盆,安装Linux Deploy做移动服务器》
安装 Nginx + php + mysql ,配置 WordPress 博客
- 提供可复制的命令行文本
<code><span class="com"># 安装 Nginx + php</span><span class="pln"> apt install nginx supervisor git apt install php7</span><span class="pun">.</span><span class="lit">3</span><span class="pln"> php7</span><span class="pun">.</span><span class="lit">3</span><span class="pun">-</span><span class="pln">fpm php7</span><span class="pun">.</span><span class="lit">3</span><span class="pun">-</span><span class="pln">sqlite3 php7</span><span class="pun">.</span><span class="lit">3</span><span class="pun">-</span><span class="pln">xml php7</span><span class="pun">.</span><span class="lit">3</span><span class="pun">-</span><span class="pln">zip php7</span><span class="pun">.</span><span class="lit">3</span><span class="pun">-</span><span class="pln">pgsql php7</span><span class="pun">.</span><span class="lit">3</span><span class="pun">-</span><span class="pln">mbstring \ php7</span><span class="pun">.</span><span class="lit">3</span><span class="pun">-</span><span class="pln">bcmath php7</span><span class="pun">.</span><span class="lit">3</span><span class="pun">-</span><span class="pln">json php7</span><span class="pun">.</span><span class="lit">3</span><span class="pun">-</span><span class="pln">mysql php7</span><span class="pun">.</span><span class="lit">3</span><span class="pun">-</span><span class="pln">gd php7</span><span class="pun">.</span><span class="lit">3</span><span class="pun">-</span><span class="pln">cli php7</span><span class="pun">.</span><span class="lit">3</span><span class="pun">-</span><span class="pln">curl php7</span><span class="pun">.</span><span class="lit">3</span><span class="pun">-</span><span class="pln">cgi </span><span class="com"># 下载 Nginx + php 配置文件和进行设置</span><span class="pln"> git clone https</span><span class="pun">:</span><span class="com">//github.com/hongwenjun/nginx-php.git</span><span class="pln"> cd nginx</span><span class="pun">-</span><span class="pln">php cp </span><span class="pun">./</span><span class="kwd">default</span> <span class="pun">/</span><span class="pln">etc</span><span class="pun">/</span><span class="pln">nginx</span><span class="pun">/</span><span class="pln">sites</span><span class="pun">-</span><span class="pln">enabled</span><span class="pun">/</span><span class="kwd">default</span><span class="pln"> cp </span><span class="pun">./</span><span class="pln">supervisord</span><span class="pun">.</span><span class="pln">conf </span><span class="pun">/</span><span class="pln">etc</span><span class="pun">/</span><span class="pln">supervisord</span><span class="pun">.</span><span class="pln">conf cp </span><span class="pun">./</span><span class="pln">start</span><span class="pun">.</span><span class="pln">sh </span><span class="pun">/</span><span class="pln">start</span><span class="pun">.</span><span class="pln">sh chmod </span><span class="pun">+</span><span class="pln">x </span><span class="pun">/</span><span class="pln">start</span><span class="pun">.</span><span class="pln">sh echo </span><span class="str">"<?php phpinfo(); ?>"</span> <span class="pun">></span> <span class="str">/var/</span><span class="pln">www</span><span class="pun">/</span><span class="pln">html</span><span class="pun">/</span><span class="pln">index</span><span class="pun">.</span><span class="pln">php </span><span class="com"># 设置完成 输入 /start.sh 开启服务</span></code>
请参考 Dockerfile 配置
<code><span class="com"># 安装 mysql (debian使用 mariadb-server,用起来一样)</span><span class="pln"> apt install mariadb</span><span class="pun">-</span><span class="pln">server usermod </span><span class="pun">-</span><span class="pln">a </span><span class="pun">-</span><span class="pln">G aid_inet</span><span class="pun">,</span><span class="pln">aid_net_raw mysql service mysql start mysql </span><span class="pun">-</span><span class="pln">u root </span><span class="pun">-</span><span class="pln">p </span><span class="com"># 没有设置密码,不用密码 </span> <span class="kwd">set</span><span class="pln"> password </span><span class="kwd">for</span><span class="pln"> root@localhost </span><span class="pun">=</span><span class="pln"> password</span><span class="pun">(</span><span class="str">'设置密码'</span><span class="pun">);</span><span class="pln"> CREATE DATABASE wordpress</span><span class="pun">;</span> <span class="com"># 创建一个叫wordpress的数据库,注意分号,语法,不然会出错</span><span class="pln"> USE wordpress</span><span class="pun">;</span> <span class="com"># 选中wordpress数据库</span><span class="pln"> service mysql restart</span></code>
<code><span class="com"># 安装配置 WordPress 博客</span><span class="pln"> cd </span><span class="pun">/</span><span class="kwd">var</span><span class="pun">/</span><span class="pln">www</span><span class="pun">/</span><span class="pln">html curl https</span><span class="pun">:</span><span class="com">//cn.wordpress.org/latest-zh_CN.tar.gz | tar -zx</span><span class="pln"> chown </span><span class="pun">-</span><span class="pln">R www</span><span class="pun">-</span><span class="pln">data</span><span class="pun">:</span><span class="pln">www</span><span class="pun">-</span><span class="pln">data wordpress</span></code>