找回密码
 立即注册

QQ登录

只需一步,快速开始

搜索
广告投放联系QQ68610888
查看: 13120|回复: 13

[N1盒子] 斐讯N1 armbian 系统 docker 下 安装 Nginx+Mariadb+PHP-fpm+Adminer web SSL服务器

  [复制链接]
本帖最后由 dgiuobin 于 2018-10-15 22:24 编辑

SSH登陆armbian
新建mariadb数据库
  1. docker run --name mariadb  -e MYSQL_ROOT_PASSWORD=你设置的密码 -p 3360:3306 -d mariadb:latest
复制代码

新建adminer数据库管理
  1. docker run --name adminer --link mariadb:db -p 8080:8080 arm64v8/adminer
复制代码
在浏览器打开 http://armbian地址:8080 登陆

新建php-fpm
  1. docker run --name nginx-php-fpm \-v nginx-web:/var/www/html  \-p 8000:9000 \-d arm64v8/php:7.2-fpm
复制代码

再到容器下运行命令

  1. docker-php-ext-install pdo pdo_mysql
复制代码


新建nginx

  1. docker run --name nginx \-v nginx-web:/usr/share/nginx/html \-v nginx-conf.d:/etc/nginx \-v nginx-ssl:/ssl \--link nginx-php-fpm:nginx-php-fpm \-p 81:80 \-d nginx:latest
复制代码


nginx-web 文件夹:网站文件
nginx-conf.d 文件夹:网站配置文件
ssl 文件夹:证书文件,名为server.pem 和 server.key

用WinSCP登陆armbian 修改 NGINX  /var/lib/docker/volumes/nginx/_data/conf.d/default.conf 为下面代码
  1. server {
  2.     listen       80;
  3.      listen    443 ssl;
  4.     server_name  localhost;
  5.    ssl on;        #如果强制HTTPs访问,这行要打开
  6.     ssl_certificate /ssl/server.pem;
  7.     ssl_certificate_key /ssl/server.key;
  8.     ssl_session_cache    shared:SSL:1m;
  9.     ssl_session_timeout  5m;
  10.      # 指定密码为openssl支持的格式
  11.      ssl_protocols  SSLv2 SSLv3 TLSv1.2;
  12.      ssl_ciphers  HIGH:!aNULL:!MD5;  # 密码加密方式
  13.      ssl_prefer_server_ciphers  on;   # 依赖SSLv3和TLSv1协议的服务器密码将优先于客户端密码
  14.     #charset koi8-r;
  15.     #access_log  /var/log/nginx/host.access.log  main;
  16.     location / {
  17.         root   /usr/share/nginx/html;
  18.         index  index.html index.htm index.php;
  19.     }
  20.     #error_page  404              /404.html;
  21.     # redirect server error pages to the static page /50x.html
  22.     #
  23.     error_page   500 502 503 504  /50x.html;
  24.     location = /50x.html {
  25.         root   /usr/share/nginx/html;
  26.     }
  27.     # proxy the PHP scripts to Apache listening on 127.0.0.1:80
  28.     #
  29.     #location ~ \.php$ {
  30.     #    proxy_pass   <a href="http://127.0.0.1" target="_blank">http://127.0.0.1</a>;
  31.     #}
  32.     # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
  33.     #
  34.     location ~ \.php$ {
  35.         root           html;
  36.         fastcgi_pass   nginx-php-fpm:9000;
  37.         fastcgi_index  index.php;
  38.         fastcgi_param  SCRIPT_FILENAME  /var/www/html$fastcgi_script_name;
  39.         include        fastcgi_params;
  40.     }
  41.     # deny access to .htaccess files, if Apache's document root
  42.     # concurs with nginx's one
  43.     #
  44.     #location ~ /\.ht {
  45.     #    deny  all;
  46.     #}
  47. }
复制代码

评分

参与人数 2恩山币 +2 收起 理由
righ*** + 1 How ever,this is JB useful!
bac*** + 1 强大的恩山!(以下重复1万次)

查看全部评分

我的恩山、我的无线 The best wifi forum is right here.
这个装了后空闲时负载怎样?

点评

负载问题可以换成 yangxuan8282 的 meson-gxl-s905d-phicomm-n1.dtb,修复有线不稳定,一直负载2.0的问题。 http://www.right.com.cn/forum/thread-341841-1-1.html  详情 回复 发表于 2018-10-16 09:30
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

 楼主| | 显示全部楼层
es123 发表于 2018-10-16 03:20
这个装了后空闲时负载怎样?

负载问题可以换成 yangxuan8282 的 meson-gxl-s905d-phicomm-n1.dtb,修复有线不稳定,一直负载2.0的问题。

https://www.right.com.cn/forum/thread-341841-1-1.html
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

都用Armbian了不能直接装这些吗,为什么还要套个docker呢

点评

因为还有别的软件要安装。WEB服务只是其中一个。  详情 回复 发表于 2018-10-16 11:56
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

 楼主| | 显示全部楼层
er_shi 发表于 2018-10-16 09:37
都用Armbian了不能直接装这些吗,为什么还要套个docker呢

因为还有别的软件要安装。WEB服务只是其中一个。
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

谢谢大神的教程,已成功在armbian里安装了docker,以及nginx+php-fpm+maridadb+adminer了。 不过后续我尝试安装 arm64v8/nextcloud:fpm这个版本的docker的时候,却怎么也无法成功。

看官方hub上写的,是需要一个cy运行的,不想用这个。如果纯用docker run,是否可以通过 --link mariadb:db 和 --volumes-from nginx:nginx   来运行呢?

在运行之前,先进mariadb的容器里,sql,create database和 create user和password。

除此之外,还需要设置什么呢?

求大神指点。小白一个,见笑了。。。

谢谢
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

话说,不用fpm版本的nextcloud,应该是docker image里自带apach和sqlite吧?这样的配合,貌似在n1上运行起来,有点力不从心吧?

nginx+php-fpm+mariadb+nextcloud:fpm的组合,会不会更好一些呢?谢谢。

点评

https://www.microserver.top/ 这个是N1 LNMP网站。速度不错的。  详情 回复 发表于 2019-1-23 15:52
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

 楼主| | 显示全部楼层
telanx 发表于 2019-1-23 14:11
话说,不用fpm版本的nextcloud,应该是docker image里自带apach和sqlite吧?这样的配合,貌似在n1上运行起 ...

https://www.microserver.top/
这个是N1 LNMP网站。速度不错的。
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

还真是,速度不错。完全在Docker运行的啊。赞一个。

还得继续研究一下,怎么弄nextcloud。。。。
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

感谢楼主。
有个小问题php.ini没有找到,不太会修改,方便再指导一下?
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

学习了,感谢分享!
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

老哥怎么使用阿里dns的ipv6啊 请教怎么改
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

弱弱的问一句,小钢炮里的docker行不行?

点评

也可以的。。。。。。。。。。。。。。。。  详情 回复 发表于 2020-2-14 11:36
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

 楼主| | 显示全部楼层
Easier 发表于 2020-1-12 20:52
弱弱的问一句,小钢炮里的docker行不行?

也可以的。。。。。。。。。。。。。。。。
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

关闭

欢迎大家光临恩山无线论坛上一条 /1 下一条

有疑问请添加管理员QQ86788181|手机版|小黑屋|Archiver|恩山无线论坛(常州市恩山计算机开发有限公司版权所有) ( 苏ICP备05084872号 )

GMT+8, 2024-4-29 08:12

Powered by Discuz! X3.5

© 2001-2024 Discuz! Team.

| 江苏省互联网有害信息举报中心 举报信箱:js12377 | @jischina.com.cn 举报电话:025-88802724 本站不良内容举报信箱:68610888@qq.com 举报电话:0519-86695797

快速回复 返回顶部 返回列表