Git Product home page Git Product logo

Comments (5)

sean-kang avatar sean-kang commented on July 29, 2024

I second this.

from scotch-box.

whatnickcodes avatar whatnickcodes commented on July 29, 2024

If you do: "vagrant share --https 443" it will create a local tunnel on a Hashicorp HTTPS server. As for self signed SSL, it's totally possible. I have never done it though

from scotch-box.

sussexrick avatar sussexrick commented on July 29, 2024

I set it up yesterday on my dev box. Admittedly it's Windows but most of the process I followed uses openssl and Apache so is probably exactly the same:

  1. Generate a certificate. I'm not sure if you can do it for an IP, but you could set it up for a hostname like 'scotchbox.local' and recommend people update their hosts file to recognise that. I used this walkthrough. http://www.neilstuff.com/apache2-ssl-windows.html
  2. You can set up the HTTPS site in Apache as an additional VirtualHost, leaving the HTTP site unchanged, which means you could set it up for users to connect exactly as they do now but also have the option of connecting to the same site/folder over HTTPS.
  3. I had to add the certificate to the operating system's certificate store so that it would be trusted, and not generate a warning when accessing the site in a browser. That's for the host OS though, not the scotch box, so it would just mean linking to a tutorial for each OS, and if you don't do it you can still get to the site but you get a warning first.

So I think this would be a simple and really useful change. The only problem I can see is that it's tied to a specific hostname, so multiple scotchboxes would compete for that. But you use a single consistent IP now so it's not that different.

I'd be happy to help you work out the Apache configuration if that would be useful.

from scotch-box.

octoxan avatar octoxan commented on July 29, 2024

@caterwomtious Would step 2 there entail just adding a new .conf file to /etc/apache2/sites-available/?

Struggling to get SSL set up on here. Entire production site uses SSL and redirects all http to https, so seems silly to have to modify my htaccess and site settings every time I pull/push.

from scotch-box.

sussexrick avatar sussexrick commented on July 29, 2024

That was two years ago so I may have forgotten something, but I think it was all done in /apache2/extra/httpd-ssl.conf. That was Apache 2.4 and I don't remember a sites-available folder, so the setup may be different now. The lines I remember adding/enabling in httpd-ssl.conf are:

Listen 443

<VirtualHost mysitename.local:443>

DocumentRoot "C:/path-to-my-source-code/public_html"
<Directory "C:/path-to-my-source-code/public_html">
    Options FollowSymLinks
    AllowOverride All
    Require all granted
</Directory>

ServerName mysitename.local:443
LoadModule php5_module "C:/path-where-php-installed/php5apache2_4.dll"
AddHandler application/x-httpd-php .php

SSLEngine on

SSLCertificateFile "C:/path-to-apache-install/conf/mysitename.local.crt"
SSLCertificateKeyFile "C:/path-to-apache-install/conf/mysitename.local.key"

</VirtualHost>                

On Windows you also need to update the "hosts" file to recognise "mysitename.local" as 127.0.0.1. I think it's a similar process on Linux.

from scotch-box.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.