This question has been archived.

Comparing settings or configuration of virtual environment to live environment

July 28, 2015 1.9k views
Linux Basics Linux Commands Configuration Management Python Python Frameworks Nginx Security Ubuntu

Is there is a way to check the settings/configuration of the virtual environment and compare them to the settings/configuration of the live environment to see what may be different?

I am new to working with servers. My server is running on Ubuntu 14.04, with Gunicorn and Nginx. My web application works perfectly (relatively) in the virtual environment of my server. However, the login feature (using Flask-Login) doesn't work in the live environment, but the rest of the site does. I don't believe this is a permission/privilege issue, since I created a new user and added them to the www-data group, and the site still ran correctly in the virtual environment created by the new limited user.

A little about my specific problem, but I'd like to think this question could I apply to a broader range of languages/applications:

My understanding of the process with flask-login is that when a user logs in and the username/password is validated, the user information is saved to essentially a global variable and a cookie is saved in the user's browser. When the user navigates to a page that requires them to be logged in, the application retrieves the user's cookie from their browser and matches it up to the user information to confirm that they are logged in, and it returns the user information. Here is an example of what is returned from the virtual environment: <User u''> Here is what is returned from the live environment, on the same server from the same process: <flask_login.AnonymousUserMixin object at 0x7f4eebc34890>

My guess is that either the live environment isn't able to access the cookie, it isn't able to save the user login data or it isn't able to access the data. There isn't an error thrown, so debugging is a little more difficult. This issue occurred on every browser I tested (Chrome, Safari, IE).

If I can find out what is different about the 2 environments (which I thought would have been the same), I can try to find a way to resolve the issue. However, I have exhausted every best guess I can come up with.

Here is my code for Gunicorn and Nginx, if it helpful/relevant:

description "Gunicorn application server running myproject"

start on runlevel [2345]
stop on runlevel [!2345]

setuid myuser #This user has admin privileges
setgid www-data

env PATH=/home/myuser/myproject/myprojectenv/bin
chdir /home/myuser/myproject
exec gunicorn --workers 3 --bind unix:myproject.sock -m 007 wsgi # I honestly have no idea what this does/means


server {
    listen 80;
    server_name server_domain_or_IP;

    location / {
        include proxy_params;
        proxy_pass http://unix:/home/myuser/myproject/myproject.sock;
Be the first one to answer this question.