How to setup HTTPS on a Windows Server and how to configure Apache to run SSL/HTTPS server

How to setup HTTPS on a Windows Server? And how to configure Apache to run SSL/HTTPS server?

Install Https apache:
  1. Download apache_x.x.x-win32-x86-openssl-x.x.x.msi from Apache HTTP SERVER PROJECT
  2. Install the apache_x.x.x-win32-x86-openssl-x.x.x.msi setup file.
Setting up HTTPS on a Windows Server:
  1. Open a command prompt and run the below command
    • cd "C:\Program Files\Apache Software Foundation\Apache2.2\bin"
    • set OPENSSL_CONF="C:\Program Files\Apache Software Foundation\Apache2.2\conf\openssl.cnf
    • openssl req -new -key server.key -out server.csr

  2. Fill the value one by one (see the example below)
    Enter passphrase for server.key: You will be asked to enter information that will be incorporated for your certificate request. What you enter is called a Distinguished Name or a DN. In some of the fields, there is a default value. There are a few fields that you can leave blank. Enter '.' to leave the fields blank.
        Country Name (2 letter code) [GB]:IN
        State or Province Name (full name) [Berkshire]:TamilNadu
        Locality Name (eg, city) [Newbury]:Chennai
        Organization Name (eg, company) [My Company Ltd]:My Company Pvt.Ltd
        Organizational Unit Name (eg, section) []:IT
        Common Name (eg, your name or your server's hostname) []:my.webreporter.com
        Email Address []:admin@gmail.com


        Please enter the following 'extra' attributes to be sent with your certificate request
        A challenge password []:
        An optional company name []:mycompany


  3. Now you can get server.csr, server.key file. Use the .csr file to get .crt from SSL vendor (www.comodo.com). Once certificate verification is completed, get the .crt file by mail. Get the .crt file using the below reference.
    INSTANT SSL
  4. Copy the .crt, .key file into C:\Program Files\Apache Software Foundation\Apache2.2\key

Configuring Apache to run SSL/HTTPS server:
  1. Modify the "C:\Program Files\Apache Software Foundation\Apache2.2\conf\httpd.conf" file with NotePad++

  2. Remove any pound sign (#) characters proceeding it in the file httpd.conf.

    LoadModule ssl_module modules/mod_ssl.so
    LoadModule proxy_module modules/mod_proxy.so
    LoadModule proxy_ajp_module modules/mod_proxy_ajp.so
    LoadModule proxy_balancer_module modules/mod_proxy_balancer.so

  3. Include conf/extra/httpd-vhosts.conf

  4. Now, modify the "C:\Program Files\Apache Software Foundation\Apache2.2\conf\extra\httpd-vhosts.conf". Leave all the default options as it is but make sure to modify the following section according to your need.

    <VirtualHost *:80>
    ServerName   my.webreporter.com
    RewriteEngine On
    RewriteCond %{HTTPS} off
    RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI}

    </VirtualHost>
    <VirtualHost _default_:443>
    ServerAdmin some@email.com
    DocumentRoot "C:/Program Files/Apache Software Foundation/Apache2.2/htdocs"
    ServerName my.webreporter.com:443
    ServerAlias my.webreporter.com:443
    ErrorLog "logs/wrp-error.log"
    CustomLog "logs/wrp-access.log" common
    SSLEngine on
    SSLCertificateFile "C:/Program Files/Apache Software Foundation/Apache2.2/key/server.cert"
    SSLCertificateKeyFile "C:/Program Files/Apache Software Foundation/Apache2.2/key/server.key"
    ProxyPass / ajp://localhost:8483/ retry=0
    ProxyPassReverse / ajp://localhost:8483/
    </VirtualHost> 

Opening SSL/HTTPS port on Windows:
Now, you need to open an exception in Windows Firewall for TCP port 443. For this, go to “Windows Firewall” settings in Control Panel and add a port in the exception section. Restart the Apache server.

Reference:


    • Related Articles

    • What is E-Commerce Integration?

      Introduction It is an integration solution provided for the POS users to integrate their POS with an online store which is facilitated via API. API acts as an interface between the POS and the online store, integrates the POS data to the online store ...
    • API for List All Sales Orders

      API for List all Sales Orders (With user validation) Purpose: Used to retrieve all sales Orders Resource URL: http://localhost:8382/WebReporter/api/v1/salesOrders Method: GET Authentication: Set Header As X-Auth-Token: <API - KEY> Request: GET: ...
    • What is API Integration? Which API do we provide for Website integration?

      Overview API integration enables data communication, information exchange between an online store and the POS system. We provide the following APIs... An item with rate and stock API (List all items) Sales order APIs (Create a sales order List all ...
    • How to do the offline setup in ServQuick?

        ServQuick works on Cloud. But when there is poor internet connectivity and you are in the middle of payment, there are chances of the payment not being successful. The offline setup of ServQuick is used at that time to make offline payments.   ...
    • How to configure ServJoy with Server of the POS?

      Configuration of ServJoy with Server POS Steps for configuring ServJoy with Server POS through the Add on products Click Help > About. The About GoFrugal RPOS 6.5 screen is displayed.  Click Add On License. The Add-on product License screen is ...