Skip to content

Instantly share code, notes, and snippets.

View HTMLGuyLLC's full-sized avatar
🎯
Focusing

HTMLGuy HTMLGuyLLC

🎯
Focusing
View GitHub Profile
@HTMLGuyLLC
HTMLGuyLLC / SharingEnvVarsUbuntuNginx.md
Last active December 11, 2021 15:47
Sharing Environment Variables between Ubuntu users and Nginx

Sharing Environment Variables Between your Ubuntu user, and Nginx.

Environment: Ubuntu 16.04, Nginx 1.10.3

Step 1

Append the following to your site's .gitignore file so that you don't accidentally commit your environment variables.

/.env
/.env.nginx
@HTMLGuyLLC
HTMLGuyLLC / shared-env-vars.md
Last active January 4, 2024 17:38
How to share environment variables between Ubuntu Users and Apache

Sharing Environment Variables Between your Ubuntu user, and Apache.

Many blogs suggest putting your variables in /etc/environment and including that file in /etc/apache2/envvars, but that solution did not work for me. After hours of searching and testing, this is what I came up with. I figured others may find it useful.

Environment: Ubuntu 16.04, Apache 2.4

Step 1

Append the following to your site's .gitignore file so that you don't accidentally commit your environment variables.

@HTMLGuyLLC
HTMLGuyLLC / cacert.pem
Created March 29, 2017 18:30
To fix CURL Error 60, add this cacert.pem to your PHP.ini
##
## Bundle of CA Root Certificates
##
## Certificate data from Mozilla as of: Wed Jan 18 04:12:05 2017 GMT
##
## This is a bundle of X.509 certificates of public Certificate Authorities
## (CA). These were automatically extracted from Mozilla's root certificates
## file (certdata.txt). This file can be found in the mozilla source tree:
## https://hg.mozilla.org/releases/mozilla-release/raw-file/default/security/nss/lib/ckfw/builtins/certdata.txt
##
@HTMLGuyLLC
HTMLGuyLLC / cacert.pem
Created June 6, 2013 03:40
cacert.pem to create a secure connection to APIs
##
## ca-bundle.crt -- Bundle of CA Root Certificates
##
## Certificate data from Mozilla as of: Sat Dec 29 20:03:40 2012
##
## This is a bundle of X.509 certificates of public Certificate Authorities
## (CA). These were automatically extracted from Mozilla's root certificates
## file (certdata.txt). This file can be found in the mozilla source tree:
## http://mxr.mozilla.org/mozilla/source/security/nss/lib/ckfw/builtins/certdata.txt?raw=1
##