Cant load modules/mod_wsgi.so into server; technologies=Django1.8 + Apache + mod_wsgi

时间:2015-05-08 10:08:03

标签: python django apache virtualenv mod-wsgi

On kubuntu 14.04 am configuring django project(virtual env) to run in xampp using mod_wsgi in python3.4

so for that i installed mod_wsgi for python3 by command

//Gets the current height of the screen.
var screenHeight = $(window).height(); 
var row = $('.row');

// Assign that height to the .row
row.css({
    'height': screenHeight + 'px',
});

// This makes the div's height responsive when you resize the screen or the window of the browser.
$(window).resize(function () {
    screenHeight = $(window).height();
    row.css({
        'height': screenHeight + 'px',
    });
});

after that enabled it using command

/**
 * Get all nodes.
 */
NSFetchRequest *request = [NSFetchRequest fetchRequestWithEntityName:@"Node"];
NSMutableArray *nodes = [[[_document managedObjectContext] executeFetchRequest:request error:nil] mutableCopy];
/**
 * Reset the nodes 'visited' flag.
 */
[self reset:nodes];
/**
 * Get sources: predicate for nodes without input ports or with input ports without connections.
 */
[request setPredicate:[NSPredicate predicateWithFormat:@"inputs == nil OR ALL inputs.connection == nil"]];
NSMutableArray *sources = [[[_document managedObjectContext] executeFetchRequest:request error:nil] mutableCopy];
/**
 * Perform a topological sort.
 */
while ([sources count] > 0) {
    /**
     * While there are sources.
     */
    NSManagedObject *node = [sources lastObject];
    /**
     * Add the node to the tail of the final graph (NSMutableArray).
     */
    [_graph addObject:node];
    [node setValue:@([_graph count] - 1) forKey:@"kNodeExecutionIndex"];
    [sources removeLastObject];
    /**
     * Outputs.
     */
    NSMutableSet *outputs = [node valueForKey:@"outputs"];
    for (NSManagedObject *output in outputs) {
        /**
         * Get output connections.
         */
        NSMutableSet *connections = [output valueForKey:@"connections"];
        for (NSManagedObject *connection in connections) {
            /**
             * Set the connection as already visited.
             */
            [connection setValue:@(YES) forKey:@"kConnectionVisited"];
            NSManagedObject *n = [[connection valueForKey:@"destination"] valueForKey:@"node"];
            /**
             * Set the 'source' flag to YES by default.
             */
            BOOL isNewSource = YES;
            /**
             * Get connected inputs.
             */
            NSMutableSet *inputs = [n valueForKey:@"inputs"];
            for (NSManagedObject *input in inputs) {
                /**
                 * Check if one of the input connections was visited.
                 * If not, then we need to process this connection and
                 * don't add it to sources for next pass.
                 */
                if ([[[input valueForKey:@"connection"] valueForKey:@"kConnectionVisited"] isEqualTo:@(NO)]) {
                    isNewSource = NO;
                    break;
                }
            }

            if (isNewSource) {
                [sources addObject:n];
            }
        }
    }
}

in httpd.conf things i have added as follows

std::atomic<std::string*> myString;
// <do fancy stuff with the string... also on other threads>

//A can I do this?
myString.load()->size()

//B can I do this?
char myFifthChar = *(myString.load()->c_str() + 5);

//C can I do this?
char myCharArray[255];
strcpy(myCharArray, myString.load()->c_str());

as per some solution i have commented following code

sudo apt-get install libapache2-mod-wsgi-py3

The exact error am getting is

httpd: Syntax error on line 158 of /opt/lampp/etc/httpd.conf: Cannot load modules/mod_wsgi.so into server: /opt/lampp/modules/mod_wsgi.so: cannot open shared object file: No such file or directory

Now As per loadmodule says that module should be under modules/mod_wsgi.so but i cant find mod_wsgi.so in my modules folder under path /opt/lampp/modules/

when i type sudo a2enmod wsgi it gives output

LoadModule wsgi_module modules/mod_wsgi.so
WSGIScriptAlias / /opt/lampp/htdocs/parth/virtualenvironments/python3.4.3/django_1.8.1_Projects/trial/trial/wsgi.py
WSGIPythonPath /opt/lampp/htdocs/parth/virtualenvironments:/opt/lampp/htdocs/parth/virtualenvironments/python3.4.3/lib/python3.4/site-packages
<Directory /opt/lampp/htdocs/parth/virtualenvironments/python3.4.3/django_1.8.1_Projects/trial/trial>
<Files wsgi.py>
Require all granted
</Files>
</Directory>

and when i add #<Directory /> #AllowOverride none #Require all denied #</Directory> to file then it gives error like

locate mod_wsgi.so

So, what's the problem. Thanks

0 个答案:

没有答案