欢迎来到好人卡资源网,专注网络技术资源收集,我们不仅是网络资源的搬运工,也生产原创资源。寻找资源请留言

手机安装LNMP套件,安装WordPress博客

APP sky995 1年前 (2021-07-07) 254次浏览 0个评论

前置条件,先安装好 Linux Deploy 参考文章

《旧手机烂手机不要换锈钢脸盆,安装Linux Deploy做移动服务器》

安装 Nginx + php + mysql ,配置 WordPress 博客

手机安装LNMP套件,安装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>

好人卡资源网 , 版权所有丨如未注明 , 均为原创丨本网站采用BY-NC-SA协议进行授权
转载请注明原文链接:手机安装LNMP套件,安装WordPress博客
喜欢 (0)
发表我的评论
取消评论

表情 贴图 加粗 删除线 居中 斜体 签到

Hi,您需要填写昵称和邮箱!

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址