Since we have already learned how to set up a single Jekyll sever, the question may come up how to run two or more Jekyll instances in parallel on the same server. This is what we’ll explain in the following.

First, we create a new blog in our existing home directory:

sudo -i
su - jekyll
export GEM_HOME="/home/jekyll/gems"
export PATH="home/jekyll/gems/bin:$PATH"
jekyll new blog1

Now, we have to create the second jekyll service unit file as /lib/systemd/system/jekyll1.service:

[Unit]
Description=Jekyll service
After=syslog.target
After=network.target

[Service]
# Added solution -- add WorkingDirectory to directory where you clone your markdown files for Jekyll to render
WorkingDirectory=/home/jekyll/blog1
# Name of the user account that is running the Jekyll server
User=jekyll
Type=simple
# Location (source) of the markdown files to be rendered
ExecStart=/usr/bin/bash /home/jekyll/start1.sh
Restart=always
StandardOutput=journal
StandardError=journal
SyslogIdentifier=jekyll1

[Install]
WantedBy=multi-user.target

where the start1.sh script reads as

export GEM_HOME='/home/jekyll/gems' 
export PATH='/home/jekyll/gems/bin:$PATH'

cd /home/jekyll/blog1 
export BUNDLE_GEMFILE='/home/jekyll/blog1/Gemfile' 
bundle exec jekyll serve --host 127.0.0.1 --port 4001 

For automated start on boot, we again have to link this service under /etc/systemd/system/multi-user.target.wants:

cd /etc/systemd/system/multi-user.target.wants
sudo ln -s /lib/systemd/system/jekyll1.service .
sudo systemctl daemon-reload

For now, we can start the service manually by sudo service jekyll1 start.

We leave the reverse proxy configuration for the jekyll instance on port 4001 as an exercise to the reader.

That’s it! Now we have a second Jekyll blog running SSL encrypted behind an Apache reverse proxy.