[root@k8smaster nodejs]# yum install gem ruby ruby-devel -y

[root@k8smaster nodejs]# gem sources -l #查看gem源
[root@k8smaster nodejs]# gem sources -a http://gems.rubyforge.org #添加gem源
[root@k8smaster nodejs]# gem sources --remove https://gems.ruby-china.org/ #删除gem源
[root@k8smaster nodejs]# gem sources -u #更新缓存

[root@k8smaster nodejs]# gem install jekyll

[root@k8smaster nodejs]# gem install bundler

[root@k8smaster nodejs]# wget https://nodejs.org/dist/v4.4.2/node-v4.4.2-linux-x64.tar.xz

解压xz -d node-v4.4.2-linux-x64.tar.xz
解压tar -xvf node-v4.4.2-linux-x64.tar

[root@k8smaster nodejs]# cp -r node-v4.4.2-linux-x64 /usr/local/

添加环境变量

[root@k8smaster nodejs]# vi /etc/profile

在最后面添加
PATH=$PATH:/usr/local/node-v4.4.2-linux-x64/bin
export PATH
使用以下命令使环境变量立即生效source /etc/profile

[root@k8smaster nodejs]# jekyll new myblog #生成静态页面

启动服务

[root@k8smaster nodejs]# cd myblog/
[root@k8smaster myblog]# jekyll server

或者在启动jekyll服务的时候指定端口号

[root@k8smaster myblog]# jekyll serve --port 3000

访问站点
http://127.0.0.1:4000/

[root@k8smaster nodejs]# netstat -anp |grep 4000
tcp 0 0 127.0.0.1:4000 0.0.0.0:* LISTEN 17183/ruby
[root@k8smaster nodejs]#
[root@k8smaster nodejs]# netstat -ano
Active Internet connections (servers and established)
Proto Recv-Q Send-Q Local Address Foreign Address State Timer
tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN off (0.00/0/0)
tcp 0 0 127.0.0.1:25 0.0.0.0:* LISTEN off (0.00/0/0)
tcp 0 0 127.0.0.1:4000 0.0.0.0:* LISTEN off (0.00/0/0)
tcp 0 0 0.0.0.0:111 0.0.0.0:* LISTEN off (0.00/0/0)
tcp 0 232 172.16.160.100:22 172.16.160.103:49767 ESTABLISHED on (0.25/0/0)
tcp6 0 0 :::22 :::* LISTEN off (0.00/0/0)
tcp6 0 0 :::8888 :::* LISTEN off (0.00/0/0)
tcp6 0 0 ::1:25 :::* LISTEN off (0.00/0/0)
tcp6 0 0 :::9999 :::* LISTEN off (0.00/0/0)
tcp6 0 0 :::111 :::* LISTEN off (0.00/0/0)
tcp6 0 0 :::8080 :::* LISTEN off (0.00/0/0)
tcp6 0 0 :::50000 :::* LISTEN off (0.00/0/0)
tcp6 0 0 :::80 :::* LISTEN off (0.00/0/0)
udp 0 0 0.0.0.0:68 0.0.0.0:* off (0.00/0/0)
udp 0 0 127.0.0.1:323 0.0.0.0:* off (0.00/0/0)
udp 0 0 0.0.0.0:48413 0.0.0.0:* off (0.00/0/0)
udp 0 0 172.16.160.100:50776 61.216.153.104:123 ESTABLISHED off (0.00/0/0)
udp6 0 0 ::1:323 :::* off (0.00/0/0)
udp6 0 0 :::3061 :::* off (0.00/0/0)
raw6 0 0 :::58 :::* 7 off (0.00/0/0)

修改端口

[root@k8smaster myblog]# vi + _config.yml

在最后一行后面添加以下内容
port: 1234

访问

[root@k8smaster ~]# curl http://127.0.0.1:1234/
<!DOCTYPE html>
<html lang="en">

<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">

<title>Your awesome title</title>

[root@k8smaster myblog]# ll
总用量 20
-rw-r--r--. 1 root root 525 3月 22 10:32 about.md
-rw-r--r--. 1 root root 1415 3月 22 10:57 _config.yml
-rw-r--r--. 1 root root 953 3月 22 10:32 Gemfile
-rw-r--r--. 1 root root 1180 3月 22 10:34 Gemfile.lock
-rw-r--r--. 1 root root 213 3月 22 10:32 index.md
drwxr-xr-x. 2 root root 50 3月 22 10:32 _posts
drwxr-xr-x. 5 root root 76 3月 22 10:35 _site
[root@k8smaster myblog]# cd _site/
[root@k8smaster _site]# ll
总用量 12
drwxr-xr-x. 2 root root 23 3月 22 10:35 about
drwxr-xr-x. 2 root root 21 3月 22 10:35 assets
-rw-r--r--. 1 root root 3836 3月 22 10:58 feed.xml
-rw-r--r--. 1 root root 5301 3月 22 10:58 index.html
drwxr-xr-x. 3 root root 19 3月 22 10:35 jekyll
[root@k8smaster _site]# pwd
/home/jekyll/myblog/_site
[root@k8smaster _site]#

由于jekyll将地址绑定到了127.0.0.1,导致局域网的其它机器并不能访问它的服务。但实际上只要改变运行jekyll的参数就可以了。

jekyll serve -w --host=0.0.0.0

在CentOS7下安装jekyll的更多相关文章

  1. CentOS7 下 安装 supervisor以及使用

    CentOS7 下 安装 supervisor 以及使用 手动安装 [注] linux环境必须安装 python 1.获取supervisor包:[https://pypi.python.org/py ...

  2. Linux CentOs7 下安装 redis

    Linux CentOs7 下安装 redis 请将以下命令放入linux命令行中运行 如果安装过程前没有安装GCC请先安装  命令如下 $ yum install gcc-c++ $ wget ht ...

  3. Centos7下安装配置Redsocks

    Redsocks是一个开源的网络程序,代码依赖开源的libevent网络库.Redsocks允许你将所有TCP连接重定向到SOCKS或HTTPS代理,比如Shadowsocks(Centos7下安装配 ...

  4. CentOS7下安装SVN服务端

    CentOS7下安装SVN服务 1. yum命令即可方便的完成安装# sudo yum install subversion 测试安装是否成功:# svnserve --version 更改svn的默 ...

  5. centOS7下安装GUI图形界面

    1.如何在centOS7下安装GUI图形界面 当你安装centOS7服务器版本的时候,系统默认是不会安装GUI的图形界面程序,这个需要手动安装CentOS7 Gnome GUI包. 2.在系统下使用命 ...

  6. CentOS7下安装MySQL并配置远程连接

    一.CentOS7下安装MySQL数据库 CentOS7默认的安装包里面已经没有 MySQL-Server安装包了,远程镜像中也没有了. 默认的是MariaDB (MySQL的一个分支,开发这个分支的 ...

  7. Docker学习笔记3:CentOS7下安装Docker-Compose

    Docker-Compose是一个部署多个容器的简单但是非常必要的工具. 安装Docker-Compose之前,请先安装 python-pip,请参考我的另一篇博文CentOS7下安装python-p ...

  8. docker(一) Centos7下安装docker

    docker(一) Centos7下安装dockerdocker(二) windows10下安装dockerdocker(三) 镜像和容器常用命令 docker(四) 使用Dockerfile构建镜像 ...

  9. centos7 下 安装部署nginx

    centos7 下 安装部署nginx 1.nginx安装依赖于三个包,注意安装顺序 a.SSL功能需要openssl库,直接通过yum安装: #yum install openssl b.gzip模 ...

随机推荐

  1. Kafka配置及简单命令使用

    一. Kafka中的相关概念的介绍 Kafka是一个scala实现的分布式消息中间件,其中涉及到的相关概念如下: Kafka中传递的内容称为message(消息),message 是通过topic(话 ...

  2. Python标准模块—Regular Expressions

    作者:zhbzz2007 出处:http://www.cnblogs.com/zhbzz2007 欢迎转载,也请保留这段声明.谢谢! 1 模块简介 正则表达式是一门小语言,你可以在Python中或者其 ...

  3. matlab笔记(1) 元胞结构cell2mat和num2cell

    摘自于:https://zhidao.baidu.com/question/1987862234171281467.html https://www.zybang.com/question/dcb09 ...

  4. iOS 自动构建套件 - flow.ci + fir.im + Coding

    编者按:本文转载自 flow.ci 用户 GitHub@mzying2013 的实践分享,原文链接这里. 前言 相信很多最开始接触自动构建都是从 Jenkins 开始的.都是纯手工搭建,本地代码创库也 ...

  5. OA办公系统,一个沉淀企业文化的容器

    资源是会枯竭的,唯有文化才会生生不息.一切工业产品都是人类智慧创造的.随着公司规模的扩大,企业中两大根本"人和规则"面临诸多挑战,OA办公系统是一个全员使用的办公软件产品,员工可通 ...

  6. ThinkPHP3.2——基础

    1.1.获取ThinkPHP 3.2 获取ThinkPHP的方式很多,官方网站(http://thinkphp.cn)是最好的下载和文档获取来源. 官网提供了稳定版本的下载:http://thinkp ...

  7. zabbix3.2 install

    以下参考官网 一.Zabbix安装配置(ubuntu) 1.Zabbix服务端安装 基础情况 系统 Ubuntu 14.04.4 LTS zabbix版本 zabbix 3.2 ip 192.168. ...

  8. Java中线程的实现:

    Java中线程的实现: 一.线程简介: 实现的两种方式为: 1.Thread类 2.Runnable接口 都在java.lang中 都有共通的方法:public void run() 二.线程常用方法 ...

  9. 解决Windos7中优盘安装centos7后无法引导原系统问题

    一前言 最近学习Linux操作系统,打算在原Window7系统中装centOS7系统,使笔记本上跑双系统.将系统D盘的文件转移后,删除卷标,将U盘做成CentOS7启动盘,进行正常安装.此为前提. 但 ...

  10. Apache solr(一)

    概念:Apache Solr 是一个开源的搜索服务器.Solr 使用 Java 语言开发,主要基于 HTTP 和 Apache Lucene 实现.Apache Solr 中存储的资源是以 Docum ...