DZone
Thanks for visiting DZone today,
Edit Profile
  • Manage Email Subscriptions
  • How to Post to DZone
  • Article Submission Guidelines
Sign Out View Profile
  • Post an Article
  • Manage My Drafts
Over 2 million developers have joined DZone.
Log In / Join
Refcards Trend Reports
Events Video Library
Refcards
Trend Reports

Events

View Events Video Library

Trending

  • OpenAPI From Code With Spring and Java: A Recipe for Your CI
  • Lambda-Driven API Design: Building Composable Node.js Endpoints With Functional Primitives
  • LLM-Powered Deep Parsing for Industrial Inventory Search
  • When One MVP Is Really Four Systems: A Better Way to Plan Multi-Role Apps

How to Set Up Your SSL Certificate on Lighttpd in 10 Minutes

Need help setting up your SSL certificate? Check out this tutorial on how to install SSL on the Lighttpd server in under 10 minutes!

By 
S.Prakash Chowdhry user avatar
S.Prakash Chowdhry
·
Sep. 12, 18 · Tutorial
Likes (1)
Comment
Save
Tweet
Share
7.2K Views

Join the DZone community and get the full member experience.

Join For Free

Let's check out this step-by-step SSL installation guide on Lighttpd server.

Step 1: First, you must download the intermediate certificate provided by the CA. You should have received it via email.

Step 2: Once you download the intermedia certificate, copy its contents and paste it into a text editor (i.e. notepad).

Save the file as intermediate.crt.

Step 3: Now, download the x.509 SSL certificate sent by your CA. Save the file as SSL.crt.

It will look something like this:

—–BEGIN CERTIFICATE—–

(SSL Certificate)

—–END CERTIFICATE—–

Step 4: Now, you will need to browse and locate the SSL.crt and .key files that you downloaded. Enter the following command to copy them to your website SSL directory.

# cp ssl.crt /etc/lighttpd/ssl/yourdomain.com

# cp yourdomain.key /etc/lighttpd/ssl/yourdomain.com


Step 5: Once you have entered the aforementioned commands, it’s time to create a .pem file. This can be done by concatenating .key and .crt files. Enter the command below to concatenate and set up the permissions.

# cat yourdomain.key ssl.crt > yourdomain.pem

# chmod 0600 yourdomain.pem

# chown lighttpd:lighttpd /etc/lighttpd/ssl/yourdomain.com -R


Step 6: Open the Lighttpd configuration file using the command below:

# vi /etc/lighttpd/lighttpd.conf


Step 7: Now, you can add the following commands to the configuration section.

$SERVER[“socket”] == “yourdomain.com:443” {

ssl.engine = “enable”

ssl.pemfile = “/etc/lighttpd/yourdomain.com/yourdomain.pem”

ssl.ca-file = “/etc/lighttpd/yourdomain.com/intermediate.crt”

server.name = “yourdomain.com”

server.document-root = “/home/lighttpd/yourdomain.com/https”

server.errorlog = “/var/log/lighttpd/yourdomain.com/serror.log”

accesslog.filename = “/var/log/lighttpd/yourdomain.com/saccess.log”

}

where

ssl.engine = “enable” : Enable lighttpd SSL support

ssl.pemfile = “/etc/lighttpd/yourdomain.com/yourdomain.pem”

ssl.ca-file = “/etc/lighttpd/yourdomain.com/intermediate.crt”


Save and close the file once you’re done.

Step 8: Lastly, you can restart the Lighttpd server using the following command:

# /etc/init.d/lighttpd restart
Lighttpd

Published at DZone with permission of S.Prakash Chowdhry. See the original article here.

Opinions expressed by DZone contributors are their own.

Partner Resources

×

Comments

The likes didn't load as expected. Please refresh the page and try again.

  • RSS
  • X
  • Facebook

ABOUT US

  • About DZone
  • Support and feedback
  • Community research

ADVERTISE

  • Advertise with DZone

CONTRIBUTE ON DZONE

  • Article Submission Guidelines
  • Become a Contributor
  • Core Program
  • Visit the Writers' Zone

LEGAL

  • Terms of Service
  • Privacy Policy

CONTACT US

  • 3343 Perimeter Hill Drive
  • Suite 215
  • Nashville, TN 37211
  • [email protected]

Let's be friends:

  • RSS
  • X
  • Facebook