Skip to main content

How To Install Lighttpd Service

Since lighttpd is a maintained package for Unbuntu, all we have to do is follow the Ubuntu install instructions.

sudo apt-get install lighttpd

Security

Once installed, you may want to tighten security a bit.

cd ~
vi .profile
# change umask to 027 and save
umask 027 # to apply to current session

Sitebuild Script

Now we can create a build script for our site. Go to the directory your Jekyll code is in and create sitebuild.sh containing

#!/bin/bash
docroot="/var/www/html"
sudo -- sh -c "umask 0027; bundle exec jekyll build -d $docroot"
sudo chown -R root:www-data $docroot
sudo chmod -R o-rwx,g-w $docroot

Hopefully this will ensure that none of your site files have any lingering read attributes that they should not.

Finally, you will want to edit your _config.yml and add the following to the end (or at least uncomment some)

exclude:
  - sitebuild.sh
  - Gemfile
  - Gemfile.lock
  - node_modules
  - vendor/bundle/
  - vendor/cache/
  - vendor/gems/
  - vendor/ruby/

Now we can build our site and test it

chmod u+x sitebuild.sh
./sitebuild.sh
lynx localhost

If your happy with the content, then we can commit the changes to github

git add -A
git commit -m "automated our site build"
git push

Sweeten config

To turn on an access log, you will want to enable the module and the configuration option in /etc/lighttpd/lighttpd.conf

server.modules = (
        ...
        "mod_accesslog",
        ...
)

accesslog.filename          = "/var/log/lighttpd/access.log"

To enable our Jekyll 404 message, add the following…

server.error-handler-404    = "/404.html"

Since we are running on a very small instance, I made the following changes to reduce the server load

server.max-request-size     = 65536
server.max-write-idle       = 30
server.max-read-idle        = 10
server.max-connections      = 32
server.max-fds              = 64

Open firewall

Finally if your satisfied with your content, you can open up port 80 on your GCE vm to start serving the site with the following gcloud command

gcloud config set compute/zone {zone}
gcloud compute instances add-tags {vm-name} --tags "http-server"

Further tasks

Some other tasks you may want done.

  1. Get an SSL cert
  2. Roll out your SSL cert and move site to port 443
  3. Build latest version of lighttpd
  4. Setup reverse proxy to serve up other services through lighttpd.

Comments

Popular posts from this blog

How to hack wifi in Windows 7/8/8.1/10 without any software | using with cmd

How to Hack Wifi password using cmd Hello Friends, In this article we will share some tricks that can help you to hack wifi password using cmd. Youcan experiment these trick with your neighbors or friends. It’s not necessarily that this trick will work with every wifi because of upgraded hardware. But you can still try this crack with wifi having old modems or routers. 1: WEP: Wired Equivalent Privacy (WEP) is one of the widely used security key in wifi devices. It is also the oldest and most popular key and was added in 1999. WEP uses 128 bit and 256-bit encryption. With the help of this tutorial, you can easily get into 128-bit encryption and Hack WiFi password using CMD. 2: WAP and WAP2: Wi-Fi Protected Access is an another version of WiFi encryption and was first used in 2003. It uses the 256-bit encryption model and is tough to hack. WAP2 is an updated version of WAP and was introduced in 2006. Since then it has replaced WAP and is now been used mostly in offices and colle...

A Beginner’s Guide to Getting Started with Bitcoin

A man looks for Bitcoin Oasis If you have heard about blockchain or cryptocurrency, then the term that initially comes to mind is Bitcoin . Launched 12 years ago, it was the late 2017 bull run that created a media frenzy that propelled Bitcoin into the mainstream and our modern day lexicon. Often labeled as the “original” cryptocurrency, Bitcoin has been the catalyst (directly and/or indirectly) behind many new innovations in the blockchain and digital asset space, most notably Ethereum and Monero . Shortly after the late 2017 bull run lost its steam, interest in these new technologies started to fade ― but here we are in 2021 with Bitcoin having risen like a phoenix from the ashes. As you would assume, an appetite for the blockchain and digital asset space has returned and now it is more important than ever that we understand what exactly is behind this unique asset, Bitcoin. This article is meant to be a guide for individuals who are new to cryptocurren...

Copilot - Microsoft is gearing up to introduce its AI companion

 Microsoft is gearing up to introduce its AI companion, Copilot, this upcoming fall season. The highly-anticipated rollout is scheduled for September 26, with Copilot poised to seamlessly integrate with various Microsoft services, including Windows 11 and Microsoft 365. Additionally, enterprise customers can look forward to the availability of a new AI assistant, Microsoft 365 Chat, starting in November. Copilot, described by Yusuf Mehdi, Corporate Vice President and Consumer Chief Marketing Officer at Microsoft, as an "everyday AI companion," aims to make your daily workflow smoother and more efficient. Its primary goal is to embed an AI-powered "copilot" within Microsoft's most popular products, ensuring widespread accessibility. What distinguishes Copilot from other AI assistants is its focus on integration. Rather than operating in isolation within specific applications, Copilot promises a seamless user experience across multiple Microsoft products. This com...