aboutsummaryrefslogtreecommitdiffstats
path: root/README.md
blob: 36b9285645d750d6b8721fc0e95a3adae0caa25a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
# Source Repository for therudes.com
[![Build Status](https://travis-ci.org/mattrude/therudes.com.svg?branch=master)](https://travis-ci.org/mattrude/therudes.com) [![GitHub license](https://img.shields.io/github/license/mattrude/therudes.com.svg)](https://github.com/mattrude/therudes.com/blob/master/LICENSE) [![Open Issues](https://img.shields.io/github/issues-raw/mattrude/therudes.com.svg)](https://github.com/mattrude/therudes.com/issues) [![Maintenance](https://img.shields.io/maintenance/yes/2019.svg)](http://github.com/mattrude/therudes.com)

This is the source repository for the website `therudes.com`.  This is a static site, built using the [Jekyll](https://jekyllrb.com/) scripting language.  The server is only required to server staic files.

## Table of Content

* [Modifying the site](#modifying-the-site)
 * [Changing the Front Page](#changing-the-front-page)
 * [Changing Members Content](#changing-members-content)
* [Building the Site](#building-the-site)
 * [Installing required software](#installing-required-software)
 * [Downloading the source code](#downloading-the-source-code)
 * [Compiling the site](#compiling-the-site)
* [Serving the site](#serving-the-site)
 * [Letsencrypt Build](#letsencrypt-build)
 * [Nginx Full Config](#nginx-full-config)
* [License](#license)

## Modifying the site

### Changing the Front Page

### Changing Members Content

## Building the site

This site may be build on one system, then transferred to another system to be served.  This document will walk you threw installing this site on a [Ubuntu](https://www.ubuntu.com) server, but that does not mean it will not work on other system.

### Installing required software

Before starting, you must installed the below required packages. 

    apt update && apt -y install git ruby ruby-dev

Then install the necessary Ruby Gem's

    gem install rouge
    gem install json
    gem install bundler
    gem install kramdown
    gem install therubyracer
    gem install jekyll
    gem install jekyll-sitemap

### Downloading the source code

After downloading the required packages, you must install the git repository.

    git clone https://github.com/mattrude/therudes.com.git
    cd therudes.com

### Compiling the site

Once you have everything, you must build the site.

    bundle exec jekyll build

The Current config will put the finished site in `/var/www/therudes.com/`

## Serving the site

Since this is a static site, only a simple web server is required to correctly server this site.  The site is currently set to link to TLS `https` encrypted pages, you may disable this function via the `url` item in the `_config.yml` file.

### Letsencrypt Build

To server this site, you first must install the necessary packets.

    apt -y install nginx letsencrypt

And start nginx

    service nginx start

Then add the below into your `nginx.conf` file.

    #----------------------------------------------------------------------
    # therudes.com
    #----------------------------------------------------------------------

    server {
        listen 80;
        listen [::]:80;
        server_name therudes.com;
        server_name www.therudes.com;

        location '/.well-known/acme-challenge' {
            default_type "text/plain";
            root /var/www/therudes.com;
        }

        location / {
            return              301 https://$server_name$request_uri;
        }
    }

And reload the `nginx` config file.

    nginx -s reload

After nginx has reloaded, and the site has been built, using the above setup, you need to create a new SSL key and request a certificate vi `letsencrypt`.

    letsencrypt certonly --webroot -w /var/www/therudes.com -d therudes.com -d www.therudes.com

After successfully creating your new SSL Key and Certificate, you need to add the reset of the config to your `nginx.conf` file.

Add the below section to just below the previously added section to your `nginx.conf` file.

    server {
        listen 443 ssl http2;
        listen [::]:443 ssl http2;
        server_name therudes.com;
        server_name www.therudes.com;
        root /var/www/therudes.com;
        index index.html;

        ssl_certificate         /etc/letsencrypt/live/therudes.com/fullchain.pem;
        ssl_certificate_key     /etc/letsencrypt/live/therudes.com/privkey.pem;
        ssl_stapling on;

        error_page 404 /404.html;
    }

And once again reload the `nginx` config file.

    nginx -s reload

### Nginx Full Config

Add the below to your [nginx](https://nginx.org) config file, and reload your config.

    #----------------------------------------------------------------------
    # therudes.com
    #----------------------------------------------------------------------

    server {
        listen 80;
        listen [::]:80;
        server_name therudes.com;
        server_name www.therudes.com;

        location '/.well-known/acme-challenge' {
            default_type "text/plain";
            root /var/www/therudes.com;
        }

        location / {
            return              301 https://$server_name$request_uri;
        }
    }

    server {
        listen 443 ssl http2;
        listen [::]:443 ssl http2;
        server_name therudes.com;
        server_name www.therudes.com;
        root /var/www/therudes.com;
        index index.html;

        ssl_certificate         /etc/letsencrypt/live/therudes.com/fullchain.pem;
        ssl_certificate_key     /etc/letsencrypt/live/therudes.com/privkey.pem;
        ssl_stapling on;

        error_page 404 /404.html;
    }

## License

    The Source Repository for therudes.com
    Copyright (C) 2016-2019 - Matt Rude <[email protected]>

    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation, either version 3 of the License, or
    (at your option) any later version.

    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with this program.  If not, see <http://www.gnu.org/licenses/>.