Skip to content

Instantly share code, notes, and snippets.

@vvasilev-
Last active August 29, 2015 14:15
Show Gist options
  • Save vvasilev-/159068cd5ede0401a44c to your computer and use it in GitHub Desktop.
Save vvasilev-/159068cd5ede0401a44c to your computer and use it in GitHub Desktop.

Revisions

  1. vvasilev- revised this gist Feb 13, 2015. 1 changed file with 34 additions and 1 deletion.
    35 changes: 34 additions & 1 deletion ssl.md
    Original file line number Diff line number Diff line change
    @@ -21,6 +21,14 @@
    ```

    ## Setup virtual host
    ```
    <VirtualHost *:80>
    DocumentRoot "path-to-public-folder"
    ServerName yourapp.example.com
    ServerAlias *.yourapp.example.com
    </VirtualHost>
    ```

    ```
    <VirtualHost *:443>
    DocumentRoot "path-to-public-folder"
    @@ -31,4 +39,29 @@
    </VirtualHost>
    ```

    Open https://yourapp.example.com
    ----

    .htaccess for Laravel 4+
    ```
    <IfModule mod_rewrite.c>
    <IfModule mod_negotiation.c>
    Options -MultiViews
    </IfModule>
    RewriteEngine On
    # Redirect to HTTPS...
    RewriteCond %{HTTPS} off
    RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
    # Redirect Trailing Slashes...
    RewriteRule ^(.*)/$ /$1 [L,R=301]
    # Handle Front Controller...
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteRule ^ index.php [L]
    </IfModule>
    ```

    Open http://yourapp.example.com and you will be redirected to https://yourapp.example.com
  2. vvasilev- revised this gist Feb 12, 2015. 1 changed file with 2 additions and 2 deletions.
    4 changes: 2 additions & 2 deletions ssl.md
    Original file line number Diff line number Diff line change
    @@ -1,12 +1,12 @@
    ## Requirements

    * installed Apache 2.2 with OpenSSL module bundled
    * installed OpenSSL generator - http://slproweb.com/products/Win32OpenSSL.html
    * installed OpenSSL - http://slproweb.com/products/Win32OpenSSL.html

    ## Self-signed certificate

    * start Windows Command Prompt as Administrator
    * go to C:\OpenSSL\bin
    * go to C:\OpenSSL\bin(or the folder where you installed OpenSSL)
    * follow the steps from 1 to 4 - http://www.akadia.com/services/ssh_test_certificate.html
    * copy the server.key & server.crt to <Apache2.2>/conf/ssl
    * open the httpd.conf and add ``Listen 443``
  3. vvasilev- revised this gist Feb 12, 2015. 1 changed file with 2 additions and 0 deletions.
    2 changes: 2 additions & 0 deletions ssl.md
    Original file line number Diff line number Diff line change
    @@ -5,6 +5,8 @@

    ## Self-signed certificate

    * start Windows Command Prompt as Administrator
    * go to C:\OpenSSL\bin
    * follow the steps from 1 to 4 - http://www.akadia.com/services/ssh_test_certificate.html
    * copy the server.key & server.crt to <Apache2.2>/conf/ssl
    * open the httpd.conf and add ``Listen 443``
  4. vvasilev- revised this gist Feb 12, 2015. 1 changed file with 4 additions and 4 deletions.
    8 changes: 4 additions & 4 deletions ssl.md
    Original file line number Diff line number Diff line change
    @@ -10,23 +10,23 @@
    * open the httpd.conf and add ``Listen 443``
    * enable mod_ssl in httpd.conf
    * at end of httpd.conf add this
    ``
    ```
    <IfModule ssl_module>
    SSLRandomSeed startup builtin
    SSLRandomSeed connect builtin
    SSLSessionCache none
    </IfModule>
    ``
    ```

    ## Setup virtual host
    ``
    ```
    <VirtualHost *:443>
    DocumentRoot "path-to-public-folder"
    ServerName yourapp.example.com
    SSLEngine On
    SSLCertificateFile conf/ssl/server.crt
    SSLCertificateKeyFile conf/ssl/server.key
    </VirtualHost>
    ``
    ```

    Open https://yourapp.example.com
  5. vvasilev- revised this gist Feb 12, 2015. 1 changed file with 4 additions and 4 deletions.
    8 changes: 4 additions & 4 deletions ssl.md
    Original file line number Diff line number Diff line change
    @@ -10,23 +10,23 @@
    * open the httpd.conf and add ``Listen 443``
    * enable mod_ssl in httpd.conf
    * at end of httpd.conf add this
    {{{
    ``
    <IfModule ssl_module>
    SSLRandomSeed startup builtin
    SSLRandomSeed connect builtin
    SSLSessionCache none
    </IfModule>
    }}
    ``

    ## Setup virtual host
    {{{
    ``
    <VirtualHost *:443>
    DocumentRoot "path-to-public-folder"
    ServerName yourapp.example.com
    SSLEngine On
    SSLCertificateFile conf/ssl/server.crt
    SSLCertificateKeyFile conf/ssl/server.key
    </VirtualHost>
    }}}
    ``

    Open https://yourapp.example.com
  6. vvasilev- created this gist Feb 12, 2015.
    32 changes: 32 additions & 0 deletions ssl.md
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,32 @@
    ## Requirements

    * installed Apache 2.2 with OpenSSL module bundled
    * installed OpenSSL generator - http://slproweb.com/products/Win32OpenSSL.html

    ## Self-signed certificate

    * follow the steps from 1 to 4 - http://www.akadia.com/services/ssh_test_certificate.html
    * copy the server.key & server.crt to <Apache2.2>/conf/ssl
    * open the httpd.conf and add ``Listen 443``
    * enable mod_ssl in httpd.conf
    * at end of httpd.conf add this
    {{{
    <IfModule ssl_module>
    SSLRandomSeed startup builtin
    SSLRandomSeed connect builtin
    SSLSessionCache none
    </IfModule>
    }}

    ## Setup virtual host
    {{{
    <VirtualHost *:443>
    DocumentRoot "path-to-public-folder"
    ServerName yourapp.example.com
    SSLEngine On
    SSLCertificateFile conf/ssl/server.crt
    SSLCertificateKeyFile conf/ssl/server.key
    </VirtualHost>
    }}}

    Open https://yourapp.example.com