• Home
  • Archive
  • Tools
  • Contact Us

The Customize Windows

Technology Journal

  • Cloud Computing
  • Computer
  • Digital Photography
  • Windows 7
  • Archive
  • Cloud Computing
  • Virtualization
  • Computer and Internet
  • Digital Photography
  • Android
  • Sysadmin
  • Electronics
  • Big Data
  • Virtualization
  • Downloads
  • Web Development
  • Apple
  • Android
Advertisement
You are here: Home » HTTPS in Ubuntu PC localhost with OpenSSL

By Abhishek Ghosh October 26, 2012 10:36 am Updated on October 26, 2012

HTTPS in Ubuntu PC localhost with OpenSSL

Advertisement

HTTPS in Ubuntu PC localhost with OpenSSL is more easier to set up than on Windows PC with WAMP. All you want is to install Apache2 and some knowledge on SSL. If you are looking for HTTPS in WAMP Server on Windows PC, then read this guide instead. For setup of HTTPS in Ubuntu PC localhost with OpenSSL, you need basic LAMP set up.

 

HTTPS in Ubuntu PC localhost with OpenSSL : Basic Setup

 

Only follow these steps for the set up of HTTPS in Ubuntu PC localhost with OpenSSL if you have not installed Apache. A simple command will install Apache2 :

 

Vim
1
sudo apt-get install apache2

 

Open your browser and point to either localhost or your fixed static IP :

Advertisement

---

 

Vim
1
http://localhost/

 

You will see the default Apache2 message – It Works!

If you need full LAMP server setup, run this command instead :

 

Vim
1
sudo apt-get install lamp-server^

 

HTTPS in Ubuntu PC localhost with OpenSSL : The Steps for SSL

 

OpenSSL comes as default package with Apache2 in case of Ubuntu. You need not to install it separately. First enable SSL :

 

Vim
1
sudo a2enmod ssl

 

Then force restart Apache2 :

 

Vim
1
sudo /etc/init.d/apache2 force-reload

 

And create server key (note two commands are separate) :

 

Vim
1
2
3
cd /etc/apache2
 
sudo openssl genrsa -des3 -out server.key 1024

If above last command gives error later, try this command :

Vim
1
sudo openssl genrsa  -out server.key 1024

 

Run this command for certificate request :

 

Vim
1
sudo openssl req -new -key server.key -out server.csr

 

HTTPS in Ubuntu PC localhost with OpenSSL

 

Create a self signed certificate :

Vim
1
sudo openssl x509 -req -days 365 -in server.csr -signkey server.key -out server.crt

 

Install them (note there are two separate commands) :

 

sudo cp server.crt /etc/ssl/certs/
sudo cp server.key /etc/ssl/private/

 

Go to :

 

Vim
1
cd /etc/apache2/sites-available

 

And open the needed file in graphical Gedit :

 

gksudo gedit default-ssl

 

Find and comment out three lines :

 

SSLEngine on
SSLOptions +FakeBasicAuth +ExportCertData +StrictRequire
SSLCertificateFile /etc/ssl/certs/server.crt
SSLCertificateKeyFile /etc/ssl/private/server.key

 

Enable SSL, go to root to run this command :

 

Vim
1
sudo a2ensite default-ssl

 

Actually if you restart Apache2, it should work, but this adds a bit error in the auto config of httpd. So you might need to edit :

 

Vim
1
gksudo gedit httpd.conf

 

This step should normally enable https on your localhost.

Tagged With ssl for localhost ubuntu , openssl ubuntu 18 SSL_CTX_use_certificate , sudo cp server crt /etc/ssl/certs sudo cp server key /etc/ssl/private , ubuntu https at localhost?

This Article Has Been Shared 851 Times!

Facebook Twitter Pinterest
Abhishek Ghosh

About Abhishek Ghosh

Abhishek Ghosh is a Businessman, Surgeon, Author and Blogger. You can keep touch with him on Twitter - @AbhishekCTRL.

Here’s what we’ve got for you which might like :

Articles Related to HTTPS in Ubuntu PC localhost with OpenSSL

Actually a list should normally appear here. Automated calculation failed.

Additionally, performing a search on this website can help you. Also, we have YouTube Videos.

Take The Conversation Further ...

We'd love to know your thoughts on this article.
Meet the Author over on Twitter to join the conversation right now!

If you want to Advertise on our Article or want a Sponsored Article, you are invited to Contact us.

Contact Us

Subscribe To Our Free Newsletter

Get new posts by email:

Please Confirm the Subscription When Approval Email Will Arrive in Your Email Inbox as Second Step.

Search this website…

 

Popular Articles

Our Homepage is best place to find popular articles!

Here Are Some Good to Read Articles :

  • Cloud Computing Service Models
  • What is Cloud Computing?
  • Cloud Computing and Social Networks in Mobile Space
  • ARM Processor Architecture
  • What Camera Mode to Choose
  • Indispensable MySQL queries for custom fields in WordPress
  • Windows 7 Speech Recognition Scripting Related Tutorials

Social Networks

  • Pinterest (22.1K Followers)
  • Twitter (5.8k Followers)
  • Facebook (5.7k Followers)
  • LinkedIn (3.7k Followers)
  • YouTube (1.3k Followers)
  • GitHub (Repository)
  • GitHub (Gists)
Looking to publish sponsored article on our website?

Contact us

Recent Posts

  • What Is A Digital Media Consultancy? May 17, 2022
  • How Artificial Intelligence (AI) Is Changing The Way We Play Bingo May 16, 2022
  • Why You Need A Big Data Consultant May 15, 2022
  • The Connection Between AI And Online Slots May 13, 2022
  • How To Choose Your Niche As An Instagram Influencer May 12, 2022

About This Article

Cite this article as: Abhishek Ghosh, "HTTPS in Ubuntu PC localhost with OpenSSL," in The Customize Windows, October 26, 2012, May 18, 2022, https://thecustomizewindows.com/2012/10/https-in-ubuntu-pc-localhost-with-openssl/.

Source:The Customize Windows, JiMA.in

This website uses cookies. If you do not want to allow us to use cookies and/or non-personalized Ads, kindly clear browser cookies after closing this webpage.

Read Privacy Policy.

PC users can consult Corrine Chorney for Security.

Want to know more about us? Read Notability and Mentions & Our Setup.

Copyright © 2022 - The Customize Windows | dESIGNed by The Customize Windows

Copyright  · Privacy Policy  · Advertising Policy  · Terms of Service  · Refund Policy