• 基于Centos搭建 Firekylin 个人网站


    系统要求: CentOS 7.2 64 位操作系统

    安装 Node.js

    使用 yum 命令安装 Node.js

    curl --silent --location https://rpm.nodesource.com/setup_8.x | sudo bash -
    yum -y install nodejs

    使用 NPM 安装 PM2

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

    npm install pm2 -g

    安装 MySQL

    安装过程需要持续大概 15-20min 左右,请耐心等待。

    wget http://dev.mysql.com/get/mysql-community-release-el7-5.noarch.rpm
    rpm -ivh mysql-community-release-el7-5.noarch.rpm
    yum install mysql-community-server -y

    启动 MySQL 服务:

    service mysqld restart

    设置 MySQL 账户 root 密码(下面命令中的密码是教程为您自动生成的,为了方便实验的进行,不建议使用其它密码。如果设置其它密码,请把密码记住,在后续的步骤会使用到):

    /usr/bin/mysqladmin -u root password root'

    安装 Nginx

    在 CentOS 上,可直接使用yum来安装 Nginx(如果是 Debian/Ubuntu 则使用 apt-get 安装即可):

    yum install nginx -y

    安装并配置 Firekylin

    安装 Firekylin

    在服务器上下载安装包

    wget https://firekylin.org/release/latest.tar.gz

    解压安装包

    tar zvxf latest.tar.gz

    安装程序依赖

    cd firekylin
    npm install

    复制项目下的 pm2_default.json 文件生成新文件 pm2.json

    cp pm2_default.json pm2.json

    修改 pm2.json 文件中的 cwd 配置值为项目的当前路径 /root/firekylin

     1 {
     2   "apps": [{
     3     "name": "firekylin",
     4     "script": "www/production.js",
     5     "cwd": "/root/firekylin",
     6     "exec_mode": "fork",
     7     "max_memory_restart": "1G",
     8     "autorestart": true,
     9     "node_args": [],
    10     "args": [],
    11     "env": {
    12 
    13     }
    14   }]
    15 }

    然后通过以下命令启动项目

    pm2 startOrReload pm2.json

    Firekylin 已经启动成功,使用浏览器直接访问 http://118.89.65.22:8360/ 即可看到 Firekylin 的配置界面。

    通过访问 http://118.89.65.22:8360/ 配置信息,配置过程输入参数如截图所示,其中数据库信息中的帐号字段设置为 root密码字段设置为 root数据库名字段设置为 firekylin主机字段设置为 127.0.0.1,其他字段使用默认值;后台管理帐号中的帐号字段使用默认值 admin密码字段设置为 root:

    配置完成后可以通过后台管理帐号设置的帐号密码登录博客管理后台,其值分别为 admin 和 Password4Admin,截图如下所示:

    配置 Nginx

    下面我们就配置 Nginx 使用域名访问我们的网站了。

    复制项目下的 nginx_default.conf 为 nginx.conf

    cp nginx_default.conf nginx.conf

    修改 nginx.conf 文件

     1 server {
     2     listen 80;
     3     server_name www.yourdomain.com; #将 www.yourdomain.com 替换为之前注册并解析的域名
     4     root /root/firekylin;
     5     set $node_port 8360;
     6 
     7     index index.js index.html index.htm;
     8 
     9     location ^~ /.well-known/acme-challenge/ {
    10       alias /root/firekylin/ssl/challenges/;
    11       try_files $uri = 404;
    12     }
    13 
    14     location / {
    15         proxy_http_version 1.1;
    16         proxy_set_header X-Real-IP $remote_addr;
    17         proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    18         proxy_set_header Host $http_host;
    19         proxy_set_header X-NginX-Proxy true;
    20         proxy_set_header Upgrade $http_upgrade;
    21         proxy_set_header Connection "upgrade";
    22         proxy_pass http://127.0.0.1:$node_port$request_uri;
    23         proxy_redirect off;
    24     }
    25 
    26     location = /development.js {
    27         deny all;
    28     }
    29     location = /testing.js {
    30         deny all;
    31     }
    32 
    33     location = /production.js {
    34         deny all;
    35     }
    36 }

    将 nginx.conf 文件软链到 nginx 配置目录下:

    ln -s /root/firekylin/nginx.conf /etc/nginx/conf.d/firekylin.conf

    重启 Nginx

    service nginx restart

    大功告成!

    恭喜,您的 Firekylin 已经部署完成,尽情折腾吧:
    博客访问地址:http://jikexianfeng.xyz
    博客后台地址:http://jikexianfeng.xyz/admin
  • 相关阅读:
    执行插件的替代方式:用JS调用操作
    查找字段的筛选-使用addCustomView
    Dynamics CRM 中Web API中的深度创建(Deep Insert)
    使用JS通过Web API执行批量操作,多个操作是一个事务!
    使用Dynamics 365 CE Web API查询数据加点料及选项集字段常用查询
    配置Postman通过OAuth 2 implicit grant获取Dynamics 365 CE Online实例的Access Token
    Dynamics 365 Customer Engagement中使用JavaScript和C#调用操作Action示例
    Dynamics 365 We API ODATA语法根据父记录查询子记录,根据子记录查询父记录(附上根据团队,队列名称查成员)
    Dynamics 365 Online通过OAuth 2 Client Credential授权(Server-to-Server Authentication)后调用Web API
    控制台程序(C#)不弹出登录窗口连接到Dynamics CRM Online的Web API
  • 原文地址:https://www.cnblogs.com/jikexianfeng/p/8482555.html
Copyright © 2020-2023  润新知