Reputation: 19588
I created a custom AMI containing all the libraries that I need for my project, among these I installed the C libraries for MaxMind GeoIP, then I downloaded the GeoCityLite.dat
to /home/ec2-user/geoip/
. I exported the environment variable CG_GEOIP
(as /home/ec2-user/geoip/
) and even GEOIP_LIBRARY_PATH
(pointing it to the location of my installation that is: /usr/lib64/libGeoIP.so
). But Django does not find it, and I get "GeoIP path must be a valid file or directory". (I'm sure the file is there, by connecting via SSH to my instance I can see it). How can I solve my issue?
ps: by using printenv
while connected to my instance no one of the environment variables that I defined in Beanstalk environment settings is displayed... why? (anyway this is not the problem, since variables that I defined are somehow resolved by my app... in fact, the configuration for the database connection is in an environment variable and I know that is resolved since synchdb command works, and I can see the generated tables on my RDS instance)
Upvotes: 0
Views: 1243
Reputation: 10601
If you are trying to get environment variables by connecting to EC2 instance, there are couple of issues.
$ python
in command line is not exactly the same interpreter as the one executing your container code.As for the first part of your question, I would check what values do you get in the container and take it from there.
import os
cg_geoip = os.environ['CG_GEOIP']
geoip_library_path = os.environ['GEOIP_LIBRARY_PATH']
Upvotes: 1