How to share documentation¶ ↑
1. Build project¶ ↑
-
Build Jekyll project:
$ bundle exec jekyll build
-
Copy/download the content of the
_site
folder. -
You can also zip the content of
_site
folder before download:
$ zip -r docs.zip _site/
2. Share¶ ↑
The built project (the _site
folder) is a static website.
2.1 Open on the computer¶ ↑
Download the project on local computer, navigate to the folder and open the index.html
.
2.2 Host on VPS¶ ↑
-
Copy files to the
/var/www/{project-name}
folder -
Create a new file in
/etc/nginx/sites-available/{project-name}.conf
-
Paste following configuration and adjust: port number, path to the
/var/www/{project-name}
server { listen 4004 default_server; listen [::]:4004 default_server; root /var/www/{project-name}; server_name _; location / { # First attempt to serve request as file, then as directory, then fall back to displaying a 404. try_files $uri $uri/ =404; } }
-
Add symlink
$ ln -s /etc/nginx/sites-available/{project-name}.conf /etc/nginx/sites-enabled/
-
Test configuration
$ nginx -t
-
Reload NGINX
$ systemctl reload nginx
2.2.1 Add basic auth¶ ↑
-
Verify that apache2-utils (Debian, Ubuntu) or httpd-tools (RHEL/CentOS/Oracle Linux) is installed.
-
Create credentials
$ sudo htpasswd -c /etc/nginx/.htpasswd user1
-
Edit
/etc/nginx/sites-available/{project-name}.conf
location / { auth_basic "Private Property"; auth_basic_user_file /etc/nginx/.htpasswd; }
-
Test configuration and reload nginx
$ nginx -t $ systemctl reload nginx
2.3 Host on the AWS S3¶ ↑
-
Create new bucket
-
Upload files
-
Set up ACL, permissions, CORS
-
Set up S3 bucket as hosting