CentOS搭建Firekylin个人博客

CentOS搭建Firekylin个人博客

参考:腾讯云手动实验

Firekylin 是一款基于 ThinkJS 开发的开源 NodeJS 博客系统,从零开始快速搭建自己的 Firekylin
个人博客,了解更多内容可参见 https://firekylin.org。

运行环境准备

安装Node.js

[root@localhost ~]# curl --silent --location https://rpm.nodesource.com/setup_8.x | sudo bash -
[root@localhost ~]# yum -y install nodejs

npm安装PM2
通过 NPM 安装进程管理模块 PM2。它是 Node.js 的一个进程管理模块,之后会使用它来管理个人网站进程。

[root@localhost ~]# npm install pm2 -g

安装MySQL

[root@localhost ~]# wget http://dev.mysql.com/get/mysql-community-release-el7-5.noarch.rpm
[root@localhost ~]# rpm -ivh mysql-community-release-el7-5.noarch.rpm
[root@localhost ~]# yum -y install mysql-community-server

启动MySQL服务

[root@localhost ~]# systemctl start mysqld
# 授权
[root@localhost ~]# mysql
mysql> grant all on *.* to 'root'@'localhost' identified by '123.com';

安装nginx

[root@localhost ~]# yum -y install epel-release
[root@localhost ~]# yum -y install nginx

安装配置Firekylin

安装Firekylin

# 如果wget不到这个安装包,就直接复制连接到浏览器下载,或者放在迅雷上进行下载
[root@localhost ~]# wget http://firekylin.org/release/latest.tar.gz

解压安装

[root@localhost ~]# tar zxf latest.tar.gz 
# 安装依赖
[root@localhost ~]# cd firekylin/
[root@localhost firekylin]# npm install

复制配置文件

[root@localhost firekylin]# mv pm2_default.json pm2.json
[root@localhost firekylin]# vim pm2.json
# 修改cwd路径为Firekylin的路径
    "cwd": "/root/firekylin",

启动项目

[root@localhost firekylin]# pm2 startOrReload pm2.json
[PM2][WARN] Applications firekylin not running, starting...
[PM2] App [firekylin] launched (1 instances)
┌────┬────────────────────┬──────────┬──────┬───────────┬──────────┬──────────┐
│ id │ name               │ mode     │ ↺    │ status    │ cpu      │ memory   │
├────┼────────────────────┼──────────┼──────┼───────────┼──────────┼──────────┤
│ 0  │ firekylin          │ fork     │ 0    │ online    │ 0%       │ 12.7mb   │
└────┴────────────────────┴──────────┴──────┴───────────┴──────────┴──────────┘

访问http://192.168.1.10:8360
在这里插入图片描述

在这里插入图片描述
在这里插入图片描述
在这里插入图片描述

使用nginx代理Firekylin

[root@localhost firekylin]# cp nginx_default.conf nginx.conf
[root@localhost firekylin]# vim nginx.conf
server {
   
    listen 80;
    server_name 192.168.1.10;  # 只需要修改这里为域名或者ip即可
    root /root/firekylin;
    set $node_port 8360;
 
    index index.js index.html index.htm;
 
    location ^~ /.well-known/acme-challenge/ {
   
      alias /root/firekylin/ssl/challenges/;
      try_files $uri = 404;
    }
 
    location / {
   
        proxy_http_version 1.1;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header Host $http_host;
        proxy_set_header X-NginX-Proxy true;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection "upgrade";
        proxy_pass http://192.168.1.1:$node_port$request_uri;
        proxy_redirect off;
    }
 
    location = /development.js {
   
        deny all;
    }
    location = /testing.js {
   
        deny all;
    }
 
    location = /production.js {
   
        deny all;
    }
}

软链配置文件

[root@localhost firekylin]# ln -s /root/firekylin/nginx.conf /etc/nginx/conf.d/firekylin.conf

启动nginx

[root@localhost ~]# systemctl start nginx

直接访问ip即可

版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 举报,一经查实,本站将立刻删除。

发布者:全栈程序员-站长,转载请注明出处:https://javaforall.net/101909.html原文链接:https://javaforall.net

赞 (0)
全栈程序员-站长的头像全栈程序员-站长


相关推荐

  • 当前汇总(最新序列号破解)「建议收藏」

    当前汇总(最新序列号破解),https://javaforall.net/100143.html。详细ieda激活码不妨到全栈程序员必看教程网一起来了解一下吧!

    2022年3月20日
  • dubbo-admin管理平台搭建

    dubbo-admin管理平台搭建

    2020年11月12日
  • Redis五种数据类型[通俗易懂]

    Redis简介悲观锁:在每次去拿数据的时候总是认为别人会修改数据,因此,在每次去拿的时候都会加锁,其它人想来拿就只能被阻塞。乐观锁:心很大,每次去拿数据的时候都不认为别人会修改,在取数据的时候不会加锁,乐观锁可以理解为一种检测机制,只是在更新数据的时候会判断一下别人是否已经修改了,如果已经修改了就放弃此次的更新操作,进行重试。检测方式有两种:一种是版本号,一种是时间戳,乐观锁适用于读多的场…

    2022年4月17日
  • dropna()删除缺失值_pandas的dropna方法

    dropna()删除缺失值_pandas的dropna方法约定:importpandasaspdimportnumpyasnpfromnumpyimportnanasNaN滤除缺失数据pandas的设计目标之一就是使得处理缺失数据的任务更加轻松些。pandas使用NaN作为缺失数据的标记。使用dropna使得滤除缺失数据更加得心应手。一、处理Series对象通过dropna(…

    2022年9月18日
  • JS获取html对象的几种方式说明

    document.getElementById("zx");通过ID获取html元素对象,ID号在html文档当中应该是唯一的。返回的是唯一element对象。并且所有浏览器都兼容

    2021年12月20日
  • n卡eth挖矿设置_以太坊挖矿软件配置

    n卡eth挖矿设置_以太坊挖矿软件配置关键词:以太坊挖矿挖矿软件配置ETH挖矿软件配件在挖矿系统选择上,可以选择windows或者Linux,我们以windows为例。(如果想要超频的矿友建议使用Windows系统,因为它对驱动的支持全面,超频工具种类多)系统设置步骤:一.首先我们要为矿机安装一个操作系统,本教程将按照Windows10系统进行讲解。这里是win10系统的下载地址:https://msdn.itellyo…

    2022年10月16日

发表回复

您的邮箱地址不会被公开。 必填项已用 * 标注

关注全栈程序员社区公众号