找回密码
 立即注册

QQ登录

只需一步,快速开始

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

[k3] K3内网配合frp和onmp完美打造成家用web服务器配置SSL和http自动跳转https

  [复制链接]
发表于 2018-2-11 15:03 | 显示全部楼层 |阅读模式
本帖最后由 sleikang 于 2018-2-13 23:11 编辑

用的1.6D官改固件
安装onmp WEB环境就不多说了有贴子
k3改官方V1.4固件!完美安装onmp!!!phpMyAdmin-WordPress-Owncloud-Nextcloud-K...
https://www.right.com.cn/forum/thread-263650-1-1.html
(出处: 恩山无线论坛)

帖子里面有个开机启动任务需要改下
sleep 3 && swapon /opt/swapfile
改成
sleep 3 && swapon /opt/.swap

这里讲下ftp如何穿透,首先找到ftp配置文件ftp配置文件在/opt/usr/vsftpd/vsftpd.conf没有的话先启动一次ftp
然后把下面这个添加进去,如图添加进去后,重启FTP
pasv_min_port=1070
pasv_max_port=1076



然后把frp穿透添加进去,这样就可以通过外网frp.xxx.xxx:2121访问FTP了,SSH穿透也在下面,frp.xxx.xxx:2222访问
  1. [common]
  2. server_addr = frp.xxx.xxx (你的穿透服务器)
  3. server_port = 7000 (你的穿透服务器连接端口)
  4. privilege_token = xxx (连接密码)

  5. [FTP]
  6. type = tcp
  7. local_ip = 192.168.2.1
  8. local_port = 21
  9. remote_port = 2121 (可以自行变更)

  10. [FTP1]
  11. type = tcp
  12. local_ip = 192.168.2.1
  13. local_port = 1070
  14. remote_port = 1070

  15. [FTP2]
  16. type = tcp
  17. local_ip = 192.168.2.1
  18. local_port = 1071
  19. remote_port = 1071

  20. [FTP3]
  21. type = tcp
  22. local_ip = 192.168.2.1
  23. local_port = 1072
  24. remote_port = 1072

  25. [FTP4]
  26. type = tcp
  27. local_ip = 192.168.2.1
  28. local_port = 1073
  29. remote_port = 1073

  30. [FTP5]
  31. type = tcp
  32. local_ip = 192.168.2.1
  33. local_port = 1074
  34. remote_port = 1074

  35. [FTP6]
  36. type = tcp
  37. local_ip = 192.168.2.1
  38. local_port = 1075
  39. remote_port = 1075

  40. [FTP7]
  41. type = tcp
  42. local_ip = 192.168.2.1
  43. local_port = 1076
  44. remote_port = 1076

复制代码


再讲下如何配置SSL证书,ssl去阿里云申请免费的,登陆阿里云 控制面板- 安全(云盾)- CA证书服务


申请完后下载下来,在路由器/usr/tmp/share/sda1/etc/nginx目录创建cert文件夹,把下载的文件解压丢进去

然后进入/usr/tmp/share/sda1/etc/nginx/vhost目录找到你要配置ssl证书的网站,如图修改,然后重启onmp即可,当然你的ftp穿透也要把http改成https模式


  1. server {
  2.     listen 81;
  3.     server_name localhost;
  4.     root  /opt/wwwroot/default/;
  5.     index index.html index.htm index.php tz.php;
  6.     ssl on;
  7.     ssl_certificate   cert/xxxxxx.pem;
  8.     ssl_certificate_key  cert/xxxxxx.key;
  9.     ssl_session_timeout 5m;
  10.     ssl_ciphers ECDHE-RSA-AES128-GCM-SHA256:ECDHE:ECDH:AES:HIGH:!NULL:!aNULL:!MD5:!ADH:!RC4;
  11.     ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
  12.     ssl_prefer_server_ciphers on;
  13.     location / {
  14.     root  /opt/wwwroot/default/;
  15.     index index.html index.htm index.php tz.php;
  16.     include     /opt/etc/nginx/conf/php-fpm.conf;
  17.     #otherconf
  18.     }
  19. }
复制代码
开通ssl后如何让http自动跳转https,这里也讲下,如下图修改站点配置文件即可
  1. server {
  2.     listen 81;
  3.     server_name xxx.xxx;
  4.     rewrite ^(.*)$ https://$host$1 permanent;
  5. }
复制代码












本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有账号?立即注册

×

评分

参与人数 1恩山币 +1 收起 理由
Mr_zhaohy + 1 强大的恩山!(以下重复1万次)

查看全部评分

我的恩山、我的无线 The best wifi forum is right here.
发表于 2018-2-11 15:48 | 显示全部楼层
你好,楼主,倒数第二张图片ocloud是个私人网盘吗?具体怎么用的?可以在线看视频不?有没有连接让我体验下,
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

发表于 2018-2-11 15:59 | 显示全部楼层
标记一下,有空折腾.
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

 楼主| 发表于 2018-2-11 16:02 | 显示全部楼层
河南小二 发表于 2018-2-11 15:48
你好,楼主,倒数第二张图片ocloud是个私人网盘吗?具体怎么用的?可以在线看视频不?有没有连接让我体验下 ...

自己装一个就行了,我里面没文件,在线视频这种大数据传送需要家里宽带上传速度高,还有穿透服务器宽带高
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

发表于 2018-2-11 17:00 | 显示全部楼层
sleikang 发表于 2018-2-11 16:02
自己装一个就行了,我里面没文件,在线视频这种大数据传送需要家里宽带上传速度高,还有穿透服务器宽带高 ...

带宽没问题,怎么安装啊…
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

发表于 2018-2-11 17:00 | 显示全部楼层

加个好友交流下吧…
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

 楼主| 发表于 2018-2-11 21:31 | 显示全部楼层
河南小二 发表于 2018-2-11 17:00
带宽没问题,怎么安装啊…

onmp不是自带
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

发表于 2018-2-11 21:46 | 显示全部楼层
sleikang 发表于 2018-2-11 21:31
onmp不是自带

哪个固件啊?
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

发表于 2018-2-16 22:03 | 显示全部楼层
网站穿透,怎么配置的,菜鸟求教程
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

发表于 2018-2-16 23:07 来自手机 | 显示全部楼层
必须mark 一下
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

发表于 2018-2-23 03:06 | 显示全部楼层
你好!证书绑定的域名?这个怎么填写?
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

发表于 2019-3-14 22:15 | 显示全部楼层
请问 斐讯K3路由器 官改固件 的私有云 如何安装SSL证书?  
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

发表于 2020-4-30 11:48 | 显示全部楼层
有没有连接让我体验下,
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

发表于 2022-11-5 01:48 | 显示全部楼层
大神在吗?有事情请教,我的K3官改21D想请您指导加入SSL,公网DDNS。
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

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

本版积分规则

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

GMT+8, 2024-4-19 09:49

Powered by Discuz! X3.5

© 2001-2024 Discuz! Team.

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

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